{ // 获取包含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\n```\n\n```css\n\n```\n"},"avg_line_length":{"kind":"number","value":17.1698113208,"string":"17.169811"},"max_line_length":{"kind":"number","value":80,"string":"80"},"alphanum_fraction":{"kind":"number","value":0.6252747253,"string":"0.625275"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.3851596713066101,"string":"0.38516"}}},{"rowIdx":3304,"cells":{"hexsha":{"kind":"string","value":"b9b322409e78bdc5b845a432f1e7674a8291c0d6"},"size":{"kind":"number","value":7802,"string":"7,802"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"articles/event-grid/custom-event-to-hybrid-connection.md"},"max_stars_repo_name":{"kind":"string","value":"Almulo/azure-docs.es-es"},"max_stars_repo_head_hexsha":{"kind":"string","value":"f1916cdaa2952cbe247723758a13b3ec3d608863"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"articles/event-grid/custom-event-to-hybrid-connection.md"},"max_issues_repo_name":{"kind":"string","value":"Almulo/azure-docs.es-es"},"max_issues_repo_head_hexsha":{"kind":"string","value":"f1916cdaa2952cbe247723758a13b3ec3d608863"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"articles/event-grid/custom-event-to-hybrid-connection.md"},"max_forks_repo_name":{"kind":"string","value":"Almulo/azure-docs.es-es"},"max_forks_repo_head_hexsha":{"kind":"string","value":"f1916cdaa2952cbe247723758a13b3ec3d608863"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: Envío de eventos personalizados para Azure Event Grid a la conexión híbrida | Microsoft Docs\ndescription: Use Azure Event Grid y la CLI de Azure para publicar un tema y suscribirse a ese evento. Una conexión híbrida se usa para el punto de conexión.\nservices: event-grid\nkeywords: ''\nauthor: tfitzmac\nms.author: tomfitz\nms.date: 06/29/2018\nms.topic: tutorial\nms.service: event-grid\nms.openlocfilehash: 544f5210adbea6791f9224a1e2be0743ce9995d5\nms.sourcegitcommit: 1d850f6cae47261eacdb7604a9f17edc6626ae4b\nms.translationtype: HT\nms.contentlocale: es-ES\nms.lasthandoff: 08/02/2018\nms.locfileid: \"39434153\"\n---\n# Enrutar eventos personalizados a Conexiones híbridas de Azure Relay con la CLI de Azure y Event Grid\n\nAzure Event Grid es un servicio de eventos para la nube. La solución Conexiones híbridas de Azure Relay es uno de los controladores de eventos compatibles. Las conexiones híbridas se usan como el controlador de eventos cuando es necesario procesar los eventos de las aplicaciones que no tienen un punto de conexión público. Estas aplicaciones pueden estar dentro de la red empresarial corporativa. En este artículo, se usa la CLI de Azure para crear un tema personalizado, suscribirse al tema y desencadenar el evento para ver el resultado. Los eventos se envían a la conexión híbrida.\n\n## Requisitos previos\n\nEn este artículo, se presupone que ya tiene una conexión híbrida y una aplicación de escucha. Para empezar a trabajar con las conexiones híbridas, consulte [Introducción a Conexiones híbridas de Relay: .NET](../service-bus-relay/relay-hybrid-connections-dotnet-get-started.md) o [Introducción a Conexiones híbridas de Relay: nodo](../service-bus-relay/relay-hybrid-connections-node-get-started.md).\n\n[!INCLUDE [event-grid-preview-feature-note.md](../../includes/event-grid-preview-feature-note.md)]\n\n## Creación de un grupo de recursos\n\nLos temas de Event Grid son recursos de Azure y se deben colocar en un grupo de recursos de Azure. El grupo de recursos de Azure es una colección lógica en la que se implementan y administran los recursos de Azure.\n\nCree un grupo de recursos con el comando [az group create](/cli/azure/group#az-group-create). \n\nEn el ejemplo siguiente, se crea un grupo de recursos denominado *gridResourceGroup* en la ubicación *westus2*.\n\n```azurecli-interactive\naz group create --name gridResourceGroup --location westus2\n```\n\n## Creación de un tema personalizado\n\nUn tema de cuadrícula de eventos proporciona un punto de conexión definido por el usuario en el que se registran los eventos. En el ejemplo siguiente se crea el tema personalizado en el grupo de recursos. Reemplace `` por un nombre único para el tema. El nombre del tema debe ser único porque se representa mediante una entrada DNS.\n\n```azurecli-interactive\n# if you have not already installed the extension, do it now.\n# This extension is required for preview features.\naz extension add --name eventgrid\n\naz eventgrid topic create --name -l westus2 -g gridResourceGroup\n```\n\n## Suscripción a un tema\n\nSuscríbase a un tema para indicar a Event Grid los eventos cuyo seguimiento desea realizar. En el ejemplo siguiente se suscribirá al tema que creó y pasará el id. de recurso de la conexión híbrida para el punto de conexión. El identificador de conexión híbrida tiene el formato siguiente:\n\n`/subscriptions//resourceGroups//providers/Microsoft.Relay/namespaces//hybridConnections/`\n\nEn el siguiente script, el identificador de recurso se obtiene del espacio de nombres de Relay. Se genera el identificador de la conexión híbrida y se suscribe a un tema de la cuadrícula de eventos. El script establece el tipo de punto de conexión en `hybridconnection` y se usa el identificador de conexión híbrida para el punto de conexión.\n\n```azurecli-interactive\nrelayname=\nrelayrg=\nhybridname=\n\nrelayid=$(az resource show --name $relayname --resource-group $relayrg --resource-type Microsoft.Relay/namespaces --query id --output tsv)\nhybridid=\"$relayid/hybridConnections/$hybridname\"\n\naz eventgrid event-subscription create \\\n --topic-name \\\n -g gridResourceGroup \\\n --name \\\n --endpoint-type hybridconnection \\\n --endpoint $hybridid\n```\n\n## Creación de una aplicación para procesar eventos\n\nNecesita una aplicación que puede recuperar eventos desde la conexión híbrida. El [ejemplo de consumidor de conexión híbrida de Microsoft Azure Event Grid para C#](https://github.com/Azure-Samples/event-grid-dotnet-hybridconnection-destination) ejecuta esa operación. Ya completó los pasos de requisitos previos.\n\n1. Asegúrese de tener Visual Studio 2017 versión 15.5 o posterior.\n\n1. Clone el repositorio en la máquina local.\n\n1. Cargue el proyecto HybridConnectionConsumer en Visual Studio.\n\n1. En Program.cs, reemplace `` y `` por la cadena de conexión de Relay y el nombre de la conexión híbrida que creó.\n\n1. Compile y ejecute la aplicación desde Visual Studio.\n\n## Envío de un evento al tema\n\nVamos a desencadenar un evento para ver cómo Event Grid distribuye el mensaje al punto de conexión. En este artículo se muestra cómo usar la CLI de Azure para desencadenar el evento. De manera alternativa, puede usar la [aplicación de publicador de Event Grid](https://github.com/Azure-Samples/event-grid-dotnet-publish-consume-events/tree/master/EventGridPublisher).\n\nEn primer lugar, vamos a obtener la dirección URL y la clave del tema personalizado. De nuevo, use el nombre de su tema en ``.\n\n```azurecli-interactive\nendpoint=$(az eventgrid topic show --name -g gridResourceGroup --query \"endpoint\" --output tsv)\nkey=$(az eventgrid topic key list --name -g gridResourceGroup --query \"key1\" --output tsv)\n```\n\nPara simplificar este artículo, va a utilizar datos de evento de ejemplo para enviar al tema. Normalmente, una aplicación o servicio de Azure enviaría los datos del evento. CURL es una utilidad que envía solicitudes HTTP. En este artículo, use CURL para enviar el evento al tema. En el ejemplo siguiente se envían tres eventos al tema de Event Grid:\n\n```azurecli-interactive\nbody=$(eval echo \"'$(curl https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/customevent.json)'\")\ncurl -X POST -H \"aeg-sas-key: $key\" -d \"$body\" $endpoint\n```\n\nLa aplicación de agente de escucha debe recibir el mensaje de evento.\n\n## Limpieza de recursos\nSi piensa seguir trabajando con este evento, no limpie los recursos creados en este artículo. En caso contrario, use el siguiente comando para eliminar los recursos creados en este artículo.\n\n```azurecli-interactive\naz group delete --name gridResourceGroup\n```\n\n## Pasos siguientes\n\nAhora que sabe cómo crear suscripciones a temas y eventos, aprenda más sobre cómo Event Grid puede ayudarle:\n\n- [Una introducción a Azure Event Grid](overview.md)\n- [Enrutamiento de eventos de Blob Storage a un punto de conexión web personalizado](../storage/blobs/storage-blob-event-quickstart.md?toc=%2fazure%2fevent-grid%2ftoc.json)\n- [Supervisión de los cambios en máquinas virtuales con Azure Event Grid y Logic Apps](monitor-virtual-machine-changes-event-grid-logic-app.md)\n- [Transmisión de macrodatos a un almacén de datos](event-grid-event-hubs-integration.md)\n"},"avg_line_length":{"kind":"number","value":62.416,"string":"62.416"},"max_line_length":{"kind":"number","value":585,"string":"585"},"alphanum_fraction":{"kind":"number","value":0.7871058703,"string":"0.787106"},"lid":{"kind":"string","value":"spa_Latn"},"lid_prob":{"kind":"number","value":0.9502696394920349,"string":"0.95027"}}},{"rowIdx":3305,"cells":{"hexsha":{"kind":"string","value":"b9b368716a2618d7a17d21766029ffaace3f0c51"},"size":{"kind":"number","value":8155,"string":"8,155"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"cordovadocs/2017/tips-workarounds/host-a-mac-in-the-cloud.md"},"max_stars_repo_name":{"kind":"string","value":"nschonni/CordovaDocs"},"max_stars_repo_head_hexsha":{"kind":"string","value":"3271e33ca4f8de5e5a319c4e83aa6414b7182ed7"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"cordovadocs/2017/tips-workarounds/host-a-mac-in-the-cloud.md"},"max_issues_repo_name":{"kind":"string","value":"nschonni/CordovaDocs"},"max_issues_repo_head_hexsha":{"kind":"string","value":"3271e33ca4f8de5e5a319c4e83aa6414b7182ed7"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"cordovadocs/2017/tips-workarounds/host-a-mac-in-the-cloud.md"},"max_forks_repo_name":{"kind":"string","value":"nschonni/CordovaDocs"},"max_forks_repo_head_hexsha":{"kind":"string","value":"3271e33ca4f8de5e5a319c4e83aa6414b7182ed7"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: \"Build and simulate a Cordova iOS app in the cloud\"\ndescription: \"Build and simulate a Cordova iOS app in the cloud\"\nservices: \"na\"\nauthor: \"Chuxel\"\nms.technology: \"cordova\"\nms.prod: \"visual-studio-dev15\"\nms.devlang: \"javascript\"\nms.tgt_pltfrm: \"mobile-multiple\"\nms.workload: \"na\"\nms.topic: \"troubleshooting\"\nms.date: \"09/10/2015\"\nms.author: \"clantz\"\n---\n\n# Build and simulate a Cordova iOS app in the cloud\n\nVisual Studio Tools for Apache Cordova allow you to build cross-platform, multi-device hybrid apps using [Apache Cordova](http://cordova.apache.org). You can use the remotebuild agent with a Mac on your network to build, debug, run, and simulate an iOS version of your app. Many developers start their hybrid app development by testing on Android. Later in the development process, when the focus is mainly on verifying and polishing the UI for a set of core devices, they begin testing on iOS. The need to provide each developer on a team with a Mac for this final step is not cost effective. As an alternative to buying Macs, you can use a cloud hosting provider to build and debug your app in the iOS Simulator from a Windows machine, to debug native problems using Xcode, and to submit your app to iTunes using the Apple Application Loader. Cloud hosting providers charge a range of rates, some of which can be very cost effective (particularly if the majority of your development is done on a different platform). In this tutorial, we will describe how to configure Tools for Apache Cordova for use with one provider—[MacInCloud](http://www.macincloud.com).\n\n\n> [!NOTE]\n> The steps shown here can be followed with other Mac hosting providers or with Macs in your own cloud facing datacenter. We recommend that you evaluate providers based on your organization’s needs.\n\n## Install remotebuild\n\nTo get started with MacInCloud, first set up either an account or a trial version. Make sure you enable the remote build port feature during checkout. Once you have provided your login information, connect to your Mac using Remote Desktop, and then you can set up [remotebuild](http://go.microsoft.com/fwlink/?LinkId=618169).\n\n![Opening remote desktop](media/host-a-mac-in-the-cloud/remotebuild_start.png)\n\nIf you chose a MacInCloud plan with a dedicated server, you may have sudo (Administrator) access. With sudo access, just follow the same instructions used to [install the remote agent](../first-steps/ios-guide.md) on an on-premise Mac. If you are using a managed server plan, you will not have sudo access. However, it is worth noting that remotebuild is probably already installed on the machine that you have access to. You can validate this by attempting to start up the agent. In the Terminal App, type:\n\n remotebuild\n\nIf it is not installed, contact MacInCloud support and ask them to install it on your behalf.\n\n## Configure Visual Studio to connect to your cloud hosted Mac\n\nWith one exception, you can use the same process to configure Visual Studio for use with MacInCloud as you do with your own Mac. The host name for MacInCloud is not available externally, so you can either override the host name used by the agent or use an IP address instead.\n\n> [!NOTE]\n>`remotebuild` is not intended to be used as a traditional cloud-based service and you should make sure that you are in compliance with any Apple licensing terms that apply to your organization.\n\n### Option 1: To override the host name and configure Visual Studio\n\n1. Verify whether MacInCloud has already pre-configured your managed server for use with the remotebuild agent. If it is already pre-configured, a RemoteBuild.config file will already exist in your home directory and your agent is ready for use! To verify whether it is present and configured correctly, follow these steps.\n\n2. In the Terminal app on your MacInCloud server, try to open the file in Xcode by executing the following command.\n\n ```\n open -a Xcode ~/.taco_home/RemoteBuild.config\n ```\n\n If the file exists, it will open in Xcode.\n\n3. If the previous command tells you the file does not exist, run the following commands in the Terminal app.\n\n ```\n mkdir ~/.taco_home\n echo \"\" >> ~/.taco_home/RemoteBuild.config\n open –a Xcode ~/.taco_home/RemoteBuild.confg\n ```\n\n Xcode starts with the config file open.\n\n4. Once RemoteBuild.config is open, verify that, at minimum, the following content is present in the file:\n\n ```\n {\n \"hostname\":\" myhostname.macincloud.com\"\n }\n ```\n\n and verify that the host name has been substituted with the host name you use to connect to MacInCloud. Any command line option can be specified this way in the config file, so you can also use this method to modify other settings such as the port used. Type remotebuild help to see a complete list of commands. Save the file if you make changes.\n\n5. After you verify the configuration, type the following command in the Terminal App on your Mac, substituting the MacInCloud host name for `your_hostname` in the command:\n\n ```\n remotebuild certificates reset --hostname=your_hostname\n remotebuild certificates generate\n ```\n\n Or\n\n ```\n remotebuild saveconfig --hostname=your_hostname\n remotebuild certificates reset\n remotebuild certificates generate\n ````\n\n > [!NOTE]\n > If you are running an older version of the agent, the preceding command is not supported. Make sure that you [update the remotebuild agent](../first-steps/ios-guide.md).\n\n Press “Y” and press Enter is prompted. You will now see the following information.\n\n ![Starting the agent for the first time](media/host-a-mac-in-the-cloud/IC816241.png)\n\n6. If it is not already running, start the agent in the Terminal App on your Mac by typing:\n\n ```\n remotebuild\n ```\n\n7. In Visual Studio, open **Tools**, **Options**, **Tools for Apache Cordova**, and then **Remote Agent Configuration**.\n\n8. Configure remote agent settings, mirroring the settings shown in the Terminal App.\n\n >**Important**: The Security PIN expires after 10 minutes by default. To generate a new PIN, see our [documentation](configuration-tips.md#IosPin).\n\n ![Cordova_MacInCloud_Remote_Agent_VS_Config](media/host-a-mac-in-the-cloud/IC816237.png)\n\n That’s it. You are finished configuring the agent!\n\nInstead of overriding the host name, you may instead use the IP address of your MacInCloud server.\n\n### Option 2: To get your IP address and configure Visual Studio\n\n1. In the Terminal App on your Mac, type the following command (make sure you include a space before the final quotation mark, as shown).\n\n ```\n ifconfig | grep \"inet \"\n ```\n\n2. Two IP addresses are displayed. In the steps that follow, you will need the IP address that is not the loopback address (127.0.0.1). For example, if typing the preceding command resulted in the following output, you will need 192.168.0.100.\n\n ```\n inet 127.0.0.1 netmask 0xff000000\n inet 192.168.0.100 netmask oxffffff00 broadcast 192.168.0.1\n ```\n\n3. If it is not already running, start the agent in the Terminal App on your MacInCloud server by typing the following command.\n\n ```\n remotebuild\n ```\n\n The first time you start the agent, you will see output similar to this.\n\n ![Starting the agent for the first time](media/host-a-mac-in-the-cloud/IC816241.png)\n\n4. If you do not see this information, type the following to generate a new PIN:\n\n ```\n remotebuild certificates generate\n ```\n\n Be sure to restart the agent after generating the PIN if you shut it down.\n\n5. In Visual Studio, open **Tools**, **Options**, **Tools for Apache Cordova**, and then **Remote Agent Configuration**.\n\n6. Configure remote agent settings.\n\n Set **Enable remote iOS processing** to **True**, and configure Port and Security PIN using the output from the Terminal App. Instead of using the host name shown in the Terminal App, use the IP address you obtained previously and enter it in the Host field.\n\n Using an IP address to configure VS:\n\n ![Using an IP address to configure VS](media/host-a-mac-in-the-cloud/IC816242.png)\n\n That’s it. You are finished configuring the agent!\n"},"avg_line_length":{"kind":"number","value":51.2893081761,"string":"51.289308"},"max_line_length":{"kind":"number","value":1162,"string":"1,162"},"alphanum_fraction":{"kind":"number","value":0.7518087063,"string":"0.751809"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9977694749832153,"string":"0.997769"}}},{"rowIdx":3306,"cells":{"hexsha":{"kind":"string","value":"b9b3d4faeef42b8a555b003ed8153c8148109030"},"size":{"kind":"number","value":253,"string":"253"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"otto-demo/README.md"},"max_stars_repo_name":{"kind":"string","value":"fgdadiaonan/android-open-project-demo"},"max_stars_repo_head_hexsha":{"kind":"string","value":"2ed4800f62c1a3683a0e16ec56957619acbcc57a"},"max_stars_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_stars_count":{"kind":"number","value":1037,"string":"1,037"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2015-01-04T12:34:16.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2022-03-22T16:30:32.000Z"},"max_issues_repo_path":{"kind":"string","value":"otto-demo/README.md"},"max_issues_repo_name":{"kind":"string","value":"fgdadiaonan/android-open-project-demo"},"max_issues_repo_head_hexsha":{"kind":"string","value":"2ed4800f62c1a3683a0e16ec56957619acbcc57a"},"max_issues_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_issues_count":{"kind":"number","value":3,"string":"3"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2015-03-03T09:35:46.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2016-01-07T14:50:28.000Z"},"max_forks_repo_path":{"kind":"string","value":"otto-demo/README.md"},"max_forks_repo_name":{"kind":"string","value":"fgdadiaonan/android-open-project-demo"},"max_forks_repo_head_hexsha":{"kind":"string","value":"2ed4800f62c1a3683a0e16ec56957619acbcc57a"},"max_forks_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_forks_count":{"kind":"number","value":890,"string":"890"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2015-01-06T08:37:27.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2021-07-29T05:37:33.000Z"},"content":{"kind":"string","value":"Otto Demo\n====================\n###1. Demo Download\n 本地下载 \n###2. Screenshot\n![Screenshot](apk/otto_demo.gif) \n###3. Document\n[How to Use Otto](http://square.github.io/otto/) \n"},"avg_line_length":{"kind":"number","value":28.1111111111,"string":"28.111111"},"max_line_length":{"kind":"number","value":83,"string":"83"},"alphanum_fraction":{"kind":"number","value":0.6126482213,"string":"0.612648"},"lid":{"kind":"string","value":"kor_Hang"},"lid_prob":{"kind":"number","value":0.14378593862056732,"string":"0.143786"}}},{"rowIdx":3307,"cells":{"hexsha":{"kind":"string","value":"b9b3d977c3f013f0dd1bcc10b19e7220bdc3211d"},"size":{"kind":"number","value":3601,"string":"3,601"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"docs/t-sql/statements/pick-a-product-template.md"},"max_stars_repo_name":{"kind":"string","value":"siddudubey/sql-docs"},"max_stars_repo_head_hexsha":{"kind":"string","value":"a7dfef0a654169aa4c29e3093a743cb0de1b3f0e"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"docs/t-sql/statements/pick-a-product-template.md"},"max_issues_repo_name":{"kind":"string","value":"siddudubey/sql-docs"},"max_issues_repo_head_hexsha":{"kind":"string","value":"a7dfef0a654169aa4c29e3093a743cb0de1b3f0e"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"docs/t-sql/statements/pick-a-product-template.md"},"max_forks_repo_name":{"kind":"string","value":"siddudubey/sql-docs"},"max_forks_repo_head_hexsha":{"kind":"string","value":"a7dfef0a654169aa4c29e3093a743cb0de1b3f0e"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: \"Title (Transact-SQL) | Microsoft Docs\"\ndescription: \nms.custom: \"\"\nms.date: 05/22/2019\nms.prod: sql\nms.prod_service: \"database-engine, sql-database, sql-data-warehouse\"\nms.reviewer: \"\"\nms.technology: t-sql\nms.topic: \"language-reference\"\ndev_langs: \n - \"TSQL\"\nhelpviewer_keywords: \nauthor: julieMSFT\nms.author: jrasnick\nmonikerRange: \"=azuresqldb-current||=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azure-sqldw-latest||=azuresqldb-mi-current\"\n---\n# Title (Transact-SQL)\n\nSets database options in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)] and [!INCLUDE[ssSDW](../../includes/sssdw-md.md)]. For other ALTER DATABASE options, see [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md).\n\nClick one of the following tabs for the syntax, arguments, remarks, permissions, and examples for a particular SQL version with which you're working.\n\nFor more information about the syntax conventions, see [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).\n\n[!INCLUDE[select-product](../../includes/select-product.md)]\n\n::: moniker range=\">=sql-server-2016||>=sql-server-linux-2017\"\n\n:::row:::\n :::column:::\n **_\\* SQL Server \\*_**  \n :::column-end:::\n :::column:::\n [SQL Database](pick-a-product-template.md?view=azuresqldb-current)\n :::column-end:::\n :::column:::\n [SQL Managed Instance](pick-a-product-template.md?view=azuresqldb-mi-current)\n :::column-end:::\n :::column:::\n [Azure Synapse
Analytics](pick-a-product-template.md?view=azure-sqldw-latest)\n :::column-end:::\n:::row-end:::\n\n \n\n## SQL Server\n\n\n::: moniker-end\n::: moniker range=\"=azuresqldb-current\"\n\n:::row:::\n :::column:::\n [SQL Server](alter-database-transact-sql-set-options.md)\n :::column-end:::\n :::column:::\n **_\\* SQL Database \\*_**  \n :::column-end:::\n :::column:::\n [SQL Managed Instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)\n :::column-end:::\n :::column:::\n [Azure Synapse
Analytics](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)\n :::column-end:::\n:::row-end:::\n\n \n\n## SQL Database\n\n\n\n::: moniker-end\n::: moniker range=\"=azuresqldb-mi-current\"\n\n:::row:::\n :::column:::\n [SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-ver15&preserve-view=true)\n :::column-end:::\n :::column:::\n [SQL Database](alter-database-transact-sql-set-options.md?view=azuresqldb-current)\n :::column-end:::\n :::column:::\n **_\\* SQL Managed Instance \\*_**  \n :::column-end:::\n :::column:::\n [Azure Synapse
Analytics](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)\n :::column-end:::\n:::row-end:::\n\n \n\n## Azure SQL Managed Instance\n\n::: moniker-end\n::: moniker range=\"=azure-sqldw-latest\"\n\n:::row:::\n :::column:::\n [SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-ver15&preserve-view=true)\n :::column-end:::\n :::column:::\n [SQL Database](alter-database-transact-sql-set-options.md?view=azuresqldb-current)\n :::column-end:::\n :::column:::\n [SQL Managed Instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)\n :::column-end:::\n :::column:::\n **_\\* Azure Synapse
Analytics \\*_**  \n :::column-end:::\n:::row-end:::\n\n \n\n## Azure Synapse Analytics\n\n## Syntax\n\n\n::: moniker-end\n"},"avg_line_length":{"kind":"number","value":29.5163934426,"string":"29.516393"},"max_line_length":{"kind":"number","value":299,"string":"299"},"alphanum_fraction":{"kind":"number","value":0.6489863927,"string":"0.648986"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.13633614778518677,"string":"0.136336"}}},{"rowIdx":3308,"cells":{"hexsha":{"kind":"string","value":"b9b3e7212c5c9c63ec526af0f0947eb058ffd491"},"size":{"kind":"number","value":16405,"string":"16,405"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"SharePoint/SharePointServer/technical-reference/machine-translation-service-in-sharepoint-server.md"},"max_stars_repo_name":{"kind":"string","value":"Acidburn0zzz/OfficeDocs-SharePoint"},"max_stars_repo_head_hexsha":{"kind":"string","value":"7cc3fe90e97fc317ec2305108a6a5d363cc5d89c"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":3,"string":"3"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2018-12-22T08:40:47.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2018-12-23T21:33:52.000Z"},"max_issues_repo_path":{"kind":"string","value":"SharePoint/SharePointServer/technical-reference/machine-translation-service-in-sharepoint-server.md"},"max_issues_repo_name":{"kind":"string","value":"Acidburn0zzz/OfficeDocs-SharePoint"},"max_issues_repo_head_hexsha":{"kind":"string","value":"7cc3fe90e97fc317ec2305108a6a5d363cc5d89c"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"SharePoint/SharePointServer/technical-reference/machine-translation-service-in-sharepoint-server.md"},"max_forks_repo_name":{"kind":"string","value":"Acidburn0zzz/OfficeDocs-SharePoint"},"max_forks_repo_head_hexsha":{"kind":"string","value":"7cc3fe90e97fc317ec2305108a6a5d363cc5d89c"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"number","value":1,"string":"1"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2018-12-22T13:38:33.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2018-12-22T13:38:33.000Z"},"content":{"kind":"string","value":"---\ntitle: \"Machine Translation service in SharePoint Server knowledge articles\"\nms.author: stevhord\nauthor: bentoncity\nmanager: pamgreen\nms.date: 8/15/2017\nms.audience: ITPro\nms.topic: troubleshooting\nms.prod: sharepoint-server-itpro\nlocalization_priority: Normal\nms.collection:\n- IT_Sharepoint_Server\n- IT_Sharepoint_Server_Top\nms.assetid: 38095e9b-5b48-4d2a-a787-3f7900b138e0\ndescription: \"Learn how to resolve alerts about the Machine Translation service in the SharePoint Server management pack for Systems Center Operations Manager (SCOM).\"\n---\n\n# Machine Translation service in SharePoint Server knowledge articles\n\n[!INCLUDE[appliesto-2013-2016-xxx-xxx-md](../includes/appliesto-2013-2016-xxx-xxx-md.md)]\n\nLearn how to resolve alerts about the Machine Translation service in the SharePoint Server 2016 and SharePoint Server 2013 management pack for Systems Center Operations Manager (SCOM).\n \nThe articles in this section are knowledge articles for the Machine Translation service in SharePoint Server. Typically, you would see these articles after clicking a link in an alert in the Operations Manager console. You can use these articles to help you troubleshoot and resolve problems that involve the Machine Translation service. Download and install [System Center Monitoring Pack for SharePoint Server 2016](http://go.microsoft.com/fwlink/?LinkID=746863&clcid=0x409), [System Center Monitoring Pack for SharePoint Server](https://go.microsoft.com/fwlink/p/?LinkId=272568), or [System Center Monitoring Pack for SharePoint Foundation](https://go.microsoft.com/fwlink/p/?LinkId=272567).\n \n- [Machine Translation Service: Queue database not accessible ](#QueueDB)\n \n- [Machine Translation Service: Machine translation failure ](#TransFail)\n \n- [Machine Translation Service: Machine translation failure](#TransFail2)\n \n- [Machine Translation Service not accessible ](#TransServ)\n \n- [Machine Translation Service: Content not accessible ](#TransContent)\n \n- [Machine Translation Service: Worker failure ](#TransWorker)\n \n## Machine Translation Service: Queue database not accessible\n \n\n **Alert Name:**Machine Translation Service: Queue database not accessible\n \n **Summary:** A critical state of this Monitor indicates that the Machine Translation Service cannot access content that it has to translate. \n \nSymptoms:\n \n- New Jobs cannot be submitted successfully.\n \n- Existing Job Items never complete or seem to \"hang\" and make no progress in the Job Queue.\n \n### Cause\n\nOne or more of the following might be the cause:\n \n- The queue database is not responsive enough because of activity on the network or physical SQL server.\n \n- Permissions to access the custom database are no longer valid.\n \n- The queue database is inaccessible.\n \n### Resolution\n\nResolution 1: Verify the status of the SQL Server Machine Translation Service database:\n \n1. On the **SharePoint Central Administration** website, in the **System Settings** section, from the reading pane, click **Manage Servers in this farm**.\n \n2. In the **Farm Information** section, note the **Machine Translation Service** database server, and the name and the version of the configuration database. \n \n3. Start SQL Server Management Studio and connect to the configuration database server.\n \n4. If the configuration database does not exist, run the SharePoint Products and Technologies Configuration Wizard.\n \nResolution 2: Verify the SQL Server network connection:\n \n1. On the **Central Administration** website, in the System Settings section, from the reading pane, click **Manage Servers in this farm**.\n \n2. In the **Farm Information** section, note the Machine Translation Service database server, and the name and the version of the configuration database information. \n \n3. Open a Command Prompt window and type ping to confirm the server connection.\n \n4. Failure to contact the server indicates a problem with the network connection or another problem that prevents a response from the server.\n \n5. Log on to the server and troubleshoot the issue.\n \n## Machine Translation Service: Machine translation failure\n \n\n **Alert Name:**Machine Translation Service: Machine translation failure\n \n **Summary:** A critical state of this Monitor indicates that machine translation through the online translation service, is failing. \n \nSymptoms:\n \nAs long as a connection to the online translation service is not established, the service will function correctly but will fail every Translation Item that is processed.\n \n### Cause\n\nOne or more of the following might be the cause:\n \n- The Machine Translation Service is not connected to the Internet.\n \n- The online translation service is down.\n \n- The online translation service has experienced a certain amount of intermittent failures (beyond a set threshold).\n \n### Resolution\n\nEnsure the Machine Translation Service application has web access:\n \n1. Verify that the user account that is performing this procedure is a member of the Farm Administrators group.\n \n2. On the Central Administration website, in the **Application Management** section, click **Manage service applications**.\n \n3. On the **Manage Service Applications** page, in the list of service applications, click **Machine Translation Service**.\n \n4. In the **Online Translation Connection** section, in the web proxy server box, do one of the following: \n \n - Click **Use default internet settings**. \n \n - Click **Use the proxy specified**, and enter a web proxy server and a port number.\n \nValidate the MachineTranslationAddress, MachineTranslationClientId, and MachineTranslationCategory for the Machine Translation Service application:\n \n1. Verify that the user account that is performing this procedure is a member of the Farm Administrators group.\n \n2. In the PowerShell command prompt, type the following: \n \n `Get-SPServiceApplication -Name \"name\" | ft MachineTranslationAddress, MachineTranslationClientId, MachineTranslationCategory`\n \n where \"name\" is the Name of your Machine Translation Service application.\n \n3. Validate the values returned by comparing against any documentation or making a test call.\n \n4. Correct any values based on validation. If a value cannot be validated, use the default value.\n \n## Machine Translation Service: Machine translation failure\n \n\n **Alert Name:**Machine Translation Service: Machine translation failure\n \n **Summary:**A critical state of this Monitor indicates that the Machine Translation Service Timer Job is failing.\n \nSymptoms:\n \n- New Jobs will successfully enter into the database. However, the translation items for that job will never start.\n \n- The existing Jobs may not finish: Any translation items that are already assigned to application servers may still succeed, but translation items that are not assigned to application servers will not start. That leaves the Job perpetually incomplete.\n \n### Cause\n\nThe Machine Translation Service's queue timer job is not running.\n \n### Resolution\n\nResolution 1: Restart the Machine Translation Service\n \n1. On the **Central Administration website**, in the **System Settings** section, from the reading pane, click **Manage servers in this farm.**\n \n2. In the **Server** column, click the name of the failing application server. The **Services on Server** page opens. \n \n3. In the **Service** column, locate the **Machine Translation Service**. Click **Stop**, and then click **Start**.\n \nResolution 2: Create a new Machine Translation Service application\n \n1. On the **Central Administration website**, in the **Application Management** section, from the reading pane, click **Manage service applications**.\n \n2. In the **Type** column, click the name of the Visio Services application Machine Translation Service application that has the failing service instance. \n \n3. On the ribbon, click **Delete**.\n \n4. In the **Delete Service Application** dialog box, click **OK**.\n \n5. Create a new Machine Translation Service application.\n \n## Machine Translation Service not accessible\n \n\n **Alert Name:**Machine Translation Service not accessible\n \n **Summary:** A critical state of this Monitor indicates that the Machine Translation Service is not accessible. \n \nSymptoms:If service calls are not working for the Machine Translation Service, no jobs can be submitted to the application server for immediate processing or submission to the Job Queue. That is, the service is inaccessible and does not function.\n \n### Cause\n\nOne or more of the following might be the cause:\n \n- The specified SharePoint Server application server is inaccessible.\n \n- The specified application server is responding slowly because of heavy network activity or load on the specific server.\n \n### Resolution\n\nResolution 1: Check the error logs:\n \n- Open the Windows Event Viewer.\n \n- Search for event ID 8049 in the Windows. Application Event log.\n \n- In the event description, note the application server that is failing\n \nResolution 2: Verify the application server connection:\n \n- From the failing application server, open the SharePoint Central Administration Web site.\n \n- If you cannot access the Central Administration site from the failing server, check that the network settings are correct and that the server has appropriate permissions to join the SharePoint farm.\n \nResolution 3: Verify that the Machine Translation Service runs on the failing server:\n \n1. On the **Central Administration** website, in the reading pane, in the **System Settings** section, click **Manage servers in this farm**.\n \n2. Verify that the Machine Translation Service runs on the failing application server.\n \n3. If there is a service application proxy for the failing service application, create a new service application.\n \nResolution 4: Restart the Machine Translation Service:\n \n1. On the **Central Administration** website, in the reading pane, in the **System Settings** section, click **Manage servers in this farm**.\n \n2. In the **Server** column, click the name of the failing application server. The **Services on Server** page opens. \n \n3. In the **Service** column, locate the **Machine Translation Service**, click **Stop**, and then click **Start**.\n \nResolution 5: Create a new Machine Translation Service application:\n \n1. On the **Central Administration** website, in the reading pane, in the **Application Management** section, click **Manage service applications**.\n \n2. In the **Type** column, click the name of the Visio Services application Machine Translation Service application that has the failing service instance. \n \n3. On the ribbon, click **Delete**.\n \n4. In the **Delete Service Application** dialog box, click **OK**.\n \n5. Create a new Machine Translation Service application.\n \n## Machine Translation Service: Content not accessible\n \n\n **Alert Name:**Machine Translation Service: Content not accessible\n \n **Summary:** Critical state of this Monitor indicates that back-end to front-end CSOM calls are failing. \n \nSymptoms: No files can be retrieved for processing and items that are already being processed will not be written. That is, files are inaccessible and items will continuously fail.\n \n### Cause\n\nOne or more of the following might be the cause:\n \n- Server to server Authentication is configured incorrectly.\n \n- The content database is not responsive enough because of activity on the network or physical SQL server.\n \n- Permissions to access the content database are no longer valid.\n \n- The content database is inaccessible.\n \n### Resolution\n\nResolution 1: Verify the status of the SQL Server content database:\n \n1. On the SharePoint Central Administration website, in the **System Settings** section from the reading pane, click **Manage Servers in this farm**.\n \n2. In the **Farm Information** section, note the content database server, and the name and the version of the configuration database. \n \n3. Start SQL Server Management Studio and connect to the content database server.\n \n4. If the content database does not exist, run the SharePoint Products and Technologies Configuration Wizard.\n \nResolution 2: Verify the SQL Server network connection:\n \n1. On the Central Administration website, in the **System Settings** section, from the reading pane, click **Manage Servers in this farm**.\n \n2. In the **Farm Information** section, note the content database server and the name and the version of the content database information. \n \n3. Open a Command Prompt window and type ping to confirm the server connection.\n \n Failure to contact the server indicates a problem with the network connection or another problem that prevents a response from the server.\n \n4. Log on to the server and troubleshoot the issue.\n \nResolution 3: Verify Server to Server Authentication is configured correctly:\n \nSee [Configure server-to-server authentication in SharePoint Server](/sharepoint/security-for-sharepoint-server/security-for-sharepoint-server).\n \n## Machine Translation Service: Worker failure\n \n\n **Alert Name:**Machine Translation Service: Worker failure\n \n **Summary:** A critical state of this Monitor indicates that the Machine Translation Service worker processes are failing. \n \nSymptoms:These errors have to be monitored so end-users are not seeing all the items fail over a certain span of time.\n \n### Cause\n\nOne or more of the following might be the cause:\n \n- Corrupt input file\n \n- Translation worker crash\n \n- Error of saving the file to the local store\n \n### Resolution\n\nResolution 1: Check the error logs:\n \n1. Open the Windows Event Viewer.\n \n2. Search for event ID 8049 in the Windows Application Event log.\n \n3. In the event description, note the application server that is failing.\n \nResolution 2: Verify the application server connection:\n \n1. From the failing application server, open the **SharePoint Central Administration** website. \n \n2. If you cannot access the Central Administration website from the failing server, check that the network settings are correct and that the server has appropriate permissions to join the SharePoint farm.\n \nResolution 3: Verify that the Machine Translation Service runs on the failing server:\n \n1. On the **Central Administration** website, in the reading pane, in the **System Settings** section, click **Manage servers in this farm**.\n \n2. Verify that the Machine Translation Service runs on the failing application server.\n \n3. If there is a service application proxy for the failing service application, create a new service application.\n \nResolution 4: Restart the Machine Translation Service:\n \n1. On the **Central Administration** website, in the reading pane, in the **System Settings** section, click **Manage servers in this farm**.\n \n2. In the **Server** column, click the name of the failing application server. The **Services on Server** page opens. \n \n3. In the **Service** column, locate the **Machine Translation Service**, click **Stop**, and then click **Start**.\n \nResolution 5: Create a new Machine Translation Service application\n \n1. On the Central Administration website, from the reading pane, in the Application Management section, from the reading pane, click Manage service applications.\n \n2. In the **Type** column, click the name of the Visio Services application Machine Translation Service application that has the failing service instance. \n \n3. On the ribbon, click **Delete**.\n \n4. In the **Delete Service Application** dialog box, click OK. \n \n5. Create a new Machine Translation Service application.\n \n## See also\n \n\n#### Concepts\n\n[Plan for monitoring in SharePoint Server](../administration/monitoring-planning.md)\n \n#### Other Resources\n\n[System Center Monitoring Pack for SharePoint Foundation](http://go.microsoft.com/fwlink/p/?LinkId=272567)\n \n[System Center Monitoring Pack for SharePoint Server 2013](https://go.microsoft.com/fwlink/p/?LinkId=272568)\n \n[System Center Monitoring Pack for SharePoint Server 2016](http://go.microsoft.com/fwlink/?LinkID=746863&clcid=0x409)\n\n"},"avg_line_length":{"kind":"number","value":45.1928374656,"string":"45.192837"},"max_line_length":{"kind":"number","value":698,"string":"698"},"alphanum_fraction":{"kind":"number","value":0.7591587931,"string":"0.759159"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9824404716491699,"string":"0.98244"}}},{"rowIdx":3309,"cells":{"hexsha":{"kind":"string","value":"b9b3f5a5d48b43b66410053264e049b5e6ac64e0"},"size":{"kind":"number","value":2096,"string":"2,096"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"Day 3/day-3-2-exercise/test-your-code/README.md"},"max_stars_repo_name":{"kind":"string","value":"Jean-Bi/100DaysOfCodePython"},"max_stars_repo_head_hexsha":{"kind":"string","value":"2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"Day 3/day-3-2-exercise/test-your-code/README.md"},"max_issues_repo_name":{"kind":"string","value":"Jean-Bi/100DaysOfCodePython"},"max_issues_repo_head_hexsha":{"kind":"string","value":"2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"Day 3/day-3-2-exercise/test-your-code/README.md"},"max_forks_repo_name":{"kind":"string","value":"Jean-Bi/100DaysOfCodePython"},"max_forks_repo_head_hexsha":{"kind":"string","value":"2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"## BMI Calculator 2.0\n\n# Instructions\n\nWrite a program that interprets the Body Mass Index (BMI) based on a user's weight and height.\n\nIt should tell them the interpretation of their BMI based on the BMI value.\n\n- Under 18.5 they are underweight\n- Over 18.5 but below 25 they have a normal weight\n- Over 25 but below 30 they are slightly overweight\n- Over 30 but below 35 they are obese\n- Above 35 they are clinically obese.\n\n![](https://cdn.fs.teachablecdn.com/qTOp8afxSkGfU5YGYf36)\n\nThe BMI is calculated by dividing a person's weight (in kg) by the square of their height (in m):\n\n![](https://cdn.fs.teachablecdn.com/jKHjnLrNQjqzdz3MTMyv)\n\n**Warning** you should **round** the result to the nearest whole number. The interpretation message needs to include the words in bold from the interpretations above. e.g. **underweight, normal weight, overweight, obese, clinically obese**. \n\n# Example Input\n\n```\nweight = 85\n```\n\n```\nheight = 1.75\n```\n\n# Example Output\n\n85 ÷ 1.75 x 1.75 = 27.755102040816325\n\n```\nYour BMI is 28, you are slightly overweight.\n```\n\ne.g. When you hit **run**, this is what should happen: \n\n![](https://cdn.fs.teachablecdn.com/mGRynIETXuVqoDk8unci)\n\nThe testing code will check for print output that is formatted like one of the lines below:\n\n```\n\"Your BMI is 18, you are underweight.\"\n\"Your BMI is 22, you have a normal weight.\"\n\"Your BMI is 28, you are slightly overweight.\"\n\"Your BMI is 33, you are obese.\"\n\"Your BMI is 40, you are clinically obese.\"\n```\n\nHint\n\n1. Try to use the **exponent** operator in your code.\n2. Remember to **round** your result to the nearest whole number. \n3. Make sure you include the words in **bold** from the interpretations. \n\n# Test Your Code\n\nBefore checking the solution, try copy-pasting your code into this repl: \n\n[https://repl.it/@appbrewery/day-3-2-test-your-code]([https://repl.it/@appbrewery/day-3-2-test-your-code])\n\nThis repl includes my testing code that will check if your code meets this assignment's objectives. \n\n# Solution\n\n[https://repl.it/@appbrewery/day-3-2-solution](https://repl.it/@appbrewery/day-3-2-solution)"},"avg_line_length":{"kind":"number","value":29.5211267606,"string":"29.521127"},"max_line_length":{"kind":"number","value":242,"string":"242"},"alphanum_fraction":{"kind":"number","value":0.7309160305,"string":"0.730916"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9973503947257996,"string":"0.99735"}}},{"rowIdx":3310,"cells":{"hexsha":{"kind":"string","value":"b9b439c0f36d6eecea6fd4e6cf341b7694aa71b2"},"size":{"kind":"number","value":1246,"string":"1,246"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"hard/pro-poker-hand/README.md"},"max_stars_repo_name":{"kind":"string","value":"Adi142857/sololearn-challenges"},"max_stars_repo_head_hexsha":{"kind":"string","value":"67437d9c202ce6d470042bbe87f20da9fd4a077c"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":83,"string":"83"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2020-01-07T23:02:52.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2022-03-19T06:53:56.000Z"},"max_issues_repo_path":{"kind":"string","value":"hard/pro-poker-hand/README.md"},"max_issues_repo_name":{"kind":"string","value":"Adi142857/sololearn-challenges"},"max_issues_repo_head_hexsha":{"kind":"string","value":"67437d9c202ce6d470042bbe87f20da9fd4a077c"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"number","value":21,"string":"21"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2020-01-23T14:26:13.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2022-03-20T06:30:45.000Z"},"max_forks_repo_path":{"kind":"string","value":"hard/pro-poker-hand/README.md"},"max_forks_repo_name":{"kind":"string","value":"Adi142857/sololearn-challenges"},"max_forks_repo_head_hexsha":{"kind":"string","value":"67437d9c202ce6d470042bbe87f20da9fd4a077c"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"number","value":53,"string":"53"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2020-02-10T13:40:33.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2022-03-13T13:07:33.000Z"},"content":{"kind":"string","value":"# Poker Hand\n\nYou are playing poker with your friends and need to evaluate your hand. \nA hand consists of five cards and is ranked, from lowest to highest, in the following way:\n- High Card: Highest value card (from 2 to Ace).\n- One Pair: Two cards of the same value.\n- Two Pairs: Two different pairs.\n- Three of a Kind: Three cards of the same value.\n- Straight: All cards are consecutive values.\n- Flush: All cards of the same suit.\n- Full House: Three of a kind and a pair.\n- Four of a Kind: Four cards of the same value.\n- Straight Flush: All cards are consecutive values of same suit.\n- Royal Flush: 10, Jack, Queen, King, Ace, in same suit. \n\n## Task:\nOutput the rank of the give poker hand. \n\n## Input Format: \nA string, representing five cards, each indicating the value and suite of the card, separated by spaces. \nPossible card values are: 2 3 4 5 6 7 8 9 10 J Q K A\nSuites: H (Hearts), D (Diamonds), C (Clubs), S (Spades)\nFor example, JD indicates Jack of Diamonds. \n\n## Output Format:\nA string, indicating the rank of the hand (in the format of the above description). \n\n## Sample Input:\n\n```\nJS 2H JC AC 2D\n```\n\n## Sample Output: \n\n```\nTwo Pairs\n```\n\n## Explanation: \nThe hand includes two Jacks and two 2s, resulting in Two Pairs.\n"},"avg_line_length":{"kind":"number","value":29.6666666667,"string":"29.666667"},"max_line_length":{"kind":"number","value":105,"string":"105"},"alphanum_fraction":{"kind":"number","value":0.7142857143,"string":"0.714286"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9950176477432251,"string":"0.995018"}}},{"rowIdx":3311,"cells":{"hexsha":{"kind":"string","value":"b9b466b05683821a1a31346ea98b4dc3813eed1f"},"size":{"kind":"number","value":506,"string":"506"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"_posts/2015-01-15-first-class.md"},"max_stars_repo_name":{"kind":"string","value":"kellygrape/com402"},"max_stars_repo_head_hexsha":{"kind":"string","value":"92b9e7985d77ff618153a32d8737836c7c37c106"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"_posts/2015-01-15-first-class.md"},"max_issues_repo_name":{"kind":"string","value":"kellygrape/com402"},"max_issues_repo_head_hexsha":{"kind":"string","value":"92b9e7985d77ff618153a32d8737836c7c37c106"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"_posts/2015-01-15-first-class.md"},"max_forks_repo_name":{"kind":"string","value":"kellygrape/com402"},"max_forks_repo_head_hexsha":{"kind":"string","value":"92b9e7985d77ff618153a32d8737836c7c37c106"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\nlayout: post\ntitle: Jan 15, 2015 - Syllabus Day / Intro to Class\nassignmentlink: 2015-01-15-assignments\nhasassignment: true\n---\n\n##Lesson Plan\n\n- Review Syllabus\n\n- Review Grading and Attendance Policies\n\n- Getting started with Wordpress\n - Log in to blog space already created\n - Change the color scheme of the website\n - Add a widget to the sidebar\n - Create a home page\n - Change the title of the site\n - Create a post\n - Create a menu and add it to the sidebar. Add a link to class website."},"avg_line_length":{"kind":"number","value":24.0952380952,"string":"24.095238"},"max_line_length":{"kind":"number","value":74,"string":"74"},"alphanum_fraction":{"kind":"number","value":0.7272727273,"string":"0.727273"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.982962965965271,"string":"0.982963"}}},{"rowIdx":3312,"cells":{"hexsha":{"kind":"string","value":"b9b4872cb48187c2781ec4bb5440fb6af2856af3"},"size":{"kind":"number","value":92,"string":"92"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"packages/components/transfer/demo/VirtualScroll.md"},"max_stars_repo_name":{"kind":"string","value":"thinkingOfBetty/idux"},"max_stars_repo_head_hexsha":{"kind":"string","value":"3b99839e1f2e3222c78e98813068b51cc45a09be"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"packages/components/transfer/demo/VirtualScroll.md"},"max_issues_repo_name":{"kind":"string","value":"thinkingOfBetty/idux"},"max_issues_repo_head_hexsha":{"kind":"string","value":"3b99839e1f2e3222c78e98813068b51cc45a09be"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"packages/components/transfer/demo/VirtualScroll.md"},"max_forks_repo_name":{"kind":"string","value":"thinkingOfBetty/idux"},"max_forks_repo_head_hexsha":{"kind":"string","value":"3b99839e1f2e3222c78e98813068b51cc45a09be"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\norder: 4\ntitle:\n zh: 虚拟滚动\n en: Virtual scroll\n---\n\n## zh\n\n虚拟滚动\n\n## en\n\nVirtual scroll\n"},"avg_line_length":{"kind":"number","value":6.1333333333,"string":"6.133333"},"max_line_length":{"kind":"number","value":20,"string":"20"},"alphanum_fraction":{"kind":"number","value":0.5760869565,"string":"0.576087"},"lid":{"kind":"string","value":"spa_Latn"},"lid_prob":{"kind":"number","value":0.1776491105556488,"string":"0.177649"}}},{"rowIdx":3313,"cells":{"hexsha":{"kind":"string","value":"b9b4d6d541097f59330a27ca0c7d646c66e80cd2"},"size":{"kind":"number","value":4350,"string":"4,350"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"content/post/2008-09-25-field-seminar-a-2008-2009-week-1-readings.md"},"max_stars_repo_name":{"kind":"string","value":"kbenoit/kbenoit-site-blogdown"},"max_stars_repo_head_hexsha":{"kind":"string","value":"183a7364ffa987652b47fb229c92a1c563ccd506"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":1,"string":"1"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2017-06-05T09:36:04.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2017-06-05T09:36:04.000Z"},"max_issues_repo_path":{"kind":"string","value":"content/post/2008-09-25-field-seminar-a-2008-2009-week-1-readings.md"},"max_issues_repo_name":{"kind":"string","value":"kbenoit/kbenoit-site-blogdown"},"max_issues_repo_head_hexsha":{"kind":"string","value":"183a7364ffa987652b47fb229c92a1c563ccd506"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"number","value":1,"string":"1"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2018-12-10T04:48:15.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2018-12-10T04:48:15.000Z"},"max_forks_repo_path":{"kind":"string","value":"content/post/2008-09-25-field-seminar-a-2008-2009-week-1-readings.md"},"max_forks_repo_name":{"kind":"string","value":"kbenoit/kbenoit-site-blogdown"},"max_forks_repo_head_hexsha":{"kind":"string","value":"183a7364ffa987652b47fb229c92a1c563ccd506"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"number","value":8,"string":"8"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2017-05-12T15:22:06.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2019-05-16T09:13:19.000Z"},"content":{"kind":"string","value":"---\nauthor: Ken\ncategories:\n- Field Seminar\ndate: \"2008-09-25T11:37:24Z\"\nid: 68\ntitle: PO7003 Field Seminar A in Political Science – 2008-09\nurl: /field-seminar-a-2008-2009-week-1-readings/\n---\n\n\n**Note:** The latest version of the course handout is available from . That version lacks the hyperlinks to the readings below, however.\n\nThe **meeting time and place** is Friday 10-13:00, College Green 4, starting 3 October 2008. In practice the actual length of the Seminar will depend on the instructor, and typically will run from 10-12:00 only. While I am the coordinator for the course, the weekly seminars are led by a rotating set of staff from Political Science  \n\n\n### Week 1 – 3 Oct 2008 – Ken Benoit - Policy Positions and Policy Spaces\n\nKenneth Benoit and Michael Laver. 2006. _[**Party Policy in Modern Democracies**](http://www.politics.tcd.ie/ppmd/)_. London: Routledge, 2006. Wiesehomeier, Nina and Kenneth Benoit.\"Presidents, Parties And Policy Competition.\"University of Konstanz and Trinity College Dublin manuscript. [**Version: July 7, 2008.**](/pdfs/PPPC_LatinAm_7july2008.pdf)\n\n\n\n### Week 2 – 10 Oct – Ken Benoit - Electoral System Origins\n\n\n\n\n Kenneth Benoit. 2007. \"[Electoral Laws as Political Consequences: Explaining the Origins and Change of Electoral Institutions](http://arjournals.annualreviews.org/doi/pdf/10.1146/annurev.polisci.10.072805.101608).\"_Annual Review of Political Science_ 10: 363-90.\n\n\n\n Boix, C. 1999. \"[Setting the rules of the game: The choice of electoral systems in advanced democracies](http://www.tcd.ie/Political_Science/local/docs/boix_1999_apsr.pdf).\"_American Political Science Review_ 93 (3): 609-624.\n\n\n\n Andrews, Josephine and Robert Jackman. 2005. \"[Strategic Fools: Electoral rule choice under extreme uncertainty](http://www.tcd.ie/Political_Science/local/docs/andrews_jackman_2005_elstud.pdf).\"_Electoral Studies_ 24: 65-84.\n\n\n\n Colomer, Josep M. (2004). “[The Strategy and History of Electoral System Choice](http://www.tcd.ie/Political_Science/local/docs/Colomer_ElectSysChoice.pdf).” In Josep M. Colomer (Ed.), _Handbook of Electoral System Choice_, pp. 3\"78. New York: Palgrave Macmillan. (photocopied)\n\n\n\n Birch, Sarah, Frances Millard, Marina Popescu, and Kieran Williams (2002). _Embodying Democracy: Electoral System Design in Post-Communist Europe_. Houndmills, Basingstoke: Palgrave Macmillan. Ch 1. (photocopied)\n\n\n\n 2004. Benoit, Kenneth and Jacqueline Hayden. \"[Institutional Change and Persistence: The Evolution of Poland’s Electoral System 1989-2001](/pdfs/BenoitHayden_JOP2004.pdf).\"_Journal of Politics _66 (May, 2): 396-427.\n\n\n\n\n\n\n### Week 3 – 17 Oct – Ken Benoit - Electoral System Consequences\n\n\n\n\n Gallagher, Michael and Paul Mitchell. 2005. \"[Introduction to Electoral Systems](http://www.tcd.ie/Political_Science/local/docs/01-Gallagher-chap01.pdf).\"In Michael Gallagher and Paul Mitchell, eds., _The Politics of Electoral Systems_. Oxford: Oxford University Press. pp3-24.\n\n\n\n Cox, Gary W. 1997. _Making votes count: strategic coordination in the world’s electoral systems_, _Political economy of institutions and decisions_. Cambridge, U.K. ; New York: Cambridge University Press.\n\n\n\n Duverger, Maurice. 1959. _Political parties: Their organization and activity in the modern state_. Second English Revised ed. London: Methuen & Co. Book II, Chapter 1, \"The Number of Parties.\"Also see [this related reading](olitical_Science/local/docs/olitical_Science/local/docs/Duverger_InfOfElectSys.pdf).\n\n\n\n Duverger, Maurice. 1986. Duverger’s Law: Forty Years Later. In _Electoral Laws and Their Political Consequences_, edited by B. Grofman and A. Lijphart. New York: Agathon Press.\n\n\n\n Gallagher, Michael. 1991. “[Proportionality, disproportionality, and electoral systems](http://www.tcd.ie/Political_Science/local/docs/Gallagher_1991_ES.pdf).” _Electoral Studies_ 10 (1): 33-51.\n\n\n\n Ordeshook, Peter, and Olga Shvetsova. 1994. “[Ethnic heterogeneity, district magnitude, and the number of parties](http://www.tcd.ie/Political_Science/local/docs/Ordeshook_Shvetsova_1994_AJPS.pdf).” _American Journal of Political Science_ 38 (1): 100-123.\n\n\n\n\n\n\n\n\n"},"avg_line_length":{"kind":"number","value":48.8764044944,"string":"48.876404"},"max_line_length":{"kind":"number","value":350,"string":"350"},"alphanum_fraction":{"kind":"number","value":0.7666666667,"string":"0.766667"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.4445814788341522,"string":"0.444581"}}},{"rowIdx":3314,"cells":{"hexsha":{"kind":"string","value":"b9b5afa0764bd6073a401ec6fef27c1a8db34a5b"},"size":{"kind":"number","value":1350,"string":"1,350"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"2020/10/21/2020-10-21 04:55.md"},"max_stars_repo_name":{"kind":"string","value":"zhzhzhy/WeiBoHot_history"},"max_stars_repo_head_hexsha":{"kind":"string","value":"32ce4800e63f26384abb17d43e308452c537c902"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":3,"string":"3"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2020-07-14T14:54:15.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2020-08-21T06:48:24.000Z"},"max_issues_repo_path":{"kind":"string","value":"2020/10/21/2020-10-21 04:55.md"},"max_issues_repo_name":{"kind":"string","value":"zhzhzhy/WeiBoHot_history"},"max_issues_repo_head_hexsha":{"kind":"string","value":"32ce4800e63f26384abb17d43e308452c537c902"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"2020/10/21/2020-10-21 04:55.md"},"max_forks_repo_name":{"kind":"string","value":"zhzhzhy/WeiBoHot_history"},"max_forks_repo_head_hexsha":{"kind":"string","value":"32ce4800e63f26384abb17d43e308452c537c902"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"2020年10月21日04时数据\nStatus: 200\n\n1.李佳琦直播\n\n微博热度:151940\n\n2.男子逃亡30年自首发现弄错\n\n微博热度:135530\n\n3.Angelababy丝绒红唇\n\n微博热度:132860\n\n4.邓伦家房子真的塌了\n\n微博热度:125257\n\n5.被双11规则逼疯的我\n\n微博热度:105501\n\n6.周杰伦代言海澜之家\n\n微博热度:101705\n\n7.理性消费按需购物\n\n微博热度:67539\n\n8.薇娅直播\n\n微博热度:64015\n\n9.90后女孩拍摄微观菌奇幻世界\n\n微博热度:59383\n\n10.赵立坚批美国有些人纯粹是酸葡萄心态\n\n微博热度:57381\n\n11.半是蜜糖半是伤\n\n微博热度:56946\n\n12.王一博刘雯同框\n\n微博热度:46122\n\n13.中日韩三国的怼人差异\n\n微博热度:46112\n\n14.心动的信号\n\n微博热度:45968\n\n15.抗疫夫妻为救人第二次错过婚礼\n\n微博热度:45831\n\n16.iPhone12蓝色\n\n微博热度:45764\n\n17.济南交警通报水泥罐车侧翻压扁轿车\n\n微博热度:45612\n\n18.127岁湖南第一寿星田龙玉去世\n\n微博热度:45587\n\n19.刘诗诗宋茜合照\n\n微博热度:44935\n\n20.双十一养猫\n\n微博热度:42898\n\n21.彭昱畅连续五年为许魏洲庆生\n\n微博热度:40490\n\n22.战清泓终于分手了\n\n微博热度:37778\n\n23.2020胡润百富榜揭晓\n\n微博热度:27749\n\n24.轿车冲出公路开上居民房顶\n\n微博热度:27709\n\n25.李小川追妻\n\n微博热度:26126\n\n26.你心目中媚骨天成的女演员\n\n微博热度:25244\n\n27.李雪琴想要采访吴亦凡\n\n微博热度:24770\n\n28.4AM\n\n微博热度:24207\n\n29.熊顿人间陀螺\n\n微博热度:24028\n\n30.安倍称推迟东京奥运前征得特朗普同意\n\n微博热度:23964\n\n31.雪梨谭松韵直播\n\n微博热度:23964\n\n32.张翰耳朵跳舞\n\n微博热度:23962\n\n33.神仙耳光炒饭\n\n微博热度:23957\n\n34.iPhone12pro\n\n微博热度:23372\n\n35.青岛所有进口冷链产品每件必检\n\n微博热度:22763\n\n36.陈奕迅称很久没有收入了\n\n微博热度:22742\n\n37.李现为保持状态不烟不酒\n\n微博热度:22720\n\n38.双十一来临前的焦虑感\n\n微博热度:22659\n\n39.阴阳师\n\n微博热度:22132\n\n40.坚果手机发布会\n\n微博热度:22065\n\n41.周星驰方否认拖欠巨额债务\n\n微博热度:22043\n\n42.杨幂上海路透\n\n微博热度:22041\n\n43.明日方舟\n\n微博热度:21980\n\n44.青岛找到新冠病毒物传人证据链\n\n微博热度:21768\n\n45.大学封校两小狗隔桥对望\n\n微博热度:21685\n\n46.好演员投票结果\n\n微博热度:21042\n\n47.95岁母亲靠摸头分辨4个儿子\n\n微博热度:20608\n\n48.袁帅花式追妻\n\n微博热度:20515\n\n49.女大学生的快乐\n\n微博热度:20267\n\n50.iPhone12开箱\n\n微博热度:18832\n\n"},"avg_line_length":{"kind":"number","value":6.6176470588,"string":"6.617647"},"max_line_length":{"kind":"number","value":20,"string":"20"},"alphanum_fraction":{"kind":"number","value":0.7740740741,"string":"0.774074"},"lid":{"kind":"string","value":"yue_Hant"},"lid_prob":{"kind":"number","value":0.4191729724407196,"string":"0.419173"}}},{"rowIdx":3315,"cells":{"hexsha":{"kind":"string","value":"b9b67b1f3a97134793e091357c31e82e766345dd"},"size":{"kind":"number","value":5574,"string":"5,574"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"README.md"},"max_stars_repo_name":{"kind":"string","value":"KfirBernstein/technion-iem-ds_lab"},"max_stars_repo_head_hexsha":{"kind":"string","value":"1e2a9f3a6cd571988e1518423577707a486ffeac"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"README.md"},"max_issues_repo_name":{"kind":"string","value":"KfirBernstein/technion-iem-ds_lab"},"max_issues_repo_head_hexsha":{"kind":"string","value":"1e2a9f3a6cd571988e1518423577707a486ffeac"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"README.md"},"max_forks_repo_name":{"kind":"string","value":"KfirBernstein/technion-iem-ds_lab"},"max_forks_repo_head_hexsha":{"kind":"string","value":"1e2a9f3a6cd571988e1518423577707a486ffeac"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"\n# Exercise submission checker\n\nThis project is a web server for students to upload, build and execute programming tasks in C++,Python, Java etc.\n\nThe server runs in a Docker container, on a linux host.\n\nIt is developed as a small scale alternative to [CodeRunner](https://moodle.org/plugins/qtype_coderunner) .\n#### Maturity: In development, pre alpha.\n\n# Getting Started\nTODO -- add content
\n\nFor support, send mail to the repository maintainer\n\n## System Requirements\n- ubuntu 18.04\n- docker\n- ssh access (for management and file uploading) \n## Installing\n\non the server that will run the checker:\n* install docker: ```sudo apt install docker```\n* clone the repo and cd into it\n* create required directories:\n ```mkdir -p $HOME/data/logs```\n ## First time installation\n Currently need to manually build the dependency images:\n ```\n docker build -t python_cmake_base -f Dockerfile_base .\n docker build -t py_java_cpp_base -f Dockerfile_py_java_cpp_base .\n ```\n \n## \n\n* build the docker container:\n```docker build -t server . ```\n* run the server in a new container:\n```./scripts/run_docker.sh server ```\n* check that the server is up by accessing http://\\/\n\n\n# Running tests of the server\nTBD\n\n#Contributing\n use pull requests in github\n\n# Instructions for the Tutor\nAs the tutor, you have to prepare:\n- code that will execute the program\n- code that verify the output is correct\n - _hint_: https://regex101.com/\n- input data (the input test vector)\n- output data (the output for the input for a correct solution)\n - optionally, another input and output tagged GOLDEN \n\n\nThese coding parts are called __runner__ and __matcher__ (aka comparator)\n\nChoosing the runner and matcher is done by reading a configuration file (located at {rootdir}/hw_settings.json)\n\nYou can see the current content in ```host_address/admin/show_ex_config```\n \nModifying/adding values is by uploading a new version of the file (in the admin page)\n \n\nFor example,\n- in ex 1, a C/C++ program, exact text match is needed\n- in ex 2, a Python program, there is a complicated scenario that requires regular expression.\n\nThe config file json will look like:\n```\n{\n\"94201\":\n [ {\n \"id\": 1,\n \"matcher\" : \"exact_match.py\",\n \"runner\" :\"check_cmake.sh\",\n \"timeout\" : 5\n },\n {\n \"id\": 2,\n \"matcher\" : \"tester_ex2.py\",\n \"runner\" :\"check_py.sh\",\n \"timeout\" : 20\n }\n ]\n}\n``` \n\n\n## Uploading data to the server\nUse ssh and put the data files e.g. ```ref_hw_3_input``` in $HOME/data
\nIt will be mapped into the server's file system. \n
\n\n## Using the correct runner\nDepending on the assignment, choose an existing runner or write a new one.
\nThe runners are bash scripts that are run in a shell (for security) and accepts as arguments\nthe filename of the tested code, input data file, reference output file and matcher file name.
\nThe script return 0 for success.
\nNOTE: Comparison is done by running the matcher from within the runner script.\nThis will be changed in a future version.\n\nThese runners are already implemented:\n - check_cmake.sh: run cmake, make and execute the executable found.\n - check_py.sh: run the file ```main.py``` in the supplied archive\n (or just this file if no archive is used)\n - check_sh.sh: run the file using bash\n \n \n## Adding/Modifying matcher\nAll matchers are written in Python3. \n\nBefore writing a new one, check the existing scripts - maybe you can use one of them as a baseline.\n1. save the new ```tester.py``` in ```serverpkg.matchers``` dir.
\n The script must implement ```check(output_from_test_file_name,reference_file_name)```
\n and return True if the files are considered a match.
\n For example ```def check(f1,ref): return True```
\n currently, you need to implement
\n
\n    if __name__ == \"__main__\":\n        good = check(sys.argv[1], sys.argv[2])\n        exit(0 if good else ExitCode.COMPARE_FAILED) 
\n \n2. Update the config file by uploading an updated version.
\n The current config can be seen at http://your-host/admin/show_ex_config,
\n and uploading from the admin page at http://your-host/admin\n3. build a new Docker container, stop the current one, start the new one:\n```\n$ ssh myhost\n(myhost) $ cd checker\n(myhost) $ git pull\n(myhost) $ cd scripts && ./again.sh\n```\n\n# Running the web application\nThe webapp runs as a Docker container.
\nFirst, build the container: (in the project root directory)\n> docker build **.** -t server:\n \nthen run it\n> cd scripts && ./run_docker.sh server\n\nOR - if you just want to build - stop - start fresh again:\n> cd scripts && ./again.sh\n\n\n# Reliability\nI created a monitoring account that checks the server every couple minutes and send me email if the server is down. \n\nThere is known problem that occasionally the server hangs.\n In such a case, ssh to the host, and execute ```scripts/restart_container.sh```\n#Security\n* The Docker container runs as user _nobody_, who has minimal privilages.\n* The submitted code is run in a subprocess with limitations on\n * execution time (for each exercise we set a timeout value)\n * network connectivity (not implemented yet)\n \n# Debugging\nDuring development, it is easier to run only the python code without Docker:\n ``` \n cd ~/checker\n source venv/bin/activate\n python3 run.py\n ```\n \n ## gunicorn\n To run with gunicorn (one step closer to the realworld configuration):\n ```\n cd ~/checker\n source venv/bin/activate\n gunicorn3 -b 0.0.0.0:8000 --workers 3 serverpkg.server:app\n```\n"},"avg_line_length":{"kind":"number","value":31.6704545455,"string":"31.670455"},"max_line_length":{"kind":"number","value":116,"string":"116"},"alphanum_fraction":{"kind":"number","value":0.7165410836,"string":"0.716541"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9896678328514099,"string":"0.989668"}}},{"rowIdx":3316,"cells":{"hexsha":{"kind":"string","value":"b9b7a6f7a34a45ebd119678efcf953fbe8983d9e"},"size":{"kind":"number","value":184,"string":"184"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"content/cloud-audit-logs-gcp.md"},"max_stars_repo_name":{"kind":"string","value":"timf/terms.dev"},"max_stars_repo_head_hexsha":{"kind":"string","value":"69ad8e7a588eadb6a5cb9f2eaaa663eeb4655fcc"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT","Unlicense"],"string":"[\n \"MIT\",\n \"Unlicense\"\n]"},"max_stars_count":{"kind":"number","value":3,"string":"3"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2021-03-06T18:53:23.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2021-03-08T15:19:07.000Z"},"max_issues_repo_path":{"kind":"string","value":"content/cloud-audit-logs-gcp.md"},"max_issues_repo_name":{"kind":"string","value":"timf/terms.dev"},"max_issues_repo_head_hexsha":{"kind":"string","value":"69ad8e7a588eadb6a5cb9f2eaaa663eeb4655fcc"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT","Unlicense"],"string":"[\n \"MIT\",\n \"Unlicense\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"content/cloud-audit-logs-gcp.md"},"max_forks_repo_name":{"kind":"string","value":"timf/terms.dev"},"max_forks_repo_head_hexsha":{"kind":"string","value":"69ad8e7a588eadb6a5cb9f2eaaa663eeb4655fcc"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT","Unlicense"],"string":"[\n \"MIT\",\n \"Unlicense\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"+++\ntitle = \"Cloud Audit Logs\"\nweight = 33\ndate = 2021-03-07\n[extra]\nlink = \"https://cloud.google.com/audit-logs/\"\n[taxonomies]\ngroups = [\"gcp\"]\n+++\nGCP service: Audit trails for GCP\n\n"},"avg_line_length":{"kind":"number","value":15.3333333333,"string":"15.333333"},"max_line_length":{"kind":"number","value":45,"string":"45"},"alphanum_fraction":{"kind":"number","value":0.6630434783,"string":"0.663043"},"lid":{"kind":"string","value":"kor_Hang"},"lid_prob":{"kind":"number","value":0.6412162780761719,"string":"0.641216"}}},{"rowIdx":3317,"cells":{"hexsha":{"kind":"string","value":"b9b88d4ad92ec9b61224b308bb39e3bc3b5ce28c"},"size":{"kind":"number","value":14987,"string":"14,987"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"readme.md"},"max_stars_repo_name":{"kind":"string","value":"tunjid/Tiler"},"max_stars_repo_head_hexsha":{"kind":"string","value":"595338969371712331ba4fcb13abac5d47b48d5f"},"max_stars_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_stars_count":{"kind":"number","value":4,"string":"4"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2022-03-02T22:15:12.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2022-03-05T12:56:52.000Z"},"max_issues_repo_path":{"kind":"string","value":"readme.md"},"max_issues_repo_name":{"kind":"string","value":"tunjid/Tiler"},"max_issues_repo_head_hexsha":{"kind":"string","value":"595338969371712331ba4fcb13abac5d47b48d5f"},"max_issues_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"readme.md"},"max_forks_repo_name":{"kind":"string","value":"tunjid/Tiler"},"max_forks_repo_head_hexsha":{"kind":"string","value":"595338969371712331ba4fcb13abac5d47b48d5f"},"max_forks_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"# Tiler\n\n[![JVM Tests](https://github.com/tunjid/Tiler/actions/workflows/tests.yml/badge.svg)](https://github.com/tunjid/Tiler/actions/workflows/tests.yml)\n![Tiler](https://img.shields.io/maven-central/v/com.tunjid.tiler/tiler?label=tiler)\n\n![badge][badge-ios]\n![badge][badge-js]\n![badge][badge-jvm]\n![badge][badge-linux]\n![badge][badge-windows]\n![badge][badge-mac]\n![badge][badge-tvos]\n![badge][badge-watchos]\n\nPlease note, this is not an official Google repository. It is a Kotlin multiplatform experiment that makes no guarantees\nabout API stability or long term support. None of the works presented here are production tested, and should not be\ntaken as anything more than its face value.\n\n## Introduction\n\nTiling is a kotlin multiplatform experiment for loading chunks of structured data from reactive sources.\n\nTiling is achieved with a Tiler; a pure function that has the ability to adapt any generic method of the form:\n\n```kotlin\nfun items(query: Query): Flow\n```\n\ninto a paginated API.\n\nIt does this by exposing a functional reactive API most similar to a `Map` where:\n\n* The keys are the queries (`Query`) for data\n* The values are dynamic sets of data returned over time as the result of the `Query` key.\n\n\n | `typealias` | type | Output |\n |--------------------------|-----------------------------------------------------------------|--------------------|\n | `ListTiler` | `(Flow>) -> Flow>` | A flattened `List` |\n | `MapTiler` | `(Flow>) -> Flow>` | `Map` |\n\n## Get it\n\n`Tiler` is available on mavenCentral with the latest version indicated by the badge at the top of this readme file.\n\n`implementation com.tunjid.tiler:tiler:version`\n\n## Demo\n\nThe demo app is cheekily implemented as a grid of tiles with dynamic colors:\n\n![Demo image](https://github.com/tunjid/tiler/blob/develop/misc/demo.gif)\n\n\n## Use cases\n\nAs tiling is a pure function that operates on a reactive stream, its configuration can be changed on the fly.\nThis lends it well to the following situations:\n\n* Adaptive pagination: The amount of items paginated through can be adjusted dynamically to account for app window\nresizing by turning [on](https://github.com/tunjid/Tiler#inputrequest) more pages and increasing the \n[limit](https://github.com/tunjid/Tiler#inputlimiter) of data sent to the UI from the paginated data available.\nAn example is in the [Me](https://github.com/tunjid/me/blob/main/common/feature-archive-list/src/commonMain/kotlin/com/tunjid/me/feature/archivelist/ArchiveLoading.kt) app.\n\n* Dynamic sort order: The sort order of paginated items can be changed cheaply on a whim by changing the\n[order](https://github.com/tunjid/Tiler#inputorder) as this only operates on the data output from the tiler, and not\nthe entire paginated data set. An example is in the sample in this\n[repository](https://github.com/tunjid/Tiler/blob/develop/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/numbers/advanced/NumberFetching.kt).\n\n\n## API surface\n\n### Getting your data\n\nTiling prioritizes access to the data you've paged through, allowing you to read all paginated data at once, or a subset of it\n(using `Input.Limiter`). This allows you to trivially transform the data you've fetched after the fact.\n\nTilers are implemented as plain functions. Given a `Flow` of `Input`, you can either choose to get your data as:\n\n* A `Flow>` with `tiledList`\n* A `Flow>` with `tiledMap`\n\nThe choice between the two depends largely on the operations you want to perform on the output before consuming it.\nA `MapTiler` could be used when you want a clear separation of the chunks of data,\nfor example to add headers or to group information in a single component. Alternatively, you can use a `ListTiler`\nand call `List.groupBy {...}` if you find that more ergonomic. The `Map` in the `Flow` produced from the `MapTiler` is guaranteed to have a stable iteration order defined by\nthe `Input.Order` passed to it. More on this below.\n\n\n## Managing requested data\n\nMuch like a classic `Map` that supports update and remove methods, a Tiler offers analogous operations in the form\nof `Inputs`.\n\n### `Input.Request`\n\n* On: Analogous to `put` for a `Map`, this starts collecting from the backing `Flow` for the specified `query`. It is\n idempotent; multiple requests have no side effects for loading, i.e the same `Flow` will not be collect twice.\n\n* Off: Stops collecting from the backing `Flow` for the specified `query`. The items previously fetched by this query\n are still kept in memory and will be in the `List` of items returned. Requesting this is idempotent; multiple requests\n have no side effects.\n\n* Evict: Analogous to `remove` for a `Map`, this stops collecting from the backing `Flow` for the specified `query` and\n also evicts the items previously fetched by the `query` from memory. Requesting this is idempotent; multiple requests\n have no side effects.\n\n### `Input.Limiter`\n\nCan be used to select a subset of items tiled instead of the entire paginated set. For example, assuming 1000 items have been\nfetched, there's no need to send a 1000 items to the UI for diffing/display when the UI can only show about 30 at once.\nThe `Limiter` allows for selecting an arbitrary amount of items as the situation demands.\n\n### `Input.Order`\n\nDefines the heuristic for selecting tiled items into the output container.\n\n* Unspecified: Items will be returned in an undefined order. This is the default.\n\n* Sorted: Sort items with a specified query `comparator`.\n\n* PivotSorted: Sort items with the specified `comparator` but pivoted around the last query a\n `Tile.Request.On` was sent for. This allows for showing items that have more priority over others in the current\n context for example in a list being scrolled. In other words assume tiles have been fetched for queries 1 - 10 but a\n user can see pages 5 and 6. The UI need only to be aware of pages 4, 5, 6, and 7. This allows for a rolling window of\n queries based on a user's scroll position.\n\n* Custom: Flattens tiled items produced whichever way you desire.\n\n## Examples\n\n### Simple, non scaling example\n\nIn this example, the code will return a full list of every item requested sorted in ascending order of the pages.\n\nThe list will grow indefinitely as more pages are requested unless queries are evicted. This may\nbe fine for small lists, but as the list size grows, some items may need to be evicted as only a small subset of items\nneed to be presented to the UI. This sort of behavior can be achieved using the `Evict` `Request`, and\nthe `PivotSorted` `Order` covered next.\n\n```kotlin\nimport com.tunjid.tiler.Tile\nimport com.tunjid.tiler.tiledList\nimport kotlinx.coroutines.flow.Flow\nimport kotlinx.coroutines.flow.MutableStateFlow\nimport kotlinx.coroutines.flow.flowOf\nimport kotlinx.coroutines.flow.map\n\nclass NumberFetcher {\n private val requests = MutableStateFlow(0)\n\n private val tiledList: (Flow>>) -> Flow>> = tiledList(\n // Sort items in ascending order\n order = Tile.Order.Sorted(comparator = Int::compareTo),\n fetcher = { page ->\n // Fetch 50 numbers for each page\n val start = page * 50\n val numbers = start.until(start + 50)\n flowOf(numbers.toList())\n }\n )\n\n // All paginated items in a single list\n val listItems: Flow> = tiledList.invoke(\n requests.map { Tile.Request.On(it) }\n )\n .map(List>::flatten)\n\n\n fun fetchPage(page: Int) {\n requests.value = page\n }\n}\n```\n\n\n### Advanced, scalable solution\n\nTo deal with the issue of the tiled data set becoming arbitrarily large, one can create a pipeline where the\npages loaded are defined as a function of the page the user is currently at:\n\n```\n[out of bounds] -> Evict from memory\n _\n[currentPage - n - 1 - n] |\n... | -> Keep pages in memory, but don't observe\n[currentPage - n - 1] _ _| \n[currentPage - n] |\n... |\n[currentPage - 1] |\n[currentPage] | -> Observe pages \n[currentPage + 1] |\n... |\n[currentPage + n] _| _\n[currentPage + n + 1] |\n... | -> Keep pages in memory, but don't observe\n[currentPage + n + 1 + n] _|\n\n[out of bounds] -> Evict from memory\n```\n\nWhere `n` is an arbitrary number that may be defined by how many items are visible on the screen at once.\n\nFor an example where `n` is a function of grid size in a grid list, check out [ArchiveLoading.kt](https://github.com/tunjid/me/blob/main/common/feature-archive-list/src/commonMain/kotlin/com/tunjid/me/feature/archivelist/ArchiveLoading.kt) in the [me](https://github.com/tunjid/me) project.\n\nAn example where `n` is fixed at 2 follows:\n\n```kotlin\nimport com.tunjid.tiler.Tile\nimport com.tunjid.tiler.tiledList\nimport kotlinx.coroutines.flow.Flow\nimport kotlinx.coroutines.flow.MutableStateFlow\nimport kotlinx.coroutines.flow.asFlow\nimport kotlinx.coroutines.flow.distinctUntilChanged\nimport kotlinx.coroutines.flow.flatMapLatest\nimport kotlinx.coroutines.flow.flowOf\nimport kotlinx.coroutines.flow.map\nimport kotlinx.coroutines.flow.scan\n\ndata class LoadMetadata(\n val pivotPage: Int = 0,\n // Pages actively being collected and loaded from\n val on: List = listOf(),\n // Pages whose emissions are in memory, but are not being collected from\n val off: List = listOf(),\n // Pages to remove from memory\n val evict: List = listOf(),\n)\n\nprivate fun LoadMetadata.toRequests(): Flow>> =\n listOf>>>(\n evict.map { Tile.Request.Evict(it) },\n off.map { Tile.Request.Off(it) },\n on.map { Tile.Request.On(it) },\n )\n .flatten()\n .asFlow()\n\nclass ManagedNumberFetcher {\n private val requests = MutableStateFlow(0)\n\n val managedRequests: Flow>> = requests\n .scan(LoadMetadata()) { previousMetadata, currentPage ->\n // Load 5 pages pivoted around the current page at once\n val on: List = ((currentPage - 2)..(currentPage + 2))\n .filter { it >= 0 }\n .toList()\n // Keep 2 pages on either end of the active pages in memory\n val off: List = (((currentPage - 5)..(currentPage - 3)) + ((currentPage + 3)..(currentPage + 5)))\n .filter { it >= 0 }\n LoadMetadata(\n on = on,\n off = off,\n pivotPage = currentPage,\n // Evict everything not in the curren active and inactive range\n evict = (previousMetadata.on + previousMetadata.off) - (on + off).toSet()\n )\n }\n .distinctUntilChanged()\n .flatMapLatest(LoadMetadata::toRequests)\n\n private val tiledList: (Flow>>) -> Flow>> = tiledList(\n // Sort items in ascending order, pivoted around the current page\n order = Tile.Order.PivotSorted(comparator = Int::compareTo),\n // Output at most 200 items at once to allow for cheap data transformations regardless of paged dataset size\n limiter = Tile.Limiter.List { it.size > 200 },\n fetcher = { page ->\n // Fetch 50 numbers for each page\n val start = page * 50\n val numbers = start.until(start + 50)\n flowOf(numbers.toList())\n }\n )\n\n val listItems: Flow> = tiledList.invoke(managedRequests)\n .map(List>::flatten)\n\n fun setCurrentPage(page: Int) {\n requests.value = page\n }\n}\n```\n\nIn the above, only flows for 5 pages are collected at any one time. 4 more pages are kept in memory for quick\nresumption, and the rest are evicted from memory. As the user scrolls, `setCurrentPage` is called, and data is\nfetched for that page, and the surrounding pages.\nPages that are far away from the current page (more than 4 pages away) are removed from memory.\n\n## Efficiency & performance\n\nAs tiling loads from multiple flows simultaneously, performance is a function of 2 things:\n\n* How often the backing `Flow` for each `Input.Request` emits\n* The time and space complexity of the transformations applied to the output `List` or `Map`.\n\nIn the case of a former, the `Flow` should only emit if the backing dataset has actually changed. This prevents unneccessary emissions downstream.\n\nIn the case of the latter, by using `Input.Limiter` on the output of the tiler, you can guarantee transformations on the output are a function `O(N)`,\nwhere `N` is the amount defined by the `Input.Limiter`.\n\nFor example if tiling is done for the UI, with a viewport that can display 20 items at once, 20 items can be fetched per page, and 100 (20 * 5) pages can be observed at concurrently. Using `Input.Limiter.List { it.size > 100 }`, only 100 items will be sent to the UI at once. The items can be transformed with algorithms of `O(N)` to `O(N^2)` time and space complexity trivially as regardless of the size of the actual paginated set, only 100 items will be transformed at any one time.\n\n## License\n\n Copyright 2021 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n[badge-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat\n\n[badge-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat\n\n[badge-js]: http://img.shields.io/badge/-js-F8DB5D.svg?style=flat\n\n[badge-js-ir]: https://img.shields.io/badge/support-[IR]-AAC4E0.svg?style=flat\n\n[badge-nodejs]: https://img.shields.io/badge/-nodejs-68a063.svg?style=flat\n\n[badge-linux]: http://img.shields.io/badge/-linux-2D3F6C.svg?style=flat\n\n[badge-windows]: http://img.shields.io/badge/-windows-4D76CD.svg?style=flat\n\n[badge-wasm]: https://img.shields.io/badge/-wasm-624FE8.svg?style=flat\n\n[badge-apple-silicon]: http://img.shields.io/badge/support-[AppleSilicon]-43BBFF.svg?style=flat\n\n[badge-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat\n\n[badge-mac]: http://img.shields.io/badge/-macos-111111.svg?style=flat\n\n[badge-watchos]: http://img.shields.io/badge/-watchos-C0C0C0.svg?style=flat\n\n[badge-tvos]: http://img.shields.io/badge/-tvos-808080.svg?style=flat\n"},"avg_line_length":{"kind":"number","value":43.5668604651,"string":"43.56686"},"max_line_length":{"kind":"number","value":485,"string":"485"},"alphanum_fraction":{"kind":"number","value":0.7028091012,"string":"0.702809"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9740128517150879,"string":"0.974013"}}},{"rowIdx":3318,"cells":{"hexsha":{"kind":"string","value":"b9b8d74a27355d1c42ffb826157e0a449874abc2"},"size":{"kind":"number","value":298,"string":"298"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"core/mobile-manager/CHANGELOG.md"},"max_stars_repo_name":{"kind":"string","value":"lerzeel2/imodeljs"},"max_stars_repo_head_hexsha":{"kind":"string","value":"785206a722a8d5e02325bbf3748197f6e6e31c13"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"core/mobile-manager/CHANGELOG.md"},"max_issues_repo_name":{"kind":"string","value":"lerzeel2/imodeljs"},"max_issues_repo_head_hexsha":{"kind":"string","value":"785206a722a8d5e02325bbf3748197f6e6e31c13"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"number","value":1,"string":"1"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2020-11-21T14:31:53.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2020-11-21T16:04:11.000Z"},"max_forks_repo_path":{"kind":"string","value":"core/mobile-manager/CHANGELOG.md"},"max_forks_repo_name":{"kind":"string","value":"lerzeel2/imodeljs"},"max_forks_repo_head_hexsha":{"kind":"string","value":"785206a722a8d5e02325bbf3748197f6e6e31c13"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"# Change Log - @bentley/mobile-manager\n\nThis log was last generated on Tue, 09 Mar 2021 20:28:13 GMT and should not be manually modified.\n\n## 2.13.0\nTue, 09 Mar 2021 20:28:13 GMT\n\n### Updates\n\n- Remove unused code.\n- Updated to use TypeScript 4.1\n- begin rename project from iModel.js to iTwin.js\n\n"},"avg_line_length":{"kind":"number","value":21.2857142857,"string":"21.285714"},"max_line_length":{"kind":"number","value":97,"string":"97"},"alphanum_fraction":{"kind":"number","value":0.7248322148,"string":"0.724832"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9617854356765747,"string":"0.961785"}}},{"rowIdx":3319,"cells":{"hexsha":{"kind":"string","value":"b9b9172b42c72c0ac4769fa1c93d4911c3f40ac4"},"size":{"kind":"number","value":49701,"string":"49,701"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"sources/tech/20181016 Lab 6- Network Driver.md"},"max_stars_repo_name":{"kind":"string","value":"Cielllll/TranslateProject"},"max_stars_repo_head_hexsha":{"kind":"string","value":"893cc7d906add05e2693fa7427ee18a22ae6f97a"},"max_stars_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"sources/tech/20181016 Lab 6- Network Driver.md"},"max_issues_repo_name":{"kind":"string","value":"Cielllll/TranslateProject"},"max_issues_repo_head_hexsha":{"kind":"string","value":"893cc7d906add05e2693fa7427ee18a22ae6f97a"},"max_issues_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"sources/tech/20181016 Lab 6- Network Driver.md"},"max_forks_repo_name":{"kind":"string","value":"Cielllll/TranslateProject"},"max_forks_repo_head_hexsha":{"kind":"string","value":"893cc7d906add05e2693fa7427ee18a22ae6f97a"},"max_forks_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"Translating by qhwdw\nLab 6: Network Driver\n======\n### Lab 6: Network Driver (default final project)\n\n**Due on Thursday, December 6, 2018\n**\n\n### Introduction\n\nThis lab is the default final project that you can do on your own.\n\nNow that you have a file system, no self respecting OS should go without a network stack. In this the lab you are going to write a driver for a network interface card. The card will be based on the Intel 82540EM chip, also known as the E1000.\n\n##### Getting Started\n\nUse Git to commit your Lab 5 source (if you haven't already), fetch the latest version of the course repository, and then create a local branch called `lab6` based on our lab6 branch, `origin/lab6`:\n\n```\n athena% cd ~/6.828/lab\n athena% add git\n athena% git commit -am 'my solution to lab5'\n nothing to commit (working directory clean)\n athena% git pull\n Already up-to-date.\n athena% git checkout -b lab6 origin/lab6\n Branch lab6 set up to track remote branch refs/remotes/origin/lab6.\n Switched to a new branch \"lab6\"\n athena% git merge lab5\n Merge made by recursive.\n fs/fs.c | 42 +++++++++++++++++++\n 1 files changed, 42 insertions(+), 0 deletions(-)\n athena%\n```\n\nThe network card driver, however, will not be enough to get your OS hooked up to the Internet. In the new lab6 code, we have provided you with a network stack and a network server. As in previous labs, use git to grab the code for this lab, merge in your own code, and explore the contents of the new `net/` directory, as well as the new files in `kern/`.\n\nIn addition to writing the driver, you will need to create a system call interface to give access to your driver. You will implement missing network server code to transfer packets between the network stack and your driver. You will also tie everything together by finishing a web server. With the new web server you will be able to serve files from your file system.\n\nMuch of the kernel device driver code you will have to write yourself from scratch. This lab provides much less guidance than previous labs: there are no skeleton files, no system call interfaces written in stone, and many design decisions are left up to you. For this reason, we recommend that you read the entire assignment write up before starting any individual exercises. Many students find this lab more difficult than previous labs, so please plan your time accordingly.\n\n##### Lab Requirements\n\nAs before, you will need to do all of the regular exercises described in the lab and _at least one_ challenge problem. Write up brief answers to the questions posed in the lab and a description of your challenge exercise in `answers-lab6.txt`.\n\n#### QEMU's virtual network\n\nWe will be using QEMU's user mode network stack since it requires no administrative privileges to run. QEMU's documentation has more about user-net [here][1]. We've updated the makefile to enable QEMU's user-mode network stack and the virtual E1000 network card.\n\nBy default, QEMU provides a virtual router running on IP 10.0.2.2 and will assign JOS the IP address 10.0.2.15. To keep things simple, we hard-code these defaults into the network server in `net/ns.h`.\n\nWhile QEMU's virtual network allows JOS to make arbitrary connections out to the Internet, JOS's 10.0.2.15 address has no meaning outside the virtual network running inside QEMU (that is, QEMU acts as a NAT), so we can't connect directly to servers running inside JOS, even from the host running QEMU. To address this, we configure QEMU to run a server on some port on the _host_ machine that simply connects through to some port in JOS and shuttles data back and forth between your real host and the virtual network.\n\nYou will run JOS servers on ports 7 (echo) and 80 (http). To avoid collisions on shared Athena machines, the makefile generates forwarding ports for these based on your user ID. To find out what ports QEMU is forwarding to on your development host, run make which-ports. For convenience, the makefile also provides make nc-7 and make nc-80, which allow you to interact directly with servers running on these ports in your terminal. (These targets only connect to a running QEMU instance; you must start QEMU itself separately.)\n\n##### Packet Inspection\n\nThe makefile also configures QEMU's network stack to record all incoming and outgoing packets to `qemu.pcap` in your lab directory.\n\nTo get a hex/ASCII dump of captured packets use `tcpdump` like this:\n\n```\n tcpdump -XXnr qemu.pcap\n```\n\nAlternatively, you can use [Wireshark][2] to graphically inspect the pcap file. Wireshark also knows how to decode and inspect hundreds of network protocols. If you're on Athena, you'll have to use Wireshark's predecessor, ethereal, which is in the sipbnet locker.\n\n##### Debugging the E1000\n\nWe are very lucky to be using emulated hardware. Since the E1000 is running in software, the emulated E1000 can report to us, in a user readable format, its internal state and any problems it encounters. Normally, such a luxury would not be available to a driver developer writing with bare metal.\n\nThe E1000 can produce a lot of debug output, so you have to enable specific logging channels. Some channels you might find useful are:\n\n| Flag | Meaning |\n| --------- | ---------------------------------------------------|\n| tx | Log packet transmit operations |\n| txerr | Log transmit ring errors |\n| rx | Log changes to RCTL |\n| rxfilter | Log filtering of incoming packets |\n| rxerr | Log receive ring errors |\n| unknown | Log reads and writes of unknown registers |\n| eeprom | Log reads from the EEPROM |\n| interrupt | Log interrupts and changes to interrupt registers. |\n\nTo enable \"tx\" and \"txerr\" logging, for example, use make E1000_DEBUG=tx,txerr ....\n\nNote: `E1000_DEBUG` flags only work in the 6.828 version of QEMU.\n\nYou can take debugging using software emulated hardware one step further. If you are ever stuck and do not understand why the E1000 is not responding the way you would expect, you can look at QEMU's E1000 implementation in `hw/e1000.c`.\n\n#### The Network Server\n\nWriting a network stack from scratch is hard work. Instead, we will be using lwIP, an open source lightweight TCP/IP protocol suite that among many things includes a network stack. You can find more information on lwIP [here][3]. In this assignment, as far as we are concerned, lwIP is a black box that implements a BSD socket interface and has a packet input port and packet output port.\n\nThe network server is actually a combination of four environments:\n\n * core network server environment (includes socket call dispatcher and lwIP)\n * input environment\n * output environment\n * timer environment\n\n\n\nThe following diagram shows the different environments and their relationships. The diagram shows the entire system including the device driver, which will be covered later. In this lab, you will implement the parts highlighted in green.\n\n![Network server architecture][4]\n\n##### The Core Network Server Environment\n\nThe core network server environment is composed of the socket call dispatcher and lwIP itself. The socket call dispatcher works exactly like the file server. User environments use stubs (found in `lib/nsipc.c`) to send IPC messages to the core network environment. If you look at `lib/nsipc.c` you will see that we find the core network server the same way we found the file server: `i386_init` created the NS environment with NS_TYPE_NS, so we scan `envs`, looking for this special environment type. For each user environment IPC, the dispatcher in the network server calls the appropriate BSD socket interface function provided by lwIP on behalf of the user.\n\nRegular user environments do not use the `nsipc_*` calls directly. Instead, they use the functions in `lib/sockets.c`, which provides a file descriptor-based sockets API. Thus, user environments refer to sockets via file descriptors, just like how they referred to on-disk files. A number of operations (`connect`, `accept`, etc.) are specific to sockets, but `read`, `write`, and `close` go through the normal file descriptor device-dispatch code in `lib/fd.c`. Much like how the file server maintained internal unique ID's for all open files, lwIP also generates unique ID's for all open sockets. In both the file server and the network server, we use information stored in `struct Fd` to map per-environment file descriptors to these unique ID spaces.\n\nEven though it may seem that the IPC dispatchers of the file server and network server act the same, there is a key difference. BSD socket calls like `accept` and `recv` can block indefinitely. If the dispatcher were to let lwIP execute one of these blocking calls, the dispatcher would also block and there could only be one outstanding network call at a time for the whole system. Since this is unacceptable, the network server uses user-level threading to avoid blocking the entire server environment. For every incoming IPC message, the dispatcher creates a thread and processes the request in the newly created thread. If the thread blocks, then only that thread is put to sleep while other threads continue to run.\n\nIn addition to the core network environment there are three helper environments. Besides accepting messages from user applications, the core network environment's dispatcher also accepts messages from the input and timer environments.\n\n##### The Output Environment\n\nWhen servicing user environment socket calls, lwIP will generate packets for the network card to transmit. LwIP will send each packet to be transmitted to the output helper environment using the `NSREQ_OUTPUT` IPC message with the packet attached in the page argument of the IPC message. The output environment is responsible for accepting these messages and forwarding the packet on to the device driver via the system call interface that you will soon create.\n\n##### The Input Environment\n\nPackets received by the network card need to be injected into lwIP. For every packet received by the device driver, the input environment pulls the packet out of kernel space (using kernel system calls that you will implement) and sends the packet to the core server environment using the `NSREQ_INPUT` IPC message.\n\nThe packet input functionality is separated from the core network environment because JOS makes it hard to simultaneously accept IPC messages and poll or wait for a packet from the device driver. We do not have a `select` system call in JOS that would allow environments to monitor multiple input sources to identify which input is ready to be processed.\n\nIf you take a look at `net/input.c` and `net/output.c` you will see that both need to be implemented. This is mainly because the implementation depends on your system call interface. You will write the code for the two helper environments after you implement the driver and system call interface.\n\n##### The Timer Environment\n\nThe timer environment periodically sends messages of type `NSREQ_TIMER` to the core network server notifying it that a timer has expired. The timer messages from this thread are used by lwIP to implement various network timeouts.\n\n### Part A: Initialization and transmitting packets\n\nYour kernel does not have a notion of time, so we need to add it. There is currently a clock interrupt that is generated by the hardware every 10ms. On every clock interrupt we can increment a variable to indicate that time has advanced by 10ms. This is implemented in `kern/time.c`, but is not yet fully integrated into your kernel.\n\n```\nExercise 1. Add a call to `time_tick` for every clock interrupt in `kern/trap.c`. Implement `sys_time_msec` and add it to `syscall` in `kern/syscall.c` so that user space has access to the time.\n```\n\nUse make INIT_CFLAGS=-DTEST_NO_NS run-testtime to test your time code. You should see the environment count down from 5 in 1 second intervals. The \"-DTEST_NO_NS\" disables starting the network server environment because it will panic at this point in the lab.\n\n#### The Network Interface Card\n\nWriting a driver requires knowing in depth the hardware and the interface presented to the software. The lab text will provide a high-level overview of how to interface with the E1000, but you'll need to make extensive use of Intel's manual while writing your driver.\n\n```\nExercise 2. Browse Intel's [Software Developer's Manual][5] for the E1000. This manual covers several closely related Ethernet controllers. QEMU emulates the 82540EM.\n\nYou should skim over chapter 2 now to get a feel for the device. To write your driver, you'll need to be familiar with chapters 3 and 14, as well as 4.1 (though not 4.1's subsections). You'll also need to use chapter 13 as reference. The other chapters mostly cover components of the E1000 that your driver won't have to interact with. Don't worry about the details right now; just get a feel for how the document is structured so you can find things later.\n\nWhile reading the manual, keep in mind that the E1000 is a sophisticated device with many advanced features. A working E1000 driver only needs a fraction of the features and interfaces that the NIC provides. Think carefully about the easiest way to interface with the card. We strongly recommend that you get a basic driver working before taking advantage of the advanced features.\n```\n\n##### PCI Interface\n\nThe E1000 is a PCI device, which means it plugs into the PCI bus on the motherboard. The PCI bus has address, data, and interrupt lines, and allows the CPU to communicate with PCI devices and PCI devices to read and write memory. A PCI device needs to be discovered and initialized before it can be used. Discovery is the process of walking the PCI bus looking for attached devices. Initialization is the process of allocating I/O and memory space as well as negotiating the IRQ line for the device to use.\n\nWe have provided you with PCI code in `kern/pci.c`. To perform PCI initialization during boot, the PCI code walks the PCI bus looking for devices. When it finds a device, it reads its vendor ID and device ID and uses these two values as a key to search the `pci_attach_vendor` array. The array is composed of `struct pci_driver` entries like this:\n\n```\n struct pci_driver {\n uint32_t key1, key2;\n int (*attachfn) (struct pci_func *pcif);\n };\n```\n\nIf the discovered device's vendor ID and device ID match an entry in the array, the PCI code calls that entry's `attachfn` to perform device initialization. (Devices can also be identified by class, which is what the other driver table in `kern/pci.c` is for.)\n\nThe attach function is passed a _PCI function_ to initialize. A PCI card can expose multiple functions, though the E1000 exposes only one. Here is how we represent a PCI function in JOS:\n\n```\n struct pci_func {\n struct pci_bus *bus;\n\n uint32_t dev;\n uint32_t func;\n\n uint32_t dev_id;\n uint32_t dev_class;\n\n uint32_t reg_base[6];\n uint32_t reg_size[6];\n uint8_t irq_line;\n };\n```\n\nThe above structure reflects some of the entries found in Table 4-1 of Section 4.1 of the developer manual. The last three entries of `struct pci_func` are of particular interest to us, as they record the negotiated memory, I/O, and interrupt resources for the device. The `reg_base` and `reg_size` arrays contain information for up to six Base Address Registers or BARs. `reg_base` stores the base memory addresses for memory-mapped I/O regions (or base I/O ports for I/O port resources), `reg_size` contains the size in bytes or number of I/O ports for the corresponding base values from `reg_base`, and `irq_line` contains the IRQ line assigned to the device for interrupts. The specific meanings of the E1000 BARs are given in the second half of table 4-2.\n\nWhen the attach function of a device is called, the device has been found but not yet _enabled_. This means that the PCI code has not yet determined the resources allocated to the device, such as address space and an IRQ line, and, thus, the last three elements of the `struct pci_func` structure are not yet filled in. The attach function should call `pci_func_enable`, which will enable the device, negotiate these resources, and fill in the `struct pci_func`.\n\n```\nExercise 3. Implement an attach function to initialize the E1000. Add an entry to the `pci_attach_vendor` array in `kern/pci.c` to trigger your function if a matching PCI device is found (be sure to put it before the `{0, 0, 0}` entry that mark the end of the table). You can find the vendor ID and device ID of the 82540EM that QEMU emulates in section 5.2. You should also see these listed when JOS scans the PCI bus while booting.\n\nFor now, just enable the E1000 device via `pci_func_enable`. We'll add more initialization throughout the lab.\n\nWe have provided the `kern/e1000.c` and `kern/e1000.h` files for you so that you do not need to mess with the build system. They are currently blank; you need to fill them in for this exercise. You may also need to include the `e1000.h` file in other places in the kernel.\n\nWhen you boot your kernel, you should see it print that the PCI function of the E1000 card was enabled. Your code should now pass the `pci attach` test of make grade.\n```\n\n##### Memory-mapped I/O\n\nSoftware communicates with the E1000 via _memory-mapped I/O_ (MMIO). You've seen this twice before in JOS: both the CGA console and the LAPIC are devices that you control and query by writing to and reading from \"memory\". But these reads and writes don't go to DRAM; they go directly to these devices.\n\n`pci_func_enable` negotiates an MMIO region with the E1000 and stores its base and size in BAR 0 (that is, `reg_base[0]` and `reg_size[0]`). This is a range of _physical memory addresses_ assigned to the device, which means you'll have to do something to access it via virtual addresses. Since MMIO regions are assigned very high physical addresses (typically above 3GB), you can't use `KADDR` to access it because of JOS's 256MB limit. Thus, you'll have to create a new memory mapping. We'll use the area above MMIOBASE (your `mmio_map_region` from lab 4 will make sure we don't overwrite the mapping used by the LAPIC). Since PCI device initialization happens before JOS creates user environments, you can create the mapping in `kern_pgdir` and it will always be available.\n\n```\nExercise 4. In your attach function, create a virtual memory mapping for the E1000's BAR 0 by calling `mmio_map_region` (which you wrote in lab 4 to support memory-mapping the LAPIC).\n\nYou'll want to record the location of this mapping in a variable so you can later access the registers you just mapped. Take a look at the `lapic` variable in `kern/lapic.c` for an example of one way to do this. If you do use a pointer to the device register mapping, be sure to declare it `volatile`; otherwise, the compiler is allowed to cache values and reorder accesses to this memory.\n\nTo test your mapping, try printing out the device status register (section 13.4.2). This is a 4 byte register that starts at byte 8 of the register space. You should get `0x80080783`, which indicates a full duplex link is up at 1000 MB/s, among other things.\n```\n\nHint: You'll need a lot of constants, like the locations of registers and values of bit masks. Trying to copy these out of the developer's manual is error-prone and mistakes can lead to painful debugging sessions. We recommend instead using QEMU's [`e1000_hw.h`][6] header as a guideline. We don't recommend copying it in verbatim, because it defines far more than you actually need and may not define things in the way you need, but it's a good starting point.\n\n##### DMA\n\nYou could imagine transmitting and receiving packets by writing and reading from the E1000's registers, but this would be slow and would require the E1000 to buffer packet data internally. Instead, the E1000 uses _Direct Memory Access_ or DMA to read and write packet data directly from memory without involving the CPU. The driver is responsible for allocating memory for the transmit and receive queues, setting up DMA descriptors, and configuring the E1000 with the location of these queues, but everything after that is asynchronous. To transmit a packet, the driver copies it into the next DMA descriptor in the transmit queue and informs the E1000 that another packet is available; the E1000 will copy the data out of the descriptor when there is time to send the packet. Likewise, when the E1000 receives a packet, it copies it into the next DMA descriptor in the receive queue, which the driver can read from at its next opportunity.\n\nThe receive and transmit queues are very similar at a high level. Both consist of a sequence of _descriptors_. While the exact structure of these descriptors varies, each descriptor contains some flags and the physical address of a buffer containing packet data (either packet data for the card to send, or a buffer allocated by the OS for the card to write a received packet to).\n\nThe queues are implemented as circular arrays, meaning that when the card or the driver reach the end of the array, it wraps back around to the beginning. Both have a _head pointer_ and a _tail pointer_ and the contents of the queue are the descriptors between these two pointers. The hardware always consumes descriptors from the head and moves the head pointer, while the driver always add descriptors to the tail and moves the tail pointer. The descriptors in the transmit queue represent packets waiting to be sent (hence, in the steady state, the transmit queue is empty). For the receive queue, the descriptors in the queue are free descriptors that the card can receive packets into (hence, in the steady state, the receive queue consists of all available receive descriptors). Correctly updating the tail register without confusing the E1000 is tricky; be careful!\n\nThe pointers to these arrays as well as the addresses of the packet buffers in the descriptors must all be _physical addresses_ because hardware performs DMA directly to and from physical RAM without going through the MMU.\n\n#### Transmitting Packets\n\nThe transmit and receive functions of the E1000 are basically independent of each other, so we can work on one at a time. We'll attack transmitting packets first simply because we can't test receive without transmitting an \"I'm here!\" packet first.\n\nFirst, you'll have to initialize the card to transmit, following the steps described in section 14.5 (you don't have to worry about the subsections). The first step of transmit initialization is setting up the transmit queue. The precise structure of the queue is described in section 3.4 and the structure of the descriptors is described in section 3.3.3. We won't be using the TCP offload features of the E1000, so you can focus on the \"legacy transmit descriptor format.\" You should read those sections now and familiarize yourself with these structures.\n\n##### C Structures\n\nYou'll find it convenient to use C `struct`s to describe the E1000's structures. As you've seen with structures like the `struct Trapframe`, C `struct`s let you precisely layout data in memory. C can insert padding between fields, but the E1000's structures are laid out such that this shouldn't be a problem. If you do encounter field alignment problems, look into GCC's \"packed\" attribute.\n\nAs an example, consider the legacy transmit descriptor given in table 3-8 of the manual and reproduced here:\n\n```\n 63 48 47 40 39 32 31 24 23 16 15 0\n +---------------------------------------------------------------+\n | Buffer address |\n +---------------|-------|-------|-------|-------|---------------+\n | Special | CSS | Status| Cmd | CSO | Length |\n +---------------|-------|-------|-------|-------|---------------+\n```\n\nThe first byte of the structure starts at the top right, so to convert this into a C struct, read from right to left, top to bottom. If you squint at it right, you'll see that all of the fields even fit nicely into a standard-size types:\n\n```\n struct tx_desc\n {\n uint64_t addr;\n uint16_t length;\n uint8_t cso;\n uint8_t cmd;\n uint8_t status;\n uint8_t css;\n uint16_t special;\n };\n```\n\nYour driver will have to reserve memory for the transmit descriptor array and the packet buffers pointed to by the transmit descriptors. There are several ways to do this, ranging from dynamically allocating pages to simply declaring them in global variables. Whatever you choose, keep in mind that the E1000 accesses physical memory directly, which means any buffer it accesses must be contiguous in physical memory.\n\nThere are also multiple ways to handle the packet buffers. The simplest, which we recommend starting with, is to reserve space for a packet buffer for each descriptor during driver initialization and simply copy packet data into and out of these pre-allocated buffers. The maximum size of an Ethernet packet is 1518 bytes, which bounds how big these buffers need to be. More sophisticated drivers could dynamically allocate packet buffers (e.g., to reduce memory overhead when network usage is low) or even pass buffers directly provided by user space (a technique known as \"zero copy\"), but it's good to start simple.\n\n```\nExercise 5. Perform the initialization steps described in section 14.5 (but not its subsections). Use section 13 as a reference for the registers the initialization process refers to and sections 3.3.3 and 3.4 for reference to the transmit descriptors and transmit descriptor array.\n\nBe mindful of the alignment requirements on the transmit descriptor array and the restrictions on length of this array. Since TDLEN must be 128-byte aligned and each transmit descriptor is 16 bytes, your transmit descriptor array will need some multiple of 8 transmit descriptors. However, don't use more than 64 descriptors or our tests won't be able to test transmit ring overflow.\n\nFor the TCTL.COLD, you can assume full-duplex operation. For TIPG, refer to the default values described in table 13-77 of section 13.4.34 for the IEEE 802.3 standard IPG (don't use the values in the table in section 14.5).\n```\n\nTry running make E1000_DEBUG=TXERR,TX qemu. If you are using the course qemu, you should see an \"e1000: tx disabled\" message when you set the TDT register (since this happens before you set TCTL.EN) and no further \"e1000\" messages.\n\nNow that transmit is initialized, you'll have to write the code to transmit a packet and make it accessible to user space via a system call. To transmit a packet, you have to add it to the tail of the transmit queue, which means copying the packet data into the next packet buffer and then updating the TDT (transmit descriptor tail) register to inform the card that there's another packet in the transmit queue. (Note that TDT is an _index_ into the transmit descriptor array, not a byte offset; the documentation isn't very clear about this.)\n\nHowever, the transmit queue is only so big. What happens if the card has fallen behind transmitting packets and the transmit queue is full? In order to detect this condition, you'll need some feedback from the E1000. Unfortunately, you can't just use the TDH (transmit descriptor head) register; the documentation explicitly states that reading this register from software is unreliable. However, if you set the RS bit in the command field of a transmit descriptor, then, when the card has transmitted the packet in that descriptor, the card will set the DD bit in the status field of the descriptor. If a descriptor's DD bit is set, you know it's safe to recycle that descriptor and use it to transmit another packet.\n\nWhat if the user calls your transmit system call, but the DD bit of the next descriptor isn't set, indicating that the transmit queue is full? You'll have to decide what to do in this situation. You could simply drop the packet. Network protocols are resilient to this, but if you drop a large burst of packets, the protocol may not recover. You could instead tell the user environment that it has to retry, much like you did for `sys_ipc_try_send`. This has the advantage of pushing back on the environment generating the data.\n\n```\nExercise 6. Write a function to transmit a packet by checking that the next descriptor is free, copying the packet data into the next descriptor, and updating TDT. Make sure you handle the transmit queue being full.\n```\n\nNow would be a good time to test your packet transmit code. Try transmitting just a few packets by directly calling your transmit function from the kernel. You don't have to create packets that conform to any particular network protocol in order to test this. Run make E1000_DEBUG=TXERR,TX qemu to run your test. You should see something like\n\n```\n e1000: index 0: 0x271f00 : 9000002a 0\n ...\n```\n\nas you transmit packets. Each line gives the index in the transmit array, the buffer address of that transmit descriptor, the cmd/CSO/length fields, and the special/CSS/status fields. If QEMU doesn't print the values you expected from your transmit descriptor, check that you're filling in the right descriptor and that you configured TDBAL and TDBAH correctly. If you get \"e1000: TDH wraparound @0, TDT x, TDLEN y\" messages, that means the E1000 ran all the way through the transmit queue without stopping (if QEMU didn't check this, it would enter an infinite loop), which probably means you aren't manipulating TDT correctly. If you get lots of \"e1000: tx disabled\" messages, then you didn't set the transmit control register right.\n\nOnce QEMU runs, you can then run tcpdump -XXnr qemu.pcap to see the packet data that you transmitted. If you saw the expected \"e1000: index\" messages from QEMU, but your packet capture is empty, double check that you filled in every necessary field and bit in your transmit descriptors (the E1000 probably went through your transmit descriptors, but didn't think it had to send anything).\n\n```\nExercise 7. Add a system call that lets you transmit packets from user space. The exact interface is up to you. Don't forget to check any pointers passed to the kernel from user space.\n```\n\n#### Transmitting Packets: Network Server\n\nNow that you have a system call interface to the transmit side of your device driver, it's time to send packets. The output helper environment's goal is to do the following in a loop: accept `NSREQ_OUTPUT` IPC messages from the core network server and send the packets accompanying these IPC message to the network device driver using the system call you added above. The `NSREQ_OUTPUT` IPC's are sent by the `low_level_output` function in `net/lwip/jos/jif/jif.c`, which glues the lwIP stack to JOS's network system. Each IPC will include a page consisting of a `union Nsipc` with the packet in its `struct jif_pkt pkt` field (see `inc/ns.h`). `struct jif_pkt` looks like\n\n```\n struct jif_pkt {\n int jp_len;\n char jp_data[0];\n };\n```\n\n`jp_len` represents the length of the packet. All subsequent bytes on the IPC page are dedicated to the packet contents. Using a zero-length array like `jp_data` at the end of a struct is a common C trick (some would say abomination) for representing buffers without pre-determined lengths. Since C doesn't do array bounds checking, as long as you ensure there's enough unused memory following the struct, you can use `jp_data` as if it were an array of any size.\n\nBe aware of the interaction between the device driver, the output environment and the core network server when there is no more space in the device driver's transmit queue. The core network server sends packets to the output environment using IPC. If the output environment is suspended due to a send packet system call because the driver has no more buffer space for new packets, the core network server will block waiting for the output server to accept the IPC call.\n\n```\nExercise 8. Implement `net/output.c`.\n```\n\nYou can use `net/testoutput.c` to test your output code without involving the whole network server. Try running make E1000_DEBUG=TXERR,TX run-net_testoutput. You should see something like\n\n```\n Transmitting packet 0\n e1000: index 0: 0x271f00 : 9000009 0\n Transmitting packet 1\n e1000: index 1: 0x2724ee : 9000009 0\n ...\n```\n\nand tcpdump -XXnr qemu.pcap should output\n\n\n```\n reading from file qemu.pcap, link-type EN10MB (Ethernet)\n -5:00:00.600186 [|ether]\n 0x0000: 5061 636b 6574 2030 30 Packet.00\n -5:00:00.610080 [|ether]\n 0x0000: 5061 636b 6574 2030 31 Packet.01\n ...\n```\n\nTo test with a larger packet count, try make E1000_DEBUG=TXERR,TX NET_CFLAGS=-DTESTOUTPUT_COUNT=100 run-net_testoutput. If this overflows your transmit ring, double check that you're handling the DD status bit correctly and that you've told the hardware to set the DD status bit (using the RS command bit).\n\nYour code should pass the `testoutput` tests of make grade.\n\n```\nQuestion\n\n 1. How did you structure your transmit implementation? In particular, what do you do if the transmit ring is full?\n```\n\n\n### Part B: Receiving packets and the web server\n\n#### Receiving Packets\n\nJust like you did for transmitting packets, you'll have to configure the E1000 to receive packets and provide a receive descriptor queue and receive descriptors. Section 3.2 describes how packet reception works, including the receive queue structure and receive descriptors, and the initialization process is detailed in section 14.4.\n\n```\nExercise 9. Read section 3.2. You can ignore anything about interrupts and checksum offloading (you can return to these sections if you decide to use these features later), and you don't have to be concerned with the details of thresholds and how the card's internal caches work.\n```\n\nThe receive queue is very similar to the transmit queue, except that it consists of empty packet buffers waiting to be filled with incoming packets. Hence, when the network is idle, the transmit queue is empty (because all packets have been sent), but the receive queue is full (of empty packet buffers).\n\nWhen the E1000 receives a packet, it first checks if it matches the card's configured filters (for example, to see if the packet is addressed to this E1000's MAC address) and ignores the packet if it doesn't match any filters. Otherwise, the E1000 tries to retrieve the next receive descriptor from the head of the receive queue. If the head (RDH) has caught up with the tail (RDT), then the receive queue is out of free descriptors, so the card drops the packet. If there is a free receive descriptor, it copies the packet data into the buffer pointed to by the descriptor, sets the descriptor's DD (Descriptor Done) and EOP (End of Packet) status bits, and increments the RDH.\n\nIf the E1000 receives a packet that is larger than the packet buffer in one receive descriptor, it will retrieve as many descriptors as necessary from the receive queue to store the entire contents of the packet. To indicate that this has happened, it will set the DD status bit on all of these descriptors, but only set the EOP status bit on the last of these descriptors. You can either deal with this possibility in your driver, or simply configure the card to not accept \"long packets\" (also known as _jumbo frames_ ) and make sure your receive buffers are large enough to store the largest possible standard Ethernet packet (1518 bytes).\n\n```\nExercise 10. Set up the receive queue and configure the E1000 by following the process in section 14.4. You don't have to support \"long packets\" or multicast. For now, don't configure the card to use interrupts; you can change that later if you decide to use receive interrupts. Also, configure the E1000 to strip the Ethernet CRC, since the grade script expects it to be stripped.\n\nBy default, the card will filter out _all_ packets. You have to configure the Receive Address Registers (RAL and RAH) with the card's own MAC address in order to accept packets addressed to that card. You can simply hard-code QEMU's default MAC address of 52:54:00:12:34:56 (we already hard-code this in lwIP, so doing it here too doesn't make things any worse). Be very careful with the byte order; MAC addresses are written from lowest-order byte to highest-order byte, so 52:54:00:12 are the low-order 32 bits of the MAC address and 34:56 are the high-order 16 bits.\n\nThe E1000 only supports a specific set of receive buffer sizes (given in the description of RCTL.BSIZE in 13.4.22). If you make your receive packet buffers large enough and disable long packets, you won't have to worry about packets spanning multiple receive buffers. Also, remember that, just like for transmit, the receive queue and the packet buffers must be contiguous in physical memory.\n\nYou should use at least 128 receive descriptors\n```\n\nYou can do a basic test of receive functionality now, even without writing the code to receive packets. Run make E1000_DEBUG=TX,TXERR,RX,RXERR,RXFILTER run-net_testinput. `testinput` will transmit an ARP (Address Resolution Protocol) announcement packet (using your packet transmitting system call), which QEMU will automatically reply to. Even though your driver can't receive this reply yet, you should see a \"e1000: unicast match[0]: 52:54:00:12:34:56\" message, indicating that a packet was received by the E1000 and matched the configured receive filter. If you see a \"e1000: unicast mismatch: 52:54:00:12:34:56\" message instead, the E1000 filtered out the packet, which means you probably didn't configure RAL and RAH correctly. Make sure you got the byte ordering right and didn't forget to set the \"Address Valid\" bit in RAH. If you don't get any \"e1000\" messages, you probably didn't enable receive correctly.\n\nNow you're ready to implement receiving packets. To receive a packet, your driver will have to keep track of which descriptor it expects to hold the next received packet (hint: depending on your design, there's probably already a register in the E1000 keeping track of this). Similar to transmit, the documentation states that the RDH register cannot be reliably read from software, so in order to determine if a packet has been delivered to this descriptor's packet buffer, you'll have to read the DD status bit in the descriptor. If the DD bit is set, you can copy the packet data out of that descriptor's packet buffer and then tell the card that the descriptor is free by updating the queue's tail index, RDT.\n\nIf the DD bit isn't set, then no packet has been received. This is the receive-side equivalent of when the transmit queue was full, and there are several things you can do in this situation. You can simply return a \"try again\" error and require the caller to retry. While this approach works well for full transmit queues because that's a transient condition, it is less justifiable for empty receive queues because the receive queue may remain empty for long stretches of time. A second approach is to suspend the calling environment until there are packets in the receive queue to process. This tactic is very similar to `sys_ipc_recv`. Just like in the IPC case, since we have only one kernel stack per CPU, as soon as we leave the kernel the state on the stack will be lost. We need to set a flag indicating that an environment has been suspended by receive queue underflow and record the system call arguments. The drawback of this approach is complexity: the E1000 must be instructed to generate receive interrupts and the driver must handle them in order to resume the environment blocked waiting for a packet.\n\n```\nExercise 11. Write a function to receive a packet from the E1000 and expose it to user space by adding a system call. Make sure you handle the receive queue being empty.\n```\n\n```\nChallenge! If the transmit queue is full or the receive queue is empty, the environment and your driver may spend a significant amount of CPU cycles polling, waiting for a descriptor. The E1000 can generate an interrupt once it is finished with a transmit or receive descriptor, avoiding the need for polling. Modify your driver so that processing the both the transmit and receive queues is interrupt driven instead of polling.\n\nNote that, once an interrupt is asserted, it will remain asserted until the driver clears the interrupt. In your interrupt handler make sure to clear the interrupt as soon as you handle it. If you don't, after returning from your interrupt handler, the CPU will jump back into it again. In addition to clearing the interrupts on the E1000 card, interrupts also need to be cleared on the LAPIC. Use `lapic_eoi` to do so.\n```\n\n#### Receiving Packets: Network Server\n\nIn the network server input environment, you will need to use your new receive system call to receive packets and pass them to the core network server environment using the `NSREQ_INPUT` IPC message. These IPC input message should have a page attached with a `union Nsipc` with its `struct jif_pkt pkt` field filled in with the packet received from the network.\n\n```\nExercise 12. Implement `net/input.c`.\n```\n\nRun `testinput` again with make E1000_DEBUG=TX,TXERR,RX,RXERR,RXFILTER run-net_testinput. You should see\n\n```\n Sending ARP announcement...\n Waiting for packets...\n e1000: index 0: 0x26dea0 : 900002a 0\n e1000: unicast match[0]: 52:54:00:12:34:56\n input: 0000 5254 0012 3456 5255 0a00 0202 0806 0001\n input: 0010 0800 0604 0002 5255 0a00 0202 0a00 0202\n input: 0020 5254 0012 3456 0a00 020f 0000 0000 0000\n input: 0030 0000 0000 0000 0000 0000 0000 0000 0000\n```\n\nThe lines beginning with \"input:\" are a hexdump of QEMU's ARP reply.\n\nYour code should pass the `testinput` tests of make grade. Note that there's no way to test packet receiving without sending at least one ARP packet to inform QEMU of JOS' IP address, so bugs in your transmitting code can cause this test to fail.\n\nTo more thoroughly test your networking code, we have provided a daemon called `echosrv` that sets up an echo server running on port 7 that will echo back anything sent over a TCP connection. Use make E1000_DEBUG=TX,TXERR,RX,RXERR,RXFILTER run-echosrv to start the echo server in one terminal and make nc-7 in another to connect to it. Every line you type should be echoed back by the server. Every time the emulated E1000 receives a packet, QEMU should print something like the following to the console:\n\n```\n e1000: unicast match[0]: 52:54:00:12:34:56\n e1000: index 2: 0x26ea7c : 9000036 0\n e1000: index 3: 0x26f06a : 9000039 0\n e1000: unicast match[0]: 52:54:00:12:34:56\n```\n\nAt this point, you should also be able to pass the `echosrv` test.\n\n```\nQuestion\n\n 2. How did you structure your receive implementation? In particular, what do you do if the receive queue is empty and a user environment requests the next incoming packet?\n```\n\n\n```\nChallenge! Read about the EEPROM in the developer's manual and write the code to load the E1000's MAC address out of the EEPROM. Currently, QEMU's default MAC address is hard-coded into both your receive initialization and lwIP. Fix your initialization to use the MAC address you read from the EEPROM, add a system call to pass the MAC address to lwIP, and modify lwIP to the MAC address read from the card. Test your change by configuring QEMU to use a different MAC address.\n```\n\n```\nChallenge! Modify your E1000 driver to be \"zero copy.\" Currently, packet data has to be copied from user-space buffers to transmit packet buffers and from receive packet buffers back to user-space buffers. A zero copy driver avoids this by having user space and the E1000 share packet buffer memory directly. There are many different approaches to this, including mapping the kernel-allocated structures into user space or passing user-provided buffers directly to the E1000. Regardless of your approach, be careful how you reuse buffers so that you don't introduce races between user-space code and the E1000.\n```\n\n```\nChallenge! Take the zero copy concept all the way into lwIP.\n\nA typical packet is composed of many headers. The user sends data to be transmitted to lwIP in one buffer. The TCP layer wants to add a TCP header, the IP layer an IP header and the MAC layer an Ethernet header. Even though there are many parts to a packet, right now the parts need to be joined together so that the device driver can send the final packet.\n\nThe E1000's transmit descriptor design is well-suited to collecting pieces of a packet scattered throughout memory, like the packet fragments created inside lwIP. If you enqueue multiple transmit descriptors, but only set the EOP command bit on the last one, then the E1000 will internally concatenate the packet buffers from these descriptors and only transmit the concatenated buffer when it reaches the EOP-marked descriptor. As a result, the individual packet pieces never need to be joined together in memory.\n\nChange your driver to be able to send packets composed of many buffers without copying and modify lwIP to avoid merging the packet pieces as it does right now.\n```\n\n```\nChallenge! Augment your system call interface to service more than one user environment. This will prove useful if there are multiple network stacks (and multiple network servers) each with their own IP address running in user mode. The receive system call will need to decide to which environment it needs to forward each incoming packet.\n\nNote that the current interface cannot tell the difference between two packets and if multiple environments call the packet receive system call, each respective environment will get a subset of the incoming packets and that subset may include packets that are not destined to the calling environment.\n\nSections 2.2 and 3 in [this][7] Exokernel paper have an in-depth explanation of the problem and a method of addressing it in a kernel like JOS. Use the paper to help you get a grip on the problem, chances are you do not need a solution as complex as presented in the paper.\n```\n\n#### The Web Server\n\nA web server in its simplest form sends the contents of a file to the requesting client. We have provided skeleton code for a very simple web server in `user/httpd.c`. The skeleton code deals with incoming connections and parses the headers.\n\n```\nExercise 13. The web server is missing the code that deals with sending the contents of a file back to the client. Finish the web server by implementing `send_file` and `send_data`.\n```\n\nOnce you've finished the web server, start the webserver (make run-httpd-nox) and point your favorite browser at http:// _host_ : _port_ /index.html, where _host_ is the name of the computer running QEMU (If you're running QEMU on athena use `hostname.mit.edu` (hostname is the output of the `hostname` command on athena, or `localhost` if you're running the web browser and QEMU on the same computer) and _port_ is the port number reported for the web server by make which-ports . You should see a web page served by the HTTP server running inside JOS.\n\nAt this point, you should score 105/105 on make grade.\n\n```\nChallenge! Add a simple chat server to JOS, where multiple people can connect to the server and anything that any user types is transmitted to the other users. To do this, you will have to find a way to communicate with multiple sockets at once _and_ to send and receive on the same socket at the same time. There are multiple ways to go about this. lwIP provides a MSG_DONTWAIT flag for recv (see `lwip_recvfrom` in `net/lwip/api/sockets.c`), so you could constantly loop through all open sockets, polling them for data. Note that, while `recv` flags are supported by the network server IPC, they aren't accessible via the regular `read` function, so you'll need a way to pass the flags. A more efficient approach is to start one or more environments for each connection and to use IPC to coordinate them. Conveniently, the lwIP socket ID found in the struct Fd for a socket is global (not per-environment), so, for example, the child of a `fork` inherits its parents sockets. Or, an environment can even send on another environment's socket simply by constructing an Fd containing the right socket ID.\n```\n\n```\nQuestion\n\n 3. What does the web page served by JOS's web server say?\n 4. How long approximately did it take you to do this lab?\n```\n\n\n**This completes the lab.** As usual, don't forget to run make grade and to write up your answers and a description of your challenge exercise solution. Before handing in, use git status and git diff to examine your changes and don't forget to git add answers-lab6.txt. When you're ready, commit your changes with git commit -am 'my solutions to lab 6', then make handin and follow the directions.\n\n--------------------------------------------------------------------------------\n\nvia: https://pdos.csail.mit.edu/6.828/2018/labs/lab6/\n\n作者:[csail.mit][a]\n选题:[lujun9972][b]\n译者:[译者ID](https://github.com/译者ID)\n校对:[校对者ID](https://github.com/校对者ID)\n\n本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出\n\n[a]: https://pdos.csail.mit.edu\n[b]: https://github.com/lujun9972\n[1]: http://wiki.qemu.org/download/qemu-doc.html#Using-the-user-mode-network-stack\n[2]: http://www.wireshark.org/\n[3]: http://www.sics.se/~adam/lwip/\n[4]: https://pdos.csail.mit.edu/6.828/2018/labs/lab6/ns.png\n[5]: https://pdos.csail.mit.edu/6.828/2018/readings/hardware/8254x_GBe_SDM.pdf\n[6]: https://pdos.csail.mit.edu/6.828/2018/labs/lab6/e1000_hw.h\n[7]: http://pdos.csail.mit.edu/papers/exo:tocs.pdf\n"},"avg_line_length":{"kind":"number","value":96.8830409357,"string":"96.883041"},"max_line_length":{"kind":"number","value":1117,"string":"1,117"},"alphanum_fraction":{"kind":"number","value":0.7684956037,"string":"0.768496"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9993616938591003,"string":"0.999362"}}},{"rowIdx":3320,"cells":{"hexsha":{"kind":"string","value":"b9b98dfecf78d8359b8c1ca43783f152a5045233"},"size":{"kind":"number","value":2567,"string":"2,567"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"src/cs/2022-01/04/06.md"},"max_stars_repo_name":{"kind":"string","value":"Adventech/sabbath-school-lessons"},"max_stars_repo_head_hexsha":{"kind":"string","value":"baf65ac98fa7c7bce73e16c263eb0cc1bf0ba62a"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":68,"string":"68"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2016-10-30T23:17:56.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2022-03-27T11:58:16.000Z"},"max_issues_repo_path":{"kind":"string","value":"src/cs/2022-01/04/06.md"},"max_issues_repo_name":{"kind":"string","value":"Adventech/sabbath-school-lessons"},"max_issues_repo_head_hexsha":{"kind":"string","value":"baf65ac98fa7c7bce73e16c263eb0cc1bf0ba62a"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"number","value":367,"string":"367"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2016-10-21T03:50:22.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2022-03-28T23:35:25.000Z"},"max_forks_repo_path":{"kind":"string","value":"src/cs/2022-01/04/06.md"},"max_forks_repo_name":{"kind":"string","value":"Adventech/sabbath-school-lessons"},"max_forks_repo_head_hexsha":{"kind":"string","value":"baf65ac98fa7c7bce73e16c263eb0cc1bf0ba62a"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"number","value":109,"string":"109"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2016-08-02T14:32:13.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2022-03-31T10:18:41.000Z"},"content":{"kind":"string","value":"---\ntitle: 'Bratr jako vzor'\ndate: 20/01/2022\n---\n\n>

\n> 1Proto i my, majíce kolem sebe tak veliký oblak svědků, odložme veškerou zátěž a hřích snadno nás ovíjející a s vytrvalostí běžme závod, který je před námi, 2upřeně hledíce k původci a dokonavateli víry Ježíši, který pro radost, která byla před ním, podstoupil kříž, pohrdnuv hanbou, a sedí po pravici Božího trůnu. 3Pomyslete na toho, který snesl od hříšníků proti sobě takový odpor, abyste neochabovali, umdlévajíce ve svých duších. 4Ještě jste se až do krve nevzepřeli v boji proti hříchu. (Žd 12,1–4; ČSP)\n\n**Osobní studium**\n\nDalším důvodem, proč Ježíš přijal naši lidskou přirozenost a žil mezi námi, bylo, že nám chtěl být příkladem, vzorem, jak správně žít před Bohem.\n\n`Jak bychom podle apoštola v úvodních verších měli žít jako křesťané?`\n\nV tomto textu je Ježíš vyvrcholením dlouhého seznamu postav, které apoštol poskytuje jako příklady víry. Tato pasáž nazývá Ježíše „původcem a dokonavatelem víry“. Řecké slovo archégos („původce“) je možné přeložit i jako „předchůdce“. Ježíš je předchůdcem v tom smyslu, že kráčí před věřícími jako „první za nás“ (Žd 6,20; ČEP). Slovo „dokonavatel“ zase říká, že Ježíš projevil víru v Boha v nejčistší možné formě. Tato pasáž učí, že Ježíš je první, kdo úspěšně završil běh života. Ježíš ve svém životě dokonale naplnil to, co znamená život víry.\n\nV Žd 2,13 čteme: „‚Také já svou důvěru složím v Boha.‘ A dále: ‚Hle, já a děti, které mi dal Bůh.‘“ Ježíš říká, že vkládá svou důvěru v Boha. Tento verš je narážkou na text Iz 8,17.18.\n\nIzajáš řekl tato slova tváří v tvář hrozbě nájezdu nepřátel ze severního Izraele a Sýrie (Iz 7,1.2). Jeho víra stála v kontrastu k nedostatku víry krále Achaza (2Kr 16,5–18). Toho Bůh vybízel, aby mu důvěřoval a požádal o znamení, že ho vysvobodí (Iz 7,1–11). Bůh totiž Achazovi již dříve slíbil, že jej jako Davidova syna bude chránit jako svého vlastního syna. Dokonce Achazovi milostivě nabídl, že svůj slib potvrdí znamením. Achaz však o znamení odmítl požádat a místo toho poslal k asyrskému králi Tiglat-Pileserovi posly se slovy: „Jsem tvůj otrok a tvůj syn“ (2Kr 16,7). Jak smutné! Achaz byl raději „synem“ Tiglat-Pilesera než synem živého Boha.\n\nJežíš však vložil svou důvěru v Boha a v jeho zaslíbení, že mu položí nepřátele pod nohy (Žd 1,13; Žd 10,12.13). Stejný slib dal Bůh i nám a my mu musíme věřit stejně jako Ježíš (Ř 16,20).\n\n**Aplikace**\n\n`Jak se můžeš naučit důvěřovat Bohu při každodenním rozhodování? Jaké důležité rozhodnutí musíš udělat a jak se můžeš ujistit, že se zakládá na důvěře v Boha?`"},"avg_line_length":{"kind":"number","value":102.68,"string":"102.68"},"max_line_length":{"kind":"number","value":653,"string":"653"},"alphanum_fraction":{"kind":"number","value":0.7701597195,"string":"0.77016"},"lid":{"kind":"string","value":"ces_Latn"},"lid_prob":{"kind":"number","value":1.0000097751617432,"string":"1.00001"}}},{"rowIdx":3321,"cells":{"hexsha":{"kind":"string","value":"b9bb7afcc58113f17a32cd475a0c4d77a98abd71"},"size":{"kind":"number","value":4479,"string":"4,479"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"docs/visual-basic/language-reference/modifiers/private-protected.md"},"max_stars_repo_name":{"kind":"string","value":"JosephHerreraDev/docs.es-es"},"max_stars_repo_head_hexsha":{"kind":"string","value":"dd545ff8c6bc59a76ff761c43b14c7f05127c91a"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"docs/visual-basic/language-reference/modifiers/private-protected.md"},"max_issues_repo_name":{"kind":"string","value":"JosephHerreraDev/docs.es-es"},"max_issues_repo_head_hexsha":{"kind":"string","value":"dd545ff8c6bc59a76ff761c43b14c7f05127c91a"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"docs/visual-basic/language-reference/modifiers/private-protected.md"},"max_forks_repo_name":{"kind":"string","value":"JosephHerreraDev/docs.es-es"},"max_forks_repo_head_hexsha":{"kind":"string","value":"dd545ff8c6bc59a76ff761c43b14c7f05127c91a"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: Private Protected\nms.date: 05/10/2018\nhelpviewer_keywords:\n- Private Protected keyword [Visual Basic]\n- Private Protected keyword [Visual Basic], syntax\nms.openlocfilehash: b7d9f81e41950b92c787e2e50fb94fe3d7c07559\nms.sourcegitcommit: f8c270376ed905f6a8896ce0fe25b4f4b38ff498\nms.translationtype: MT\nms.contentlocale: es-ES\nms.lasthandoff: 06/04/2020\nms.locfileid: \"84362234\"\n---\n# Privado protegido (Visual Basic)\n\nLa combinación de palabras claves `Private Protected` es un modificador de acceso de miembro. Un `Private Protected` miembro es accesible para todos los miembros de la clase contenedora, así como para los tipos derivados de la clase contenedora, pero solo si se encuentran en el ensamblado contenedor.\n\nSolo se puede especificar `Private Protected` en miembros de clases; no se puede aplicar `Private Protected` a los miembros de una estructura porque las estructuras no se pueden heredar.\n\n`Private Protected`Visual Basic 15,5 y versiones posteriores admiten el modificador de acceso. Para usarlo, puede Agregar el siguiente elemento al archivo de proyecto de Visual Basic ( \\* . vbproj). Siempre que Visual Basic 15,5 o posterior esté instalado en el sistema, le permite aprovechar todas las características de lenguaje compatibles con la versión más reciente del compilador de Visual Basic:\n\n```xml\n\n latest\n\n```\n\nPara obtener más información, vea [establecer la versión de lenguaje Visual Basic](../configure-language-version.md).\n\n> [!NOTE]\n> En Visual Studio, la selección de la ayuda F1 en `private protected` proporciona ayuda para [privado](private.md) o [protegido](protected.md). El IDE elige el token único bajo el cursor en lugar de la palabra compuesta.\n\n## Reglas\n\n- **Contexto de declaración.** Solo se puede usar `Private Protected` en el nivel de clase. Esto significa que el contexto de la declaración de un `Protected` elemento debe ser una clase y no puede ser un archivo de código fuente, un espacio de nombres, una interfaz, un módulo, una estructura o un procedimiento.\n\n## Comportamiento\n\n- **Nivel de acceso.** Todo el código de una clase puede tener acceso a sus elementos. El código de cualquier clase que se deriva de una clase base y se encuentra en el mismo ensamblado puede tener acceso a todos los `Private Protected` elementos de la clase base. Sin embargo, el código de cualquier clase que deriva de una clase base y se encuentra en un ensamblado diferente no puede tener acceso a los elementos de la clase base `Private Protected` .\n\n- **Modificadores de acceso.** Las palabras clave que especifican el nivel de acceso se denominan *modificadores de acceso*. Para obtener una comparación de los modificadores de acceso, vea [niveles de acceso en Visual Basic](../../programming-guide/language-features/declared-elements/access-levels.md).\n\nEl modificador `Private Protected` se puede utilizar en los contextos siguientes:\n\n- [Instrucción de clase](../statements/class-statement.md) de una clase anidada\n\n- [Instrucción Const](../statements/const-statement.md)\n\n- [Declare Statement](../statements/declare-statement.md)\n\n- [Instrucción delegada](../statements/delegate-statement.md) de un delegado anidado en una clase\n\n- [Instrucción Dim](../statements/dim-statement.md)\n\n- [Instrucción enum](../statements/enum-statement.md) de una enumeración anidada en una clase\n\n- [Event (Instrucción)](../statements/event-statement.md)\n\n- [Instrucción Function](../statements/function-statement.md)\n\n- [Instrucción de interfaz](../statements/interface-statement.md) de una interfaz anidada en una clase\n\n- [Property Statement](../statements/property-statement.md)\n\n- [Instrucción Structure](../statements/structure-statement.md) de una estructura anidada en una clase\n\n- [Instrucción Sub](../statements/sub-statement.md)\n\n## Consulte también\n\n- [Público](public.md)\n- [Contra](protected.md)\n- [Respecto](friend.md)\n- [Privado](private.md)\n- [Protected Friend](./protected-friend.md)\n- [Niveles de acceso en Visual Basic](../../programming-guide/language-features/declared-elements/access-levels.md)\n- [Procedimientos](../../programming-guide/language-features/procedures/index.md)\n- [Estructuras](../../programming-guide/language-features/data-types/structures.md)\n- [Objetos y clases](../../programming-guide/language-features/objects-and-classes/index.md)\n"},"avg_line_length":{"kind":"number","value":55.9875,"string":"55.9875"},"max_line_length":{"kind":"number","value":454,"string":"454"},"alphanum_fraction":{"kind":"number","value":0.7760660862,"string":"0.776066"},"lid":{"kind":"string","value":"spa_Latn"},"lid_prob":{"kind":"number","value":0.9275774359703064,"string":"0.927577"}}},{"rowIdx":3322,"cells":{"hexsha":{"kind":"string","value":"b9bc2abd1d461e838a96ebec64ca9dc1c77e9e96"},"size":{"kind":"number","value":3867,"string":"3,867"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"_posts/2020-09-24-on-mental-health.md"},"max_stars_repo_name":{"kind":"string","value":"sarahseewhy/sarahseewhy.github.io"},"max_stars_repo_head_hexsha":{"kind":"string","value":"bd3b294901973e0ecc430492e2f8b82cd8a11b46"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"_posts/2020-09-24-on-mental-health.md"},"max_issues_repo_name":{"kind":"string","value":"sarahseewhy/sarahseewhy.github.io"},"max_issues_repo_head_hexsha":{"kind":"string","value":"bd3b294901973e0ecc430492e2f8b82cd8a11b46"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"_posts/2020-09-24-on-mental-health.md"},"max_forks_repo_name":{"kind":"string","value":"sarahseewhy/sarahseewhy.github.io"},"max_forks_repo_head_hexsha":{"kind":"string","value":"bd3b294901973e0ecc430492e2f8b82cd8a11b46"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\nlayout: post\ntitle: On mental health and the past year\ndate: 2020-09-24\n---\n\n_It's been quite awhile since I've written and I want to talk about why. Heads-up, this is a pretty hard-hitting post with some heavy topics._\n \n**Trigger warning**: mental health, depression, PTSD, and sexual trauma.\n\nI stopped writing in 2019 and 2020 because I was wrestling with my mental health. \n\nDepression is different for each person and can take different forms in the same person. I've had depression creep up on me like a fog: slowly, quietly, until I can't see a step ahead of myself.\n\nI've also had depression strike like a lightning bolt. \n\nI go to sleep with the ability to feel and wake up dead inside, the power to emote gone. \n\nIt's hard to convey how disturbing that absence of feeling can be. \n\nIt's both physically painful, an internal grating sensation, and like a deafening, terrifying silence or emptiness.\n\nI get this type of depression because I experience panic attacks. I experience panic attacks because I have PTSD. I have PTSD because I am survivor of sexual trauma.\n\nPTSD stands for [Post-Traumatic Stress Disorder](https://www.mind.org.uk/information-support/types-of-mental-health-problems/post-traumatic-stress-disorder-ptsd). It develops after experiencing a traumatic event. \n\nPsychologists don't know why some people walk away from trauma without a mental scratch and others are haunted for the rest of their lives. I'm in the latter group. \n\nOver the years I've learned what contributes to an attack. The attacks are infrequent, two in the last ten years, but can be devastating. I've gotten much better at bouncing back. \n\nFrustratingly, it's still challenging to pinpoint the complex interplay of variables and I can be blindsided by interactions.\n\nIn May 2019 I was blindsided by an interaction that triggered the PTSD. For the next few weeks I lived in near-constant fear, reliving my trauma almost every day. This culminated in a severe panic attack which spiralled into a depressive episode. \n\nI lost the will to live overnight and spent the next few months piecing myself back together.\n\nIt's the reason I stopped writing. \n\nI tried, but writing without acknowledging what had happened felt hollow and disingenuous. \n\nFor the longest time I had neither the courage nor the ability to write about what was going on –– it's not unusual for survivors of sexual trauma to stay silent because of shame or the fear of being judged. \n\nYet for me, healing has only come through surfacing that trauma, being honest and being vulnerable.\n\n-----------------------------------\n\nIn tech blogs we're not supposed to write about personal stuff, not mental health in software development, and definitely not sexual trauma or PTSD.\n\nBut we're human: we all have mental health as well as physical health –– and many of us who have experienced trauma carry that trauma with us to work. \n\nThis is not a choice, we cannot leave these parts of ourselves behind.\n\nSpoken word poet Andrea Gibson in \"Blue Blanket\"*, a poem about rape, writes:\n\n> _do you know they found land mines in broken women’s souls?\n black holes in the parts of their hearts that once sang symphonies of creation_\n\nI sometimes think trauma is like that: land mines in our souls. \n\nOne of the reasons I read and talk about effective communication and conflict transformation is for self-preservation: I have land mines in my soul.\n\nI also believe the people I work with have land mines of their own. \n\nI want to learn how to better listen and communicate, and encourage others to do so as well. \n\nThat way when we discover these land mines we have the tools to diffuse them –– together.\n\n
\n\n* The full text of the poem can be found [here](https://ohandreagibson.tumblr.com/blueblanket) and [this is Gibson's performance](https://www.youtube.com/watch?v=2cEc3aQOP-o)."},"avg_line_length":{"kind":"number","value":55.2428571429,"string":"55.242857"},"max_line_length":{"kind":"number","value":247,"string":"247"},"alphanum_fraction":{"kind":"number","value":0.7739850013,"string":"0.773985"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9997132420539856,"string":"0.999713"}}},{"rowIdx":3323,"cells":{"hexsha":{"kind":"string","value":"b9bc33cdec17fa65b2f1c8339e45d1b0f6708e08"},"size":{"kind":"number","value":3293,"string":"3,293"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"powerbi-docs/guided-learning/includes/3-5-create-map-visualizations.md"},"max_stars_repo_name":{"kind":"string","value":"Heimig/powerbi-docs.de-de"},"max_stars_repo_head_hexsha":{"kind":"string","value":"73b42400695fb379324256e53d19e6824a785415"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"powerbi-docs/guided-learning/includes/3-5-create-map-visualizations.md"},"max_issues_repo_name":{"kind":"string","value":"Heimig/powerbi-docs.de-de"},"max_issues_repo_head_hexsha":{"kind":"string","value":"73b42400695fb379324256e53d19e6824a785415"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"powerbi-docs/guided-learning/includes/3-5-create-map-visualizations.md"},"max_forks_repo_name":{"kind":"string","value":"Heimig/powerbi-docs.de-de"},"max_forks_repo_head_hexsha":{"kind":"string","value":"73b42400695fb379324256e53d19e6824a785415"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\nms.openlocfilehash: 033436e7078723508d6b9481807ace424c3f109f\nms.sourcegitcommit: 60dad5aa0d85db790553e537bf8ac34ee3289ba3\nms.translationtype: MT\nms.contentlocale: de-DE\nms.lasthandoff: 05/29/2019\nms.locfileid: \"61396884\"\n---\nPower BI bietet zwei verschiedene Arten von Kartenvisualisierungen: eine Blasendiagrammkarte, bei der Blasen über geografischen Punkten platziert werden, und ein Flächenkartogramm, bei dem die Kontur der zu visualisierenden Regionen angezeigt wird.\n\n![](media/3-5-create-map-visualizations/3-5_1.png)\n\n> [!NOTE]\n> Verwenden Sie bei der Arbeit mit Ländern oder Regionen das dreistellige Buchstabenkürzel, um sicherzustellen, dass die Geocodierung in Kartenvisualisierungen ordnungsgemäß funktioniert. Verwenden Sie *nicht* die zweistelligen Kürzel, da einige Länder oder Regionen sonst unter Umständen nicht ordnungsgemäß erkannt werden.\n> Falls Sie nur über zweistellige Kürzel verfügen, informieren Sie sich in [diesem externen Blogbeitrag](https://blog.ailon.org/how-to-display-2-letter-country-data-on-a-power-bi-map-85fc738497d6#.yudauacxp) darüber, wie Sie Ihren zweistelligen Länder-/Regionskürzeln die dreistelligen Länder-/Regionskürzel zuordnen.\n> \n> \n\n## Erstellen von Blasendiagrammkarten\nWählen Sie zum Erstellen einer Blasendiagrammkarte die Option **Karte** im Bereich **Visualisierung** aus. Um ein visuelles Kartenelement verwenden zu können, müssen Sie dem Bucket *Standort* in den Optionen unter **Visualisierungen** einen Wert hinzufügen.\n\n![](media/3-5-create-map-visualizations/3-5_2.png)\n\nStandortwerte können in Power BI flexibel eingegeben werden: angefangen bei allgemeineren Angaben, z. B. der Name des Orts oder der Flughafencode, bis hin zu sehr spezifischen Angaben zum Breiten- und Längengrad. Fügen Sie dem Bucket **Größe** ein Feld hinzu, um die Größe der Blase für jede Kartenposition entsprechend zu ändern.\n\n![](media/3-5-create-map-visualizations/3-5_3.png)\n\n## Erstellen von Flächenkartogrammen\nWählen Sie zum Erstellen eines Flächenkartogramms die Option **Flächenkartogramm** im Bereich „Visualisierung“ aus. Wie bei Blasendiagrammkarten müssen Sie für die Verwendung des visuellen Elements dem Bucket „Standort“ einen Wert hinzufügen. Durch Hinzufügen eines Werts zum Bucket „Größe“ können Sie die Intensität der Füllfarbe entsprechend ändern.\n\n![](media/3-5-create-map-visualizations/3-5_4.png)\n\nEin Warnsymbol in der linken oberen Ecke eines visuellen Elements gibt an, dass für die Karte weitere Standortdaten erforderlich sind, um die Werte genau darstellen zu können. Dies ist besonders häufig der Fall, wenn die Daten für den Standort uneindeutig sind, z. B. wenn Sie einen Bereichsnamen wie *Washington* angeben, bei dem es sich um einen Bundesstaat oder einen District in den USA handeln kann. Eine Möglichkeit zum Umgehen dieses Problems besteht darin, dass Sie den Titel der Spalte spezifischer benennen, z. B. mit *Bundesstaat*. Eine andere Möglichkeit besteht darin, die Datenkategorie manuell zurückzusetzen. Wählen Sie dazu auf der Registerkarte „Modellierung“ die Option **Datenkategorie** aus. Über diese Option können Sie den Daten eine Kategorie zuweisen, z. B. „Bundesstaat“ oder „Ort“.\n\n![](media/3-5-create-map-visualizations/3-5_5.png)\n\n"},"avg_line_length":{"kind":"number","value":89,"string":"89"},"max_line_length":{"kind":"number","value":808,"string":"808"},"alphanum_fraction":{"kind":"number","value":0.8083814151,"string":"0.808381"},"lid":{"kind":"string","value":"deu_Latn"},"lid_prob":{"kind":"number","value":0.9979726076126099,"string":"0.997973"}}},{"rowIdx":3324,"cells":{"hexsha":{"kind":"string","value":"b9bc3f73e19a0ea09c850eca873da777120eb7f5"},"size":{"kind":"number","value":2903,"string":"2,903"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"AppFog/deploy-static-website.md"},"max_stars_repo_name":{"kind":"string","value":"hanserikjensen/PublicKB"},"max_stars_repo_head_hexsha":{"kind":"string","value":"56094f621201870dd0a0bcc0efa5c6db6ec952b7"},"max_stars_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"AppFog/deploy-static-website.md"},"max_issues_repo_name":{"kind":"string","value":"hanserikjensen/PublicKB"},"max_issues_repo_head_hexsha":{"kind":"string","value":"56094f621201870dd0a0bcc0efa5c6db6ec952b7"},"max_issues_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"AppFog/deploy-static-website.md"},"max_forks_repo_name":{"kind":"string","value":"hanserikjensen/PublicKB"},"max_forks_repo_head_hexsha":{"kind":"string","value":"56094f621201870dd0a0bcc0efa5c6db6ec952b7"},"max_forks_repo_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"max_forks_count":{"kind":"number","value":1,"string":"1"},"max_forks_repo_forks_event_min_datetime":{"kind":"string","value":"2021-10-31T15:23:50.000Z"},"max_forks_repo_forks_event_max_datetime":{"kind":"string","value":"2021-10-31T15:23:50.000Z"},"content":{"kind":"string","value":"{{{\n \"title\": \"Deploying a Static Website\",\n \"date\": \"05-08-2015\",\n \"author\": \"Chris Sterling\",\n \"attachments\": [],\n \"related-products\" : [],\n \"contentIsHTML\": false\n}}}\n\n### Audience\n\nApplication developers\n\n### Overview\n\nAppFog includes the [Cloud Foundry Static File buildpack](https://github.com/cloudfoundry/staticfile-buildpack) by default. This enables the deployment of static websites to AppFog. The Static File buildpack will serve up files using [Nginx](http://nginx.com/). Given that Nginx only needs about 20 MB of memory to run, you are able to run using much lower memory than the default of 1 GB that AppFog allocates to an application. This will mean that your memory usage will be lower and this will reflect in lower cost to run a static website. We recommend 64 MB as the amount of memory to reserve for most static websites.\n\n### Deploying a Static Website\n\nTo make AppFog automatically use the Static File buildpack for your application when you deploy, create an empty file named `Staticfile` in your top-level website directory. Now you can create an index.html file that will become your entry point into the website.\n\n```\n\nMy Page\n

Hello World!

\n\n```\n\nOnce you have your index.html you can deploy the website to AppFog by running the following command from a terminal:\n\n```\n$ cf push mywebsitename -m 64M\n```\n\nThe `-m 64M` tells AppFog that it should only allocate 64 MB of memory to run this website. Once it is deployed AppFog will return a URL where you can access the website in your browser:\n\n```\nCreating app mywebsitename in org DEMO / space Dev as mydemoaccount...\nOK\n\nCreating route mywebsitename.useast.appfog.ctl.io...\nOK\n\nBinding mywebsitename.useast.appfog.ctl.io to mywebsitename...\nOK\n\nUploading mywebsitename...\nUploading app files from: .../mysite\nUploading 333K, 11 files\nDone uploading \nOK\n\nStarting app mywebsitename in org DEMO / space Dev as mydemoaccount...\n-----> Downloaded app package (696K)\n-----> Using root folder\n-----> Copying project files into public/\n-----> Setting up nginx\n\n-----> Uploading droplet (4.4M)\n\n1 of 1 instances running\n\nApp started\n\n\nOK\n\nApp mywebsitename was started using this command `sh boot.sh`\n\nShowing health and status for app mywebsitename in org DEMO / space Dev as mydemoaccount...\nOK\n\nrequested state: started\ninstances: 1/1\nusage: 64M x 1 instances\nurls: mywebsitename.useast.appfog.ctl.io\nlast uploaded: Fri May 8 21:09:05 UTC 2015\nstack: lucid64\n\n state since cpu memory disk details \n#0 running 2015-05-08 02:09:19 PM 0.0% 4.9M of 64M 9.5M of 1G \n```\n\nUse the URL from the `urls:` value and place into the location bar of a web browser. In this case it is `http://mywebsitename.useast.appfog.ctl.io`:\n\n![AppFog Website in Browser](../images/appfog-website-browser.png)\n"},"avg_line_length":{"kind":"number","value":33.367816092,"string":"33.367816"},"max_line_length":{"kind":"number","value":622,"string":"622"},"alphanum_fraction":{"kind":"number","value":0.7271787806,"string":"0.727179"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9660661220550537,"string":"0.966066"}}},{"rowIdx":3325,"cells":{"hexsha":{"kind":"string","value":"b9bc55f14ada3f1dc882b5f70640140c8aa842b5"},"size":{"kind":"number","value":16496,"string":"16,496"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"docs/framework/wpf/advanced/drawing-formatted-text.md"},"max_stars_repo_name":{"kind":"string","value":"CodeTherapist/docs.de-de"},"max_stars_repo_head_hexsha":{"kind":"string","value":"45ed8badf2e25fb9abdf28c20e421f8da4094dd1"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"docs/framework/wpf/advanced/drawing-formatted-text.md"},"max_issues_repo_name":{"kind":"string","value":"CodeTherapist/docs.de-de"},"max_issues_repo_head_hexsha":{"kind":"string","value":"45ed8badf2e25fb9abdf28c20e421f8da4094dd1"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"docs/framework/wpf/advanced/drawing-formatted-text.md"},"max_forks_repo_name":{"kind":"string","value":"CodeTherapist/docs.de-de"},"max_forks_repo_head_hexsha":{"kind":"string","value":"45ed8badf2e25fb9abdf28c20e421f8da4094dd1"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: Zeichnen von formatiertem Text\nms.date: 03/30/2017\ndev_langs:\n- csharp\n- vb\nhelpviewer_keywords:\n- text [WPF]\n- typography [WPF], drawing formatted text\n- formatted text [WPF]\n- drawing [WPF], formatted text\nms.assetid: b1d851c1-331c-4814-9964-6fe769db6f1f\nms.openlocfilehash: 4cbf2a9ec9b742af3895f7c30b1a4dbbdbf5a635\nms.sourcegitcommit: 3c1c3ba79895335ff3737934e39372555ca7d6d0\nms.translationtype: MT\nms.contentlocale: de-DE\nms.lasthandoff: 09/06/2018\nms.locfileid: \"43804937\"\n---\n# Zeichnen von formatiertem Text\nDieses Thema enthält eine Übersicht über die Funktionen von der Objekt. Dieses Objekt bietet die Steuerung auf niedriger Ebene für das Zeichnen von Text in [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)]-Anwendungen. \n \n \n## Übersicht über die Technologie \n Die Objekt können Sie mehrzeiligen Text zu zeichnen, in dem jedes Zeichen im Text einzeln formatiert werden kann. Das folgende Beispiel zeigt Text mit mehreren angewendeten Formaten: \n \n ![Mit dem FormattedText-Objekt angezeigter Text](../../../../docs/framework/wpf/advanced/media/formattedtext01.jpg \"FormattedText01\") \nAngezeigter Text mit der FormattedText-Methode \n \n> [!NOTE]\n> Für Entwickler, die von der [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)]-API migrieren, listet die Tabelle im [Win32-Migration](#win32_migration)-Abschnitt die [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)]-DrawText-Flags und deren ungefähre Entsprechung in [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)] auf. \n \n### Gründe für das Verwenden von formatiertem Text \n [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] enthält zahlreiche Steuerelemente für das Zeichnen von Text auf dem Bildschirm. Jedes Steuerelement ist einem bestimmten Szenario zugeordnet und besitzt eine eigene Liste von Funktionen und Einschränkungen. Im Allgemeinen die Element sollte verwendet werden, wenn nur eingeschränkte Textelemente-Unterstützung erforderlich ist, z. B. einem kurzen Satz in einem [!INCLUDE[TLA#tla_ui](../../../../includes/tlasharptla-ui-md.md)]. kann verwendet werden, wenn nur minimale textunterstützung erforderlich ist. Weitere Informationen finden Sie unter [Dokumente in WPF](../../../../docs/framework/wpf/advanced/documents-in-wpf.md). \n \n Die -Objekt bietet umfassendere Textformatierungsfunktionen als [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)] Textsteuerelementtyp entspricht, und können nützlich sein, in Fällen, in denen Text als dekoratives Element verwendet werden sollen. Weitere Informationen finden Sie im folgenden Abschnitt [Konvertieren von formatiertem Text in eine Geometrie](#converting_formatted_text). \n \n Darüber hinaus die Objekt ist nützlich zum Erstellen von textorientierten --abgeleitete Objekte. ist eine einfache Zeichnungsklasse, die zum Rendern von Formen, Bildern oder Text verwendet wird. Weitere Informationen finden Sie unter [Beispiel für Treffertests mit DrawingVisuals](https://go.microsoft.com/fwlink/?LinkID=159994). \n \n## Verwenden des FormattedText-Objekts \n Um formatierten Text erstellen möchten, rufen die Konstruktor zur Erstellung einer Objekt. Nachdem Sie die Anfangszeichenfolge für formatierten Text erstellt haben, können Sie eine Reihe von Formatvorlagen anwenden. \n \n Verwenden der Eigenschaft, um den Text auf eine bestimmte Breite zu begrenzen. Der Text wird automatisch umgebrochen, um die angegebene Breite nicht zu überschreiten. Verwenden der Eigenschaft, um den Text auf eine bestimmte Höhe zu begrenzen. Der Text zeigt Auslassungspunkte „...“ an, wenn die angegebene Höhe überschritten wird. \n \n ![Mit dem FormattedText-Objekt angezeigter Text](../../../../docs/framework/wpf/advanced/media/formattedtext02.png \"FormattedText02\") \nAngezeigter Text mit Zeilenumbruch und Auslassungspunkten \n \n Sie können mehrere Formatvorlagen auf ein oder mehrere Zeichen anwenden. Sie können z. B. Aufrufen sowohl die und Methoden zum Ändern der Formatierung der ersten fünf Zeichen im Text. \n \n Das folgende Codebeispiel erstellt eine Objekt aus, und anschließend mehrere Formatvorlagen auf den Text angewendet. \n \n [!code-csharp[FormattedTextSnippets#FormattedTextSnippets1](../../../../samples/snippets/csharp/VS_Snippets_Wpf/FormattedTextSnippets/CSharp/Window1.xaml.cs#formattedtextsnippets1)]\n [!code-vb[FormattedTextSnippets#FormattedTextSnippets1](../../../../samples/snippets/visualbasic/VS_Snippets_Wpf/FormattedTextSnippets/visualbasic/window1.xaml.vb#formattedtextsnippets1)] \n \n### Maßeinheit für den Schriftgrad \n Wie andere Textobjekte in [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)] Anwendungen, die Objekt verwendet geräteunabhängige Pixel als Maßeinheit an. Die meisten [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)]-Anwendungen verwenden jedoch Punkte als Maßeinheit. Möchten Sie in [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)]-Anwendungen Punkte als Maßeinheit für angezeigten Text verwenden, müssen Sie [!INCLUDE[TLA#tla_dipixel#plural](../../../../includes/tlasharptla-dipixelsharpplural-md.md)] in Punkte konvertieren. Der folgende Code veranschaulicht diese Konvertierung: \n \n [!code-csharp[FormattedTextSnippets#FormattedTextSnippets2](../../../../samples/snippets/csharp/VS_Snippets_Wpf/FormattedTextSnippets/CSharp/Window1.xaml.cs#formattedtextsnippets2)]\n [!code-vb[FormattedTextSnippets#FormattedTextSnippets2](../../../../samples/snippets/visualbasic/VS_Snippets_Wpf/FormattedTextSnippets/visualbasic/window1.xaml.vb#formattedtextsnippets2)] \n \n \n### Konvertieren von formatiertem Text in eine Geometrie \n Sie können formatierten Text in konvertieren Objekte, die Ihnen ermöglichen, andere Arten von visuell interessantem Text erstellen. Sie können z. B. Erstellen einer Objekt auf Grundlage der Gliederung einer Textzeichenfolge. \n \n ![Textkontur mit einem linearen Farbverlaufspinsel](../../../../docs/framework/wpf/advanced/media/outlinedtext02.jpg \"OutlinedText02\") \nTextkontur mit einem linearen Farbverlaufspinsel \n \n Die folgenden Beispiele zeigen verschiedene Möglichkeiten zum Erstellen von visuell interessanten Effekten durch Ändern von Strich, Füllung und Hervorhebung des konvertierten Texts. \n \n ![Text mit unterschiedlichen Farben für Füllung und Strich](../../../../docs/framework/wpf/advanced/media/outlinedtext03.jpg \"OutlinedText03\") \nBeispiel für das Festlegen von unterschiedlichen Farben für Strich und Füllung \n \n ![Text mit auf Strich angewendetem Bildpinsel](../../../../docs/framework/wpf/advanced/media/outlinedtext04.jpg \"OutlinedText04\") \nBeispiel für die Anwendung eines Bildpinsels auf den Strich \n \n ![Text mit auf Strich angewendetem Bildpinsel](../../../../docs/framework/wpf/advanced/media/outlinedtext05.jpg \"OutlinedText05\") \nBeispiel für die Anwendung eines Bildpinsels auf den Strich und die Hervorhebung \n \n Wenn in Text konvertiert wird eine Objekt, es ist nicht mehr eine Sammlung von Zeichen, die Zeichen in der Textzeichenfolge kann nicht geändert werden. Sie können jedoch die Darstellung des konvertierten Texts durch Ändern der Strich- und Füllungseigenschaften ändern. Der Strich bezieht sich auf die Kontur des konvertierten Texts und die Füllung auf den Bereich innerhalb der Kontur. Weitere Informationen finden Sie unter [Erstellen von Text mit Kontur](../../../../docs/framework/wpf/advanced/how-to-create-outlined-text.md). \n \n Sie können auch formatierten Text zum Konvertieren einer -Objekt und verwenden Sie das Objekt zum Hervorheben des Texts. Sie können z. B. eine Animation Anwenden der Objekts, sodass die Animation die Kontur des formatierten Texts folgt. \n \n Das folgende Beispiel zeigt formatierten Text, der in konvertiert wurde eine Objekt. Eine animierte Ellipse folgt dem Strichpfad des gerenderten Texts. \n \n ![Kugel, die der Pfadgeometrie des Textes folgt](../../../../docs/framework/wpf/advanced/media/textpathgeometry01.gif \"TextPathGeometry01\") \nKugel, die der Pfadgeometrie des Textes folgt \n \n Weitere Informationen finden Sie unter [Vorgehensweise: Erstellen einer PathGeometry-Animation für Text](https://msdn.microsoft.com/library/29f8051e-798a-463f-a926-a099a99e9c67). \n \n Sie können weitere interessanten Verwendungsmöglichkeiten für formatierten Text erstellen, sobald er in konvertiert wurde eine Objekt. So können Sie beispielsweise ein zugeschnittenes Video darin anzeigen. \n \n ![Video anzeigen, in der Pfadgeometrie des Textes](../../../../docs/framework/wpf/advanced/media/videotextdemo01.png \"VideoTextDemo01\") \nVideo, das in der Pfadgeometrie von Text angezeigt wird \n \n \n## Win32-Migration \n Die Funktionen von zum Zeichnen von Text ähneln den Funktionen von der [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)] DrawText-Funktion. Für Entwickler, die von der [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)]-API migrieren, listet die folgende Tabelle die [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)]-DrawText-Flags und deren ungefähre Entsprechung in [!INCLUDE[TLA#tla_winclient](../../../../includes/tlasharptla-winclient-md.md)] auf. \n \n|DrawText-Flag|WPF-Entsprechung|Hinweise| \n|-------------------|--------------------|-----------| \n|DT_BOTTOM||Verwenden der -Eigenschaft zur Berechnung einer entsprechenden [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)] DrawText-y-Position.| \n|DT_CALCRECT|, |Verwenden der und Eigenschaften des ausgaberechtecks.| \n|DT_CENTER||Verwenden der Eigenschaft mit dem der Wert festgelegt, .| \n|DT_EDITCONTROL|Keiner|Nicht erforderlich Rendern von Abstandsbreite und letzter Zeile sind identisch mit dem Edit-Steuerelement für Framework.| \n|DT_END_ELLIPSIS||Verwenden der Eigenschaft mit dem Wert .

Verwenden abzurufenden [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)] DT_END_ELLIPSIS mit DT_WORD_ELIPSIS-Endellipse — in diesem Fall zeichenellipse nur auf Wörtern, die nicht in einer einzelnen Zeile auftritt.| \n|DT_EXPAND_TABS|Keiner|Nicht erforderlich Registerkarten werden automatisch auf Zwischenstopps nach jeweils 4 em erweitert. Dies entspricht etwa der Breite von 8 sprachunabhängigen Zeichen.| \n|DT_EXTERNALLEADING|Keiner|Nicht erforderlich Der externe Abstand ist immer im Zeilenabstand enthalten. Verwenden der Eigenschaft, um eine benutzerdefinierte Zeilenabstand zu erstellen.| \n|DT_HIDEPREFIX|Keiner|Wird nicht unterstützt. Entfernen Sie die '&' aus der Zeichenfolge vor der Erstellung der Objekt.| \n|DT_LEFT||Dies ist die standardmäßige Textausrichtung. Verwenden der Eigenschaft mit dem der Wert festgelegt, . (nur für WPF)| \n|DT_MODIFYSTRING|Keiner|Wird nicht unterstützt.| \n|DT_NOCLIP||Clipping geschieht nicht automatisch. Wenn Sie Beschneiden von Text möchten, verwenden Sie die Eigenschaft.| \n|DT_NOFULLWIDTHCHARBREAK|Keiner|Wird nicht unterstützt.| \n|DT_NOPREFIX|Keiner|Nicht erforderlich Das &-Zeichen innerhalb der Zeichenfolgen wird immer als normales Zeichen behandelt.| \n|DT_PATHELLIPSIS|Keiner|Verwenden der Eigenschaft mit dem Wert .| \n|DT_PREFIX|Keiner|Wird nicht unterstützt. Wenn Unterstriche für Text, z. B. eine Zugriffstaste oder Link verwendet werden sollen. verwenden Sie die Methode.| \n|DT_PREFIXONLY|Keiner|Wird nicht unterstützt.| \n|DT_RIGHT||Verwenden der Eigenschaft mit dem der Wert festgelegt, . (nur für WPF)| \n|DT_RTLREADING||Legen Sie die -Eigenschaft auf fest.| \n|DT_SINGLELINE|Keiner|Nicht erforderlich Objekte verhalten sich als einzelne Zeile-Steuerelement, es sei denn, entweder die Eigenschaft festgelegt ist, oder den Text enthält, einen Wagenrücklauf/Zeilenvorschub (CR/LF).| \n|DT_TABSTOP|Keiner|Keine Unterstützung für benutzerdefinierte Tabstopppositionen.| \n|DT_TOP||Nicht erforderlich Obere Ausrichtung ist die Standardeinstellung. Andere vertikale Positionierungswerte können definiert werden, indem die -Eigenschaft zur Berechnung einer entsprechenden [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)] DrawText-y-Position.| \n|DT_VCENTER||Verwenden der -Eigenschaft zur Berechnung einer entsprechenden [!INCLUDE[TLA#tla_win32](../../../../includes/tlasharptla-win32-md.md)] DrawText-y-Position.| \n|DT_WORDBREAK|Keiner|Nicht erforderlich Die wörtertrennung geschieht automatisch mit Objekte. Sie kann nicht deaktiviert werden.| \n|DT_WORD_ELLIPSIS||Verwenden der Eigenschaft mit dem Wert .| \n \n## Siehe auch \n \n [Dokumente in WPF](../../../../docs/framework/wpf/advanced/documents-in-wpf.md) \n [Typografie in WPF](../../../../docs/framework/wpf/advanced/typography-in-wpf.md) \n [Erstellen von Text mit Kontur](../../../../docs/framework/wpf/advanced/how-to-create-outlined-text.md) \n [Vorgehensweise: Erstellen einer PathGeometry-Animation für Text](https://msdn.microsoft.com/library/29f8051e-798a-463f-a926-a099a99e9c67)\n"},"avg_line_length":{"kind":"number","value":124.9696969697,"string":"124.969697"},"max_line_length":{"kind":"number","value":787,"string":"787"},"alphanum_fraction":{"kind":"number","value":0.7919495635,"string":"0.79195"},"lid":{"kind":"string","value":"deu_Latn"},"lid_prob":{"kind":"number","value":0.9213791489601135,"string":"0.921379"}}},{"rowIdx":3326,"cells":{"hexsha":{"kind":"string","value":"b9bd72be3e59cc10dd4d0bca42cb9e2c431bcb29"},"size":{"kind":"number","value":388,"string":"388"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"README.md"},"max_stars_repo_name":{"kind":"string","value":"johnpatek/record-manager"},"max_stars_repo_head_hexsha":{"kind":"string","value":"af28877c6a7f47a4c33e2e9c0c7baa8fa0a4a944"},"max_stars_repo_licenses":{"kind":"list like","value":["Zlib"],"string":"[\n \"Zlib\"\n]"},"max_stars_count":{"kind":"number","value":1,"string":"1"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2020-11-09T05:46:18.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2020-11-09T05:46:18.000Z"},"max_issues_repo_path":{"kind":"string","value":"README.md"},"max_issues_repo_name":{"kind":"string","value":"johnpatek/record-manager"},"max_issues_repo_head_hexsha":{"kind":"string","value":"af28877c6a7f47a4c33e2e9c0c7baa8fa0a4a944"},"max_issues_repo_licenses":{"kind":"list like","value":["Zlib"],"string":"[\n \"Zlib\"\n]"},"max_issues_count":{"kind":"number","value":1,"string":"1"},"max_issues_repo_issues_event_min_datetime":{"kind":"string","value":"2020-12-19T04:09:05.000Z"},"max_issues_repo_issues_event_max_datetime":{"kind":"string","value":"2020-12-19T04:09:05.000Z"},"max_forks_repo_path":{"kind":"string","value":"README.md"},"max_forks_repo_name":{"kind":"string","value":"johnpatek/record-manager"},"max_forks_repo_head_hexsha":{"kind":"string","value":"af28877c6a7f47a4c33e2e9c0c7baa8fa0a4a944"},"max_forks_repo_licenses":{"kind":"list like","value":["Zlib"],"string":"[\n \"Zlib\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"# Record Manager\n\n[![Build Status](https://travis-ci.com/johnpatek/record-manager.svg?branch=master)](https://travis-ci.com/johnpatek/record-manager)\n\nBuild:\n```shell\npython3 cmake.py --external\npython3 cmake.py\n```\n\nStart the server application:\n```shell\nmkdir /home/ubuntu/records\nserver 12345 /home/ubuntu/records\n```\n\nStart the client application:\n```shell\nclient 127.0.0.1 12345\n```\n"},"avg_line_length":{"kind":"number","value":18.4761904762,"string":"18.47619"},"max_line_length":{"kind":"number","value":131,"string":"131"},"alphanum_fraction":{"kind":"number","value":0.7422680412,"string":"0.742268"},"lid":{"kind":"string","value":"kor_Hang"},"lid_prob":{"kind":"number","value":0.22745461761951447,"string":"0.227455"}}},{"rowIdx":3327,"cells":{"hexsha":{"kind":"string","value":"b9bd7cd36ac93dfce5d067ad69542b50455c27cb"},"size":{"kind":"number","value":2303,"string":"2,303"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"node_modules/isomorphic-style-loader/CHANGELOG.md"},"max_stars_repo_name":{"kind":"string","value":"jparkerpearson/partyPlayer"},"max_stars_repo_head_hexsha":{"kind":"string","value":"e2ba7dfb433b6aad6b13101f4d85c2645d00f2db"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"node_modules/isomorphic-style-loader/CHANGELOG.md"},"max_issues_repo_name":{"kind":"string","value":"jparkerpearson/partyPlayer"},"max_issues_repo_head_hexsha":{"kind":"string","value":"e2ba7dfb433b6aad6b13101f4d85c2645d00f2db"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"node_modules/isomorphic-style-loader/CHANGELOG.md"},"max_forks_repo_name":{"kind":"string","value":"jparkerpearson/partyPlayer"},"max_forks_repo_head_hexsha":{"kind":"string","value":"e2ba7dfb433b6aad6b13101f4d85c2645d00f2db"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"# Isomorphic Style Loader Change Log\n\nAll notable changes to this project will be documented in this file.\n\n## [v2.0.0] - 2017-04-20\n\n- Pull `PropTypes` from [prop-types](https://www.npmjs.com/package/prop-types) package for compatibility with **React 15.3.0** and higher ([#90](https://github.com/kriasoft/isomorphic-style-loader/pull/90))\n\n## [v1.1.0] - 2016-10-30\n\n- Disable source maps in IE9 and below, to prevent runtime errors in development mode ([#69](https://github.com/kriasoft/isomorphic-style-loader/pull/69))\n- Improve source maps support by making sourceURL field unique ([#44](https://github.com/kriasoft/isomorphic-style-loader/pull/44), [#69](https://github.com/kriasoft/isomorphic-style-loader/pull/69))\n- Add access to content to deduplicate server-side generated styles ([#56](https://github.com/kriasoft/isomorphic-style-loader/pull/56))\n- Use HMR (Hot Module Replacement) if available, no debug option required ([#57](https://github.com/kriasoft/isomorphic-style-loader/pull/57))\n- Use [hoist-non-react-statics](https://github.com/mridgway/hoist-non-react-statics) to copy non-react\n specific statics from a child to a parent component inside `withStyles` HOC (Higher-Order Component)\n ([#38](https://github.com/kriasoft/isomorphic-style-loader/pull/38))\n- Add `CHANGELOG.md` file with the past and future (planned) changes to the project\n\n## [v1.0.0] - 2016-04-15\n\n- Improve comparability with Hot Module Replacement (HMR) ([#33](https://github.com/kriasoft/isomorphic-style-loader/pull/33))\n- Add support of ES2015+ decorator syntax, e.g. `@withStyles(s) class MyComponent extends Component { .. }`\n [PR#21](https://github.com/kriasoft/isomorphic-style-loader/pull/21) (BREAKING CHANGE)\n\n## [v0.0.12] - 2016-03-04\n\n- Fix style not getting removed for multiple instance ([#23](https://github.com/kriasoft/isomorphic-style-loader/pull/23))\n\n[unreleased]: https://github.com/kriasoft/isomorphic-style-loader/compare/v2.0.0...HEAD\n[v2.0.0]: https://github.com/kriasoft/isomorphic-style-loader/compare/v1.1.0...v2.0.0\n[v1.1.0]: https://github.com/kriasoft/isomorphic-style-loader/compare/v1.0.0...v1.1.0\n[v1.0.0]: https://github.com/kriasoft/isomorphic-style-loader/compare/v0.0.12...v1.0.0\n[v0.0.12]: https://github.com/kriasoft/isomorphic-style-loader/compare/v0.0.11...v0.0.12\n"},"avg_line_length":{"kind":"number","value":65.8,"string":"65.8"},"max_line_length":{"kind":"number","value":206,"string":"206"},"alphanum_fraction":{"kind":"number","value":0.7438124186,"string":"0.743812"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.3201588988304138,"string":"0.320159"}}},{"rowIdx":3328,"cells":{"hexsha":{"kind":"string","value":"b9bdb4a90fe4b8c0d9a0ef2232b0f50437903203"},"size":{"kind":"number","value":6720,"string":"6,720"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"articles/virtual-machines/linux/shared-images-portal.md"},"max_stars_repo_name":{"kind":"string","value":"nsrau/azure-docs.it-it"},"max_stars_repo_head_hexsha":{"kind":"string","value":"9935e44b08ef06c214a4c7ef94d12e79349b56bc"},"max_stars_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"articles/virtual-machines/linux/shared-images-portal.md"},"max_issues_repo_name":{"kind":"string","value":"nsrau/azure-docs.it-it"},"max_issues_repo_head_hexsha":{"kind":"string","value":"9935e44b08ef06c214a4c7ef94d12e79349b56bc"},"max_issues_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"articles/virtual-machines/linux/shared-images-portal.md"},"max_forks_repo_name":{"kind":"string","value":"nsrau/azure-docs.it-it"},"max_forks_repo_head_hexsha":{"kind":"string","value":"9935e44b08ef06c214a4c7ef94d12e79349b56bc"},"max_forks_repo_licenses":{"kind":"list like","value":["CC-BY-4.0","MIT"],"string":"[\n \"CC-BY-4.0\",\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\ntitle: Creare immagini di macchine virtuali Linux di Azure condivise usando il portale\ndescription: Informazioni su come usare portale di Azure per creare e condividere immagini di macchine virtuali Linux.\nauthor: cynthn\ntags: azure-resource-manager\nms.service: virtual-machines-linux\nms.subservice: imaging\nms.topic: how-to\nms.workload: infrastructure\nms.date: 05/04/2020\nms.author: cynthn\nms.reviewer: akjosh\nms.openlocfilehash: 2661715164cc6aa5f5ff587f2ddf28c0918445d4\nms.sourcegitcommit: a43a59e44c14d349d597c3d2fd2bc779989c71d7\nms.translationtype: MT\nms.contentlocale: it-IT\nms.lasthandoff: 11/25/2020\nms.locfileid: \"96015997\"\n---\n# Creare una raccolta di immagini condivise usando il portale\n\nLa [raccolta di immagini condivise](shared-image-galleries.md) semplifica la condivisione di immagini personalizzate all'interno dell'organizzazione. Le immagini personalizzate sono come le immagini di marketplace, ma si possono creare autonomamente. Le immagini personalizzate possono essere usate per l'avvio di attività di distribuzione, ad esempio il precaricamento e le configurazioni di applicazioni e altre configurazioni del sistema operativo. \n\nLa raccolta di immagini condivise consente di condividere le immagini di VM personalizzate con altri utenti dell'organizzazione, all'interno o tra aree, all'interno di un tenant di Azure AD. Scegliere le immagini che si intende condividere, le aree nelle quali si vuole renderle disponibili e i destinatari. È possibile creare più raccolte così da raggruppare in maniera logica le immagini condivise. \n\nLa raccolta è una risorsa di livello superiore che fornisce il controllo completo degli accessi in base al ruolo di Azure (RBAC di Azure). Le immagini possono essere con versioni ed è possibile scegliere di eseguire la replica di ogni versione dell'immagine in un diverso set di aree di Azure. La raccolta funziona solo con le immagini gestite.\n\nLa funzionalità di raccolta di immagini condivise presenta più tipi di risorse. Verranno usate o compilate le seguenti contenute in questo articolo:\n\n\n[!INCLUDE [virtual-machines-shared-image-gallery-resources](../../../includes/virtual-machines-shared-image-gallery-resources.md)]\n\n
\n\n\n\n\n\n## Prima di iniziare\n\nPer completare l'esempio in questo articolo, è necessario disporre di un'immagine gestita esistente di una macchina virtuale generalizzata o di uno snapshot di una macchina virtuale specializzata. È possibile seguire l' [esercitazione: creare un'immagine personalizzata di una macchina virtuale di Azure con Azure PowerShell](tutorial-custom-images.md) per creare un'immagine gestita o [creare uno snapshot](../windows/snapshot-copy-managed-disk.md) per una macchina virtuale specializzata. Per le immagini e gli snapshot gestiti, le dimensioni del disco dati non possono superare 1 TB.\n\nQuando si esegue l'esercitazione, sostituire i nomi del gruppo di risorse e delle macchine virtuali dove necessario.\n\n \n[!INCLUDE [virtual-machines-common-shared-images-portal](../../../includes/virtual-machines-common-shared-images-portal.md)]\n\n## Creare VM \n\nA questo punto è possibile creare una o più nuove macchine virtuali. Questo esempio crea una VM denominata *myVMfromImage* in *myResourceGroup* nel datacenter *Stati Uniti orientali*.\n\n1. Passare alla definizione dell'immagine. È possibile usare il filtro delle risorse per mostrare tutte le definizioni di immagine disponibili.\n1. Nella pagina relativa alla definizione dell'immagine selezionare **Crea macchina virtuale** dal menu nella parte superiore della pagina.\n1. Per **gruppo di risorse** selezionare **Crea nuovo** e digitare *myResourceGroup* per nome.\n1. In **nome macchina virtuale** digitare *myVM*.\n1. In **Area** selezionare *Stati Uniti orientali*.\n1. Per le **Opzioni di disponibilità**, lasciare l'impostazione predefinita *nessuna ridondanza dell'infrastruttura richiesta*.\n1. Il valore per **Image** viene compilato automaticamente con la `latest` versione dell'immagine se è stato avviato dalla pagina per la definizione dell'immagine.\n1. Per **dimensione** scegliere una dimensione di macchina virtuale dall'elenco delle dimensioni disponibili, quindi scegliere **Seleziona**.\n1. In **account amministratore**, se la VM di origine è stata generalizzata, immettere il **nome utente** e la **chiave pubblica SSH**. Se la macchina virtuale di origine è specializzata, queste opzioni verranno disattivate perché vengono usate le informazioni della VM di origine.\n1. Se si vuole consentire l'accesso remoto alla macchina virtuale, in **porte in ingresso pubbliche** scegliere **Consenti porte selezionate** , quindi selezionare **SSH (22)** nell'elenco a discesa. Se non si vuole consentire l'accesso remoto alla macchina virtuale, lasciare selezionata l'opzione **Nessuna** per le **porte in ingresso pubbliche**.\n1. Al termine, selezionare il pulsante **Verifica e crea** nella parte inferiore della pagina.\n1. Dopo che la macchina virtuale ha superato la convalida, selezionare **Crea** nella parte inferiore della pagina per avviare la distribuzione.\n\n\n## Pulire le risorse\n\nQuando non servono più, è possibile eliminare il gruppo di risorse, la macchina virtuale e tutte le risorse correlate. A tale scopo, selezionare il gruppo di risorse per la macchina virtuale, selezionare **Elimina** e quindi confermare il nome del gruppo di risorse da eliminare.\n\nSe si desidera eliminare singole risorse, è necessario eliminarle in ordine inverso. Per eliminare la definizione di un'immagine, ad esempio, è necessario eliminare tutte le versioni di immagine create da tale immagine.\n\n## Passaggi successivi\n\nÈ anche possibile creare una risorsa di raccolta di immagini condivise usando i modelli. Sono disponibili diversi modelli di avvio rapido di Azure: \n\n- [Creare una raccolta di immagini condivise](https://azure.microsoft.com/resources/templates/101-sig-create/)\n- [Creare una definizione dell'immagine in una raccolta di immagini condivise](https://azure.microsoft.com/resources/templates/101-sig-image-definition-create/)\n- [Creare una versione dell'immagine in una raccolta di immagini condivise](https://azure.microsoft.com/resources/templates/101-sig-image-version-create/)\n- [Creare una macchina virtuale dalla versione dell'immagine](https://azure.microsoft.com/resources/templates/101-vm-from-sig/)\n\nPer altre informazioni sulle raccolte di immagini condivise, vedere [Panoramica](shared-image-galleries.md). Se si verificano problemi, vedere [Risoluzione dei problemi delle raccolte di immagini condivise](../troubleshooting-shared-images.md).\n\n"},"avg_line_length":{"kind":"number","value":80.9638554217,"string":"80.963855"},"max_line_length":{"kind":"number","value":586,"string":"586"},"alphanum_fraction":{"kind":"number","value":0.8022321429,"string":"0.802232"},"lid":{"kind":"string","value":"ita_Latn"},"lid_prob":{"kind":"number","value":0.9990338087081909,"string":"0.999034"}}},{"rowIdx":3329,"cells":{"hexsha":{"kind":"string","value":"b9bdc4bda070687fcf543199131b561f231352af"},"size":{"kind":"number","value":1664,"string":"1,664"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"README.md"},"max_stars_repo_name":{"kind":"string","value":"Luz/sega-rom-reader"},"max_stars_repo_head_hexsha":{"kind":"string","value":"dd7bf1036cdeff4d0b48fcd3716d53bb1d091141"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"number","value":2,"string":"2"},"max_stars_repo_stars_event_min_datetime":{"kind":"string","value":"2018-10-10T21:12:20.000Z"},"max_stars_repo_stars_event_max_datetime":{"kind":"string","value":"2021-07-31T07:05:26.000Z"},"max_issues_repo_path":{"kind":"string","value":"README.md"},"max_issues_repo_name":{"kind":"string","value":"Luz/sega-rom-reader"},"max_issues_repo_head_hexsha":{"kind":"string","value":"dd7bf1036cdeff4d0b48fcd3716d53bb1d091141"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"README.md"},"max_forks_repo_name":{"kind":"string","value":"Luz/sega-rom-reader"},"max_forks_repo_head_hexsha":{"kind":"string","value":"dd7bf1036cdeff4d0b48fcd3716d53bb1d091141"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"# sega-rom-reader\nThis reader/writer for \"sega mega drive\" ROMs directly accesses the games by using the 5V-tolerant \"Teensy 3.5\".\n\n## Pictures of the reader:\nReader: Teensy 3.5 and the socket for the cartridge\n![reader](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic1.jpg)\n\nBottom side: made with wire wrap technology\n![wire-wrap](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic2.jpg)\n\nJumper: will be used later for the creation of a sega-game-programmer\n![jumper](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic3.jpg)\n\nROM: The first ROM that was read\n![first-rom](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic4.jpg)\n\nWire-Wrap pins: Close shot of two wire wrap connections\n![wire-wrap-pins](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic5.jpg)\n\nCartridge pcb: This socket was not able to reliably hold an EEPROM\n![cartridge-bad-socket](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic6.jpg)\n\nCartridge with 27C322: PCB still needs to be tested, but some bytes were already written\n![cartridge-with-27c322](https://raw.githubusercontent.com/Luz/sega-rom-reader/master/pics/pic7.jpg)\n\n## TODO\n* Since a ROM can be less than 4MB and the reader currently reads 4MB (21 adress lines at 2 bytes), a 2MB file will be read duplicated. Detect duplications and remove that unnecessary data.\n\n* Add a button to easily read more than just one ROM\n\n* Add a description of the programming ability\n\n* Describe: BE/LE (endianess) and compare it to the \"interleaved\" *.smd files\n\n* Maybe add a function to swap the bytes to the *.smd format\n\n"},"avg_line_length":{"kind":"number","value":44.972972973,"string":"44.972973"},"max_line_length":{"kind":"number","value":189,"string":"189"},"alphanum_fraction":{"kind":"number","value":0.7728365385,"string":"0.772837"},"lid":{"kind":"string","value":"eng_Latn"},"lid_prob":{"kind":"number","value":0.9287485480308533,"string":"0.928749"}}},{"rowIdx":3330,"cells":{"hexsha":{"kind":"string","value":"b9be2c70557d875204ac6fc9ae7e9ba05f9d8f6f"},"size":{"kind":"number","value":4098,"string":"4,098"},"ext":{"kind":"string","value":"md"},"lang":{"kind":"string","value":"Markdown"},"max_stars_repo_path":{"kind":"string","value":"_posts/2022-03-14-docker5.md"},"max_stars_repo_name":{"kind":"string","value":"KHmyung/khmyung.github.io"},"max_stars_repo_head_hexsha":{"kind":"string","value":"1e449a11d1ad12e4743db1496c909201bf114871"},"max_stars_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_stars_count":{"kind":"null"},"max_stars_repo_stars_event_min_datetime":{"kind":"null"},"max_stars_repo_stars_event_max_datetime":{"kind":"null"},"max_issues_repo_path":{"kind":"string","value":"_posts/2022-03-14-docker5.md"},"max_issues_repo_name":{"kind":"string","value":"KHmyung/khmyung.github.io"},"max_issues_repo_head_hexsha":{"kind":"string","value":"1e449a11d1ad12e4743db1496c909201bf114871"},"max_issues_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_issues_count":{"kind":"null"},"max_issues_repo_issues_event_min_datetime":{"kind":"null"},"max_issues_repo_issues_event_max_datetime":{"kind":"null"},"max_forks_repo_path":{"kind":"string","value":"_posts/2022-03-14-docker5.md"},"max_forks_repo_name":{"kind":"string","value":"KHmyung/khmyung.github.io"},"max_forks_repo_head_hexsha":{"kind":"string","value":"1e449a11d1ad12e4743db1496c909201bf114871"},"max_forks_repo_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"max_forks_count":{"kind":"null"},"max_forks_repo_forks_event_min_datetime":{"kind":"null"},"max_forks_repo_forks_event_max_datetime":{"kind":"null"},"content":{"kind":"string","value":"---\npublished: true\ntitle: \"[Docker] 5. Docker 커맨드 종류\"\nlayout: single\ncategory: container\ntag: [container, virtualization, docker]\ntoc: true\n---\n\n## Docker 커맨드의 종류\n\n이 포스팅에서는 도커에서 지원하는 기본 커맨드 종류를 우선 알아보고, 다음으로 핵심 기능인 컨테이너 실행(`docker run`) 옵션을 알아본다.\n\n### 기본 커맨드 종류\n\n아래는 도커에서 지원하는 커맨드의 종류를 정리한 것이다. 각 커맨드에서 지원하는 세부옵션 및 필드정보는 커맨드라인에서 `--help` 플래그를 통해 확인할 수 있다.\n\n| 커맨드 종류 | 설명 |\n| :----------------------------------------------------------- | :--------------------------------------------: |\n| docker **images** | 도커 이미지 종류를 조회 |\n| docker **run** <*options*> <*image*> <*command*> <*arguments*> | 도커 이미지를 컨테이너로 실행 |\n| docker **ps** | 컨테이너 목록 조회 |\n| docker **commit** <*container_name*> <*new_image_name*> | 컨테이너를 새로운 이미지로 생성 |\n| docker **attach** <*container_name*> | detached 모드로 실행 중인 컨테이너에 연결 |\n| docker **exec** <*container_name*> <*command*> | 실행 중인 컨테이너에 명령어 실행 |\n| docker **logs** <*container_name*> | 컨테이너 로그 출력 |\n| docker **start** <*container_name*> | 정지된 컨테이너 실행 |\n| docker **stop** <*container_name*> | 컨테이너를 종료 (gracefully) |\n| docker **kill** <*container_name*> | 컨테이너를 즉각 중단 (forcely) |\n| docker **rm** <*container_name*> | 실행 중이 아닌 컨테이너를 삭제 |\n| docker **rmi** <*image_name*> | 이미지를 삭제 |\n| docker **port** <*container_name*> | 실행 중인 컨테이너의 포트번호 조회 |\n| docker **network** *create* <*network_name*> | 호스트 내에 컨테이너를 위한 가상 네트워크 생성 |\n| docker **network** *connect/disconnect* <*container_name*> <*network_name*> | 컨테이너를 네트워크에 연결시킴 |\n| docker **build** -f /*path*/*Dockerfile* -t <*result_name*> | 도커파일을 통해 이미지를 빌드하고 태그 |\n| docker **inspect** <*options*> <*container_name*> | 컨테이너에서 지정된 포맷의 세부정보를 출력 |\n| docker **update** <*options*> <*container_name*> | 실행 중인 컨테이너의 리소스 제한 업데이트 |\n\n### 컨테이너 실행 옵션\n\n`docker run` 의 기본 포맷은 다음과 같다. 여기서 이미지 이름은 필수 옵션으로, 필요에 따라 레지스트리와 태그명을 포함해준다.\n\n```bash\ndocker run (