{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \nOutput:Before clicking the link:After clicking the link:\nFor Multiple Recipient:Syntax:\n Text \nExample:\n Create button to open SMS compose to a phone number

Send text to multiple recipients:

Send a SMS \nOutput:Before clicking the link:After clicking the link:\nHTML-Misc\nHTML\nWeb Technologies\nWeb technologies Questions\nHTML\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nREST API (Introduction)\nDesign a Tribute Page using HTML & CSS\nBuild a Survey Form using HTML and CSS\nDesign a web page using HTML and CSS\nAngular File Upload\nInstallation of Node.js on Linux\nDifference between var, let and const keywords in JavaScript\nHow to fetch data from an API in ReactJS ?\nDifferences between Functional Components and Class Components in React\nRemove elements from a JavaScript Array"},"parsed":{"kind":"list like","value":[{"code":null,"e":53,"s":25,"text":"\n08 Jun, 2020"},{"code":null,"e":352,"s":53,"text":"Sometimes, when you search for a number on the web, you might want to SMS to it directly from the web page instead of noting it down and then messaging to it. It becomes quite convenient for the user. Making an SMS link is very easy in HTML. Here, we will see how to make the SMS link on a webpage."},{"code":null,"e":545,"s":352,"text":"Approach: Using href attribute: Enter the phone number in place of the URL and add sms: before it to make an SMS link. Add the text between the tags that will appear as the clickable link."},{"code":null,"e":574,"s":545,"text":"For Single Recipient:Syntax:"},{"code":null,"e":621,"s":574,"text":" Text "},{"code":null,"e":630,"s":621,"text":"Example:"},{"code":" Create button to open SMS compose to a phone number

For any queries you can text us at the below number:

+91-123-4567-890 ","e":934,"s":630,"text":null},{"code":null,"e":991,"s":934,"text":"Output:Before clicking the link:After clicking the link:"},{"code":null,"e":1022,"s":991,"text":"For Multiple Recipient:Syntax:"},{"code":null,"e":1103,"s":1022,"text":" Text "},{"code":null,"e":1112,"s":1103,"text":"Example:"},{"code":" Create button to open SMS compose to a phone number

Send text to multiple recipients:

Send a SMS ","e":1413,"s":1112,"text":null},{"code":null,"e":1470,"s":1413,"text":"Output:Before clicking the link:After clicking the link:"},{"code":null,"e":1480,"s":1470,"text":"HTML-Misc"},{"code":null,"e":1485,"s":1480,"text":"HTML"},{"code":null,"e":1502,"s":1485,"text":"Web Technologies"},{"code":null,"e":1529,"s":1502,"text":"Web technologies Questions"},{"code":null,"e":1534,"s":1529,"text":"HTML"},{"code":null,"e":1632,"s":1534,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":1656,"s":1632,"text":"REST API (Introduction)"},{"code":null,"e":1695,"s":1656,"text":"Design a Tribute Page using HTML & CSS"},{"code":null,"e":1734,"s":1695,"text":"Build a Survey Form using HTML and CSS"},{"code":null,"e":1771,"s":1734,"text":"Design a web page using HTML and CSS"},{"code":null,"e":1791,"s":1771,"text":"Angular File Upload"},{"code":null,"e":1824,"s":1791,"text":"Installation of Node.js on Linux"},{"code":null,"e":1885,"s":1824,"text":"Difference between var, let and const keywords in JavaScript"},{"code":null,"e":1928,"s":1885,"text":"How to fetch data from an API in ReactJS ?"},{"code":null,"e":2000,"s":1928,"text":"Differences between Functional Components and Class Components in React"}],"string":"[\n {\n \"code\": null,\n \"e\": 53,\n \"s\": 25,\n \"text\": \"\\n08 Jun, 2020\"\n },\n {\n \"code\": null,\n \"e\": 352,\n \"s\": 53,\n \"text\": \"Sometimes, when you search for a number on the web, you might want to SMS to it directly from the web page instead of noting it down and then messaging to it. It becomes quite convenient for the user. Making an SMS link is very easy in HTML. Here, we will see how to make the SMS link on a webpage.\"\n },\n {\n \"code\": null,\n \"e\": 545,\n \"s\": 352,\n \"text\": \"Approach: Using href attribute: Enter the phone number in place of the URL and add sms: before it to make an SMS link. Add the text between the tags that will appear as the clickable link.\"\n },\n {\n \"code\": null,\n \"e\": 574,\n \"s\": 545,\n \"text\": \"For Single Recipient:Syntax:\"\n },\n {\n \"code\": null,\n \"e\": 621,\n \"s\": 574,\n \"text\": \" Text \"\n },\n {\n \"code\": null,\n \"e\": 630,\n \"s\": 621,\n \"text\": \"Example:\"\n },\n {\n \"code\": \" Create button to open SMS compose to a phone number

For any queries you can text us at the below number:

+91-123-4567-890 \",\n \"e\": 934,\n \"s\": 630,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 991,\n \"s\": 934,\n \"text\": \"Output:Before clicking the link:After clicking the link:\"\n },\n {\n \"code\": null,\n \"e\": 1022,\n \"s\": 991,\n \"text\": \"For Multiple Recipient:Syntax:\"\n },\n {\n \"code\": null,\n \"e\": 1103,\n \"s\": 1022,\n \"text\": \" Text \"\n },\n {\n \"code\": null,\n \"e\": 1112,\n \"s\": 1103,\n \"text\": \"Example:\"\n },\n {\n \"code\": \" Create button to open SMS compose to a phone number

Send text to multiple recipients:

Send a SMS \",\n \"e\": 1413,\n \"s\": 1112,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1470,\n \"s\": 1413,\n \"text\": \"Output:Before clicking the link:After clicking the link:\"\n },\n {\n \"code\": null,\n \"e\": 1480,\n \"s\": 1470,\n \"text\": \"HTML-Misc\"\n },\n {\n \"code\": null,\n \"e\": 1485,\n \"s\": 1480,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 1502,\n \"s\": 1485,\n \"text\": \"Web Technologies\"\n },\n {\n \"code\": null,\n \"e\": 1529,\n \"s\": 1502,\n \"text\": \"Web technologies Questions\"\n },\n {\n \"code\": null,\n \"e\": 1534,\n \"s\": 1529,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 1632,\n \"s\": 1534,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 1656,\n \"s\": 1632,\n \"text\": \"REST API (Introduction)\"\n },\n {\n \"code\": null,\n \"e\": 1695,\n \"s\": 1656,\n \"text\": \"Design a Tribute Page using HTML & CSS\"\n },\n {\n \"code\": null,\n \"e\": 1734,\n \"s\": 1695,\n \"text\": \"Build a Survey Form using HTML and CSS\"\n },\n {\n \"code\": null,\n \"e\": 1771,\n \"s\": 1734,\n \"text\": \"Design a web page using HTML and CSS\"\n },\n {\n \"code\": null,\n \"e\": 1791,\n \"s\": 1771,\n \"text\": \"Angular File Upload\"\n },\n {\n \"code\": null,\n \"e\": 1824,\n \"s\": 1791,\n \"text\": \"Installation of Node.js on Linux\"\n },\n {\n \"code\": null,\n \"e\": 1885,\n \"s\": 1824,\n \"text\": \"Difference between var, let and const keywords in JavaScript\"\n },\n {\n \"code\": null,\n \"e\": 1928,\n \"s\": 1885,\n \"text\": \"How to fetch data from an API in ReactJS ?\"\n },\n {\n \"code\": null,\n \"e\": 2000,\n \"s\": 1928,\n \"text\": \"Differences between Functional Components and Class Components in React\"\n }\n]"}}},{"rowIdx":75713,"cells":{"title":{"kind":"string","value":"Python | Carousel Widget In Kivy using .kv file"},"text":{"kind":"string","value":"12 Apr, 2022\nKivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.\n???????? Kivy Tutorial – Learn Kivy with Examples.\nThe Carousel widget provides the classic mobile-friendly carousel view where you can swipe between slides. You can add any content to the carousel and have it move horizontally or vertically. The carousel can display pages in a sequence or a loop. To work with this widget you must have to import:\nfrom kivy.uix.carousel import Carousel\nBasic Approach:\n1) import kivy\n2) import kivy App\n3) import Gridlayout\n4) import Carousel\n5) set minimum version(optional)\n6) Create as much as widget class as needed\n7) create the App class\n8) return the widget/layout etc class\n9) Create Carousel.kv file:\n 1) Create button( or what is needed)\n 2) Arrange the on_release / on_press function\n10) Run an instance of the class\nIn the below example we are creating the buttons in the App. In this we used load_previous() and load_next() functions.\nload_next(mode=’next’) Animate to the next slide. load_previous() Animate to the previous slide.\nImplementation of the Approach: main.py file: \nPython3\n# Program to explain how to add carousel in kivy # import kivy module import kivy # base Class of your App inherits from the App class. # app:always refers to the instance of your application from kivy.app import App # this restrict the kivy version i.e # below this kivy version you cannot # use the app or software kivy.require('1.9.0') # The Carousel widget provides the# classic mobile-friendly carousel# view where you can swipe between slidesfrom kivy.uix.carousel import Carousel # The GridLayout arranges children in a matrix.# It takes the available space and# divides it into columns and rows,# then adds widgets to the resulting “cells”.from kivy.uix.gridlayout import GridLayout # Create the Layout Classclass Carousel(GridLayout): pass # Create the App classclass CarouselApp(App): def build(self): # Set carousel widget as root root = Carousel() # for multiple pages for x in range(10): root.add_widget(Carousel()) return root # run the Appif __name__ == '__main__': CarouselApp().run()\nCarousel.kv file: \nPython3\n# Carousel.kv file of the code # Carousel Creation: rows: 2 # It shows the id which is different for different pages Label: text: str(id(root)) # This button will take you directly to the 3rd page Button text: 'load(page 3)' on_release: carousel = root.parent.parent carousel.load_slide(carousel.slides[2]) # load_previous() is used to go back to previous page Button text: 'prev' on_release: root.parent.parent.load_previous() # load_next() is used to go to next page Button text: 'next' on_release: root.parent.parent.load_next()\nOutput: \nManasChhabra2\narorakashish0911\nsimranarora5sos\nPython-gui\nPython-kivy\nPython\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nHow to Install PIP on Windows ?\nPython Classes and Objects\nPython OOPs Concepts\nIntroduction To PYTHON\nHow to drop one or multiple columns in Pandas Dataframe\nPython | os.path.join() method\nCheck if element exists in list in Python\nHow To Convert Python Dictionary To JSON?\nPython | Get unique values from a list\nPython | datetime.timedelta() function"},"parsed":{"kind":"list like","value":[{"code":null,"e":28,"s":0,"text":"\n12 Apr, 2022"},{"code":null,"e":265,"s":28,"text":"Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications."},{"code":null,"e":316,"s":265,"text":"???????? Kivy Tutorial – Learn Kivy with Examples."},{"code":null,"e":614,"s":316,"text":"The Carousel widget provides the classic mobile-friendly carousel view where you can swipe between slides. You can add any content to the carousel and have it move horizontally or vertically. The carousel can display pages in a sequence or a loop. To work with this widget you must have to import:"},{"code":null,"e":653,"s":614,"text":"from kivy.uix.carousel import Carousel"},{"code":null,"e":1042,"s":653,"text":"Basic Approach:\n1) import kivy\n2) import kivy App\n3) import Gridlayout\n4) import Carousel\n5) set minimum version(optional)\n6) Create as much as widget class as needed\n7) create the App class\n8) return the widget/layout etc class\n9) Create Carousel.kv file:\n 1) Create button( or what is needed)\n 2) Arrange the on_release / on_press function\n10) Run an instance of the class"},{"code":null,"e":1162,"s":1042,"text":"In the below example we are creating the buttons in the App. In this we used load_previous() and load_next() functions."},{"code":null,"e":1259,"s":1162,"text":"load_next(mode=’next’) Animate to the next slide. load_previous() Animate to the previous slide."},{"code":null,"e":1306,"s":1259,"text":"Implementation of the Approach: main.py file: "},{"code":null,"e":1314,"s":1306,"text":"Python3"},{"code":"# Program to explain how to add carousel in kivy # import kivy module import kivy # base Class of your App inherits from the App class. # app:always refers to the instance of your application from kivy.app import App # this restrict the kivy version i.e # below this kivy version you cannot # use the app or software kivy.require('1.9.0') # The Carousel widget provides the# classic mobile-friendly carousel# view where you can swipe between slidesfrom kivy.uix.carousel import Carousel # The GridLayout arranges children in a matrix.# It takes the available space and# divides it into columns and rows,# then adds widgets to the resulting “cells”.from kivy.uix.gridlayout import GridLayout # Create the Layout Classclass Carousel(GridLayout): pass # Create the App classclass CarouselApp(App): def build(self): # Set carousel widget as root root = Carousel() # for multiple pages for x in range(10): root.add_widget(Carousel()) return root # run the Appif __name__ == '__main__': CarouselApp().run()","e":2390,"s":1314,"text":null},{"code":null,"e":2409,"s":2390,"text":"Carousel.kv file: "},{"code":null,"e":2417,"s":2409,"text":"Python3"},{"code":"# Carousel.kv file of the code # Carousel Creation: rows: 2 # It shows the id which is different for different pages Label: text: str(id(root)) # This button will take you directly to the 3rd page Button text: 'load(page 3)' on_release: carousel = root.parent.parent carousel.load_slide(carousel.slides[2]) # load_previous() is used to go back to previous page Button text: 'prev' on_release: root.parent.parent.load_previous() # load_next() is used to go to next page Button text: 'next' on_release: root.parent.parent.load_next()","e":3087,"s":2417,"text":null},{"code":null,"e":3096,"s":3087,"text":"Output: "},{"code":null,"e":3110,"s":3096,"text":"ManasChhabra2"},{"code":null,"e":3127,"s":3110,"text":"arorakashish0911"},{"code":null,"e":3143,"s":3127,"text":"simranarora5sos"},{"code":null,"e":3154,"s":3143,"text":"Python-gui"},{"code":null,"e":3166,"s":3154,"text":"Python-kivy"},{"code":null,"e":3173,"s":3166,"text":"Python"},{"code":null,"e":3271,"s":3173,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":3303,"s":3271,"text":"How to Install PIP on Windows ?"},{"code":null,"e":3330,"s":3303,"text":"Python Classes and Objects"},{"code":null,"e":3351,"s":3330,"text":"Python OOPs Concepts"},{"code":null,"e":3374,"s":3351,"text":"Introduction To PYTHON"},{"code":null,"e":3430,"s":3374,"text":"How to drop one or multiple columns in Pandas Dataframe"},{"code":null,"e":3461,"s":3430,"text":"Python | os.path.join() method"},{"code":null,"e":3503,"s":3461,"text":"Check if element exists in list in Python"},{"code":null,"e":3545,"s":3503,"text":"How To Convert Python Dictionary To JSON?"},{"code":null,"e":3584,"s":3545,"text":"Python | Get unique values from a list"}],"string":"[\n {\n \"code\": null,\n \"e\": 28,\n \"s\": 0,\n \"text\": \"\\n12 Apr, 2022\"\n },\n {\n \"code\": null,\n \"e\": 265,\n \"s\": 28,\n \"text\": \"Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.\"\n },\n {\n \"code\": null,\n \"e\": 316,\n \"s\": 265,\n \"text\": \"???????? Kivy Tutorial – Learn Kivy with Examples.\"\n },\n {\n \"code\": null,\n \"e\": 614,\n \"s\": 316,\n \"text\": \"The Carousel widget provides the classic mobile-friendly carousel view where you can swipe between slides. You can add any content to the carousel and have it move horizontally or vertically. The carousel can display pages in a sequence or a loop. To work with this widget you must have to import:\"\n },\n {\n \"code\": null,\n \"e\": 653,\n \"s\": 614,\n \"text\": \"from kivy.uix.carousel import Carousel\"\n },\n {\n \"code\": null,\n \"e\": 1042,\n \"s\": 653,\n \"text\": \"Basic Approach:\\n1) import kivy\\n2) import kivy App\\n3) import Gridlayout\\n4) import Carousel\\n5) set minimum version(optional)\\n6) Create as much as widget class as needed\\n7) create the App class\\n8) return the widget/layout etc class\\n9) Create Carousel.kv file:\\n 1) Create button( or what is needed)\\n 2) Arrange the on_release / on_press function\\n10) Run an instance of the class\"\n },\n {\n \"code\": null,\n \"e\": 1162,\n \"s\": 1042,\n \"text\": \"In the below example we are creating the buttons in the App. In this we used load_previous() and load_next() functions.\"\n },\n {\n \"code\": null,\n \"e\": 1259,\n \"s\": 1162,\n \"text\": \"load_next(mode=’next’) Animate to the next slide. load_previous() Animate to the previous slide.\"\n },\n {\n \"code\": null,\n \"e\": 1306,\n \"s\": 1259,\n \"text\": \"Implementation of the Approach: main.py file: \"\n },\n {\n \"code\": null,\n \"e\": 1314,\n \"s\": 1306,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# Program to explain how to add carousel in kivy # import kivy module import kivy # base Class of your App inherits from the App class. # app:always refers to the instance of your application from kivy.app import App # this restrict the kivy version i.e # below this kivy version you cannot # use the app or software kivy.require('1.9.0') # The Carousel widget provides the# classic mobile-friendly carousel# view where you can swipe between slidesfrom kivy.uix.carousel import Carousel # The GridLayout arranges children in a matrix.# It takes the available space and# divides it into columns and rows,# then adds widgets to the resulting “cells”.from kivy.uix.gridlayout import GridLayout # Create the Layout Classclass Carousel(GridLayout): pass # Create the App classclass CarouselApp(App): def build(self): # Set carousel widget as root root = Carousel() # for multiple pages for x in range(10): root.add_widget(Carousel()) return root # run the Appif __name__ == '__main__': CarouselApp().run()\",\n \"e\": 2390,\n \"s\": 1314,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 2409,\n \"s\": 2390,\n \"text\": \"Carousel.kv file: \"\n },\n {\n \"code\": null,\n \"e\": 2417,\n \"s\": 2409,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# Carousel.kv file of the code # Carousel Creation: rows: 2 # It shows the id which is different for different pages Label: text: str(id(root)) # This button will take you directly to the 3rd page Button text: 'load(page 3)' on_release: carousel = root.parent.parent carousel.load_slide(carousel.slides[2]) # load_previous() is used to go back to previous page Button text: 'prev' on_release: root.parent.parent.load_previous() # load_next() is used to go to next page Button text: 'next' on_release: root.parent.parent.load_next()\",\n \"e\": 3087,\n \"s\": 2417,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 3096,\n \"s\": 3087,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 3110,\n \"s\": 3096,\n \"text\": \"ManasChhabra2\"\n },\n {\n \"code\": null,\n \"e\": 3127,\n \"s\": 3110,\n \"text\": \"arorakashish0911\"\n },\n {\n \"code\": null,\n \"e\": 3143,\n \"s\": 3127,\n \"text\": \"simranarora5sos\"\n },\n {\n \"code\": null,\n \"e\": 3154,\n \"s\": 3143,\n \"text\": \"Python-gui\"\n },\n {\n \"code\": null,\n \"e\": 3166,\n \"s\": 3154,\n \"text\": \"Python-kivy\"\n },\n {\n \"code\": null,\n \"e\": 3173,\n \"s\": 3166,\n \"text\": \"Python\"\n },\n {\n \"code\": null,\n \"e\": 3271,\n \"s\": 3173,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 3303,\n \"s\": 3271,\n \"text\": \"How to Install PIP on Windows ?\"\n },\n {\n \"code\": null,\n \"e\": 3330,\n \"s\": 3303,\n \"text\": \"Python Classes and Objects\"\n },\n {\n \"code\": null,\n \"e\": 3351,\n \"s\": 3330,\n \"text\": \"Python OOPs Concepts\"\n },\n {\n \"code\": null,\n \"e\": 3374,\n \"s\": 3351,\n \"text\": \"Introduction To PYTHON\"\n },\n {\n \"code\": null,\n \"e\": 3430,\n \"s\": 3374,\n \"text\": \"How to drop one or multiple columns in Pandas Dataframe\"\n },\n {\n \"code\": null,\n \"e\": 3461,\n \"s\": 3430,\n \"text\": \"Python | os.path.join() method\"\n },\n {\n \"code\": null,\n \"e\": 3503,\n \"s\": 3461,\n \"text\": \"Check if element exists in list in Python\"\n },\n {\n \"code\": null,\n \"e\": 3545,\n \"s\": 3503,\n \"text\": \"How To Convert Python Dictionary To JSON?\"\n },\n {\n \"code\": null,\n \"e\": 3584,\n \"s\": 3545,\n \"text\": \"Python | Get unique values from a list\"\n }\n]"}}},{"rowIdx":75714,"cells":{"title":{"kind":"string","value":"How to set vertical alignment in Bootstrap ?"},"text":{"kind":"string","value":"30 Nov, 2021\nVertical Alignment changes the alignment of elements vertically with the help of vertical-alignment utilities. The vertical-align utilities only affect inline(Present in one Line), inline-block(Present as blocks in one line), inline-table, and table cell(Elements in a cell of a table) elements. Vertical Alignment of div is one of the most basic requirements of a responsive web page. This can be achieved through CSS but the Bootstrap library has some classes specifically built for this purpose. In this article, we will learn the available classes & methods used for vertical-align in Bootstrap. Please refer to Vertical alignment in Bootstrap with Examples for other vertical-align classes.\nHere, we will discuss 2 built-in classes:\nUsing class align-items-center\nUsing class d-flex with class align-items-center\nLet’s understand both the classes through examples.\nMethod 1: Using class align-items-center\nIn Bootstrap 5, if we want to vertically align an
element in the center, we can do this by applying the class align-items-center on the containing element of that div.\nExample:\nHTML\n

GeeksforGeeks

\nOutput:\nMethod 2: Using class d-flex with class align-items-center\nIn Bootstrap 5, if we want to vertically align an
element in the middle of a containing element, we can do this by applying the class align-items-center and d-flex on the containing element of that div. Here, the d-flex class has the same effect as that of the display: flex; property in CSS.\nExample:\nHTML\n

GeeksforGeeks

\nOutput:\nnnr223442\nBootstrap-Questions\nPicked\nBootstrap\nHTML\nWeb Technologies\nHTML\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nHow to Show Images on Click using HTML ?\nHow to Use Bootstrap with React?\nTailwind CSS vs Bootstrap\nHow to toggle password visibility in forms using Bootstrap-icons ?\nHow to place table text into center using Bootstrap?\nHow to update Node.js and NPM to next version ?\nTop 10 Projects For Beginners To Practice HTML and CSS Skills\nHow to insert spaces/tabs in text using HTML/CSS?\nREST API (Introduction)\nHide or show elements in HTML using display property"},"parsed":{"kind":"list like","value":[{"code":null,"e":54,"s":26,"text":"\n30 Nov, 2021"},{"code":null,"e":750,"s":54,"text":"Vertical Alignment changes the alignment of elements vertically with the help of vertical-alignment utilities. The vertical-align utilities only affect inline(Present in one Line), inline-block(Present as blocks in one line), inline-table, and table cell(Elements in a cell of a table) elements. Vertical Alignment of div is one of the most basic requirements of a responsive web page. This can be achieved through CSS but the Bootstrap library has some classes specifically built for this purpose. In this article, we will learn the available classes & methods used for vertical-align in Bootstrap. Please refer to Vertical alignment in Bootstrap with Examples for other vertical-align classes."},{"code":null,"e":792,"s":750,"text":"Here, we will discuss 2 built-in classes:"},{"code":null,"e":823,"s":792,"text":"Using class align-items-center"},{"code":null,"e":872,"s":823,"text":"Using class d-flex with class align-items-center"},{"code":null,"e":924,"s":872,"text":"Let’s understand both the classes through examples."},{"code":null,"e":965,"s":924,"text":"Method 1: Using class align-items-center"},{"code":null,"e":1139,"s":965,"text":"In Bootstrap 5, if we want to vertically align an
element in the center, we can do this by applying the class align-items-center on the containing element of that div."},{"code":null,"e":1148,"s":1139,"text":"Example:"},{"code":null,"e":1153,"s":1148,"text":"HTML"},{"code":"

GeeksforGeeks

","e":1975,"s":1153,"text":null},{"code":null,"e":1983,"s":1975,"text":"Output:"},{"code":null,"e":2042,"s":1983,"text":"Method 2: Using class d-flex with class align-items-center"},{"code":null,"e":2341,"s":2042,"text":"In Bootstrap 5, if we want to vertically align an
element in the middle of a containing element, we can do this by applying the class align-items-center and d-flex on the containing element of that div. Here, the d-flex class has the same effect as that of the display: flex; property in CSS."},{"code":null,"e":2350,"s":2341,"text":"Example:"},{"code":null,"e":2355,"s":2350,"text":"HTML"},{"code":"

GeeksforGeeks

","e":3109,"s":2355,"text":null},{"code":null,"e":3117,"s":3109,"text":"Output:"},{"code":null,"e":3127,"s":3117,"text":"nnr223442"},{"code":null,"e":3147,"s":3127,"text":"Bootstrap-Questions"},{"code":null,"e":3154,"s":3147,"text":"Picked"},{"code":null,"e":3164,"s":3154,"text":"Bootstrap"},{"code":null,"e":3169,"s":3164,"text":"HTML"},{"code":null,"e":3186,"s":3169,"text":"Web Technologies"},{"code":null,"e":3191,"s":3186,"text":"HTML"},{"code":null,"e":3289,"s":3191,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":3330,"s":3289,"text":"How to Show Images on Click using HTML ?"},{"code":null,"e":3363,"s":3330,"text":"How to Use Bootstrap with React?"},{"code":null,"e":3389,"s":3363,"text":"Tailwind CSS vs Bootstrap"},{"code":null,"e":3456,"s":3389,"text":"How to toggle password visibility in forms using Bootstrap-icons ?"},{"code":null,"e":3509,"s":3456,"text":"How to place table text into center using Bootstrap?"},{"code":null,"e":3557,"s":3509,"text":"How to update Node.js and NPM to next version ?"},{"code":null,"e":3619,"s":3557,"text":"Top 10 Projects For Beginners To Practice HTML and CSS Skills"},{"code":null,"e":3669,"s":3619,"text":"How to insert spaces/tabs in text using HTML/CSS?"},{"code":null,"e":3693,"s":3669,"text":"REST API (Introduction)"}],"string":"[\n {\n \"code\": null,\n \"e\": 54,\n \"s\": 26,\n \"text\": \"\\n30 Nov, 2021\"\n },\n {\n \"code\": null,\n \"e\": 750,\n \"s\": 54,\n \"text\": \"Vertical Alignment changes the alignment of elements vertically with the help of vertical-alignment utilities. The vertical-align utilities only affect inline(Present in one Line), inline-block(Present as blocks in one line), inline-table, and table cell(Elements in a cell of a table) elements. Vertical Alignment of div is one of the most basic requirements of a responsive web page. This can be achieved through CSS but the Bootstrap library has some classes specifically built for this purpose. In this article, we will learn the available classes & methods used for vertical-align in Bootstrap. Please refer to Vertical alignment in Bootstrap with Examples for other vertical-align classes.\"\n },\n {\n \"code\": null,\n \"e\": 792,\n \"s\": 750,\n \"text\": \"Here, we will discuss 2 built-in classes:\"\n },\n {\n \"code\": null,\n \"e\": 823,\n \"s\": 792,\n \"text\": \"Using class align-items-center\"\n },\n {\n \"code\": null,\n \"e\": 872,\n \"s\": 823,\n \"text\": \"Using class d-flex with class align-items-center\"\n },\n {\n \"code\": null,\n \"e\": 924,\n \"s\": 872,\n \"text\": \"Let’s understand both the classes through examples.\"\n },\n {\n \"code\": null,\n \"e\": 965,\n \"s\": 924,\n \"text\": \"Method 1: Using class align-items-center\"\n },\n {\n \"code\": null,\n \"e\": 1139,\n \"s\": 965,\n \"text\": \"In Bootstrap 5, if we want to vertically align an
element in the center, we can do this by applying the class align-items-center on the containing element of that div.\"\n },\n {\n \"code\": null,\n \"e\": 1148,\n \"s\": 1139,\n \"text\": \"Example:\"\n },\n {\n \"code\": null,\n \"e\": 1153,\n \"s\": 1148,\n \"text\": \"HTML\"\n },\n {\n \"code\": \"

GeeksforGeeks

\",\n \"e\": 1975,\n \"s\": 1153,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1983,\n \"s\": 1975,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 2042,\n \"s\": 1983,\n \"text\": \"Method 2: Using class d-flex with class align-items-center\"\n },\n {\n \"code\": null,\n \"e\": 2341,\n \"s\": 2042,\n \"text\": \"In Bootstrap 5, if we want to vertically align an
element in the middle of a containing element, we can do this by applying the class align-items-center and d-flex on the containing element of that div. Here, the d-flex class has the same effect as that of the display: flex; property in CSS.\"\n },\n {\n \"code\": null,\n \"e\": 2350,\n \"s\": 2341,\n \"text\": \"Example:\"\n },\n {\n \"code\": null,\n \"e\": 2355,\n \"s\": 2350,\n \"text\": \"HTML\"\n },\n {\n \"code\": \"

GeeksforGeeks

\",\n \"e\": 3109,\n \"s\": 2355,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 3117,\n \"s\": 3109,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 3127,\n \"s\": 3117,\n \"text\": \"nnr223442\"\n },\n {\n \"code\": null,\n \"e\": 3147,\n \"s\": 3127,\n \"text\": \"Bootstrap-Questions\"\n },\n {\n \"code\": null,\n \"e\": 3154,\n \"s\": 3147,\n \"text\": \"Picked\"\n },\n {\n \"code\": null,\n \"e\": 3164,\n \"s\": 3154,\n \"text\": \"Bootstrap\"\n },\n {\n \"code\": null,\n \"e\": 3169,\n \"s\": 3164,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 3186,\n \"s\": 3169,\n \"text\": \"Web Technologies\"\n },\n {\n \"code\": null,\n \"e\": 3191,\n \"s\": 3186,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 3289,\n \"s\": 3191,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 3330,\n \"s\": 3289,\n \"text\": \"How to Show Images on Click using HTML ?\"\n },\n {\n \"code\": null,\n \"e\": 3363,\n \"s\": 3330,\n \"text\": \"How to Use Bootstrap with React?\"\n },\n {\n \"code\": null,\n \"e\": 3389,\n \"s\": 3363,\n \"text\": \"Tailwind CSS vs Bootstrap\"\n },\n {\n \"code\": null,\n \"e\": 3456,\n \"s\": 3389,\n \"text\": \"How to toggle password visibility in forms using Bootstrap-icons ?\"\n },\n {\n \"code\": null,\n \"e\": 3509,\n \"s\": 3456,\n \"text\": \"How to place table text into center using Bootstrap?\"\n },\n {\n \"code\": null,\n \"e\": 3557,\n \"s\": 3509,\n \"text\": \"How to update Node.js and NPM to next version ?\"\n },\n {\n \"code\": null,\n \"e\": 3619,\n \"s\": 3557,\n \"text\": \"Top 10 Projects For Beginners To Practice HTML and CSS Skills\"\n },\n {\n \"code\": null,\n \"e\": 3669,\n \"s\": 3619,\n \"text\": \"How to insert spaces/tabs in text using HTML/CSS?\"\n },\n {\n \"code\": null,\n \"e\": 3693,\n \"s\": 3669,\n \"text\": \"REST API (Introduction)\"\n }\n]"}}},{"rowIdx":75715,"cells":{"title":{"kind":"string","value":"Namespaces in Ruby"},"text":{"kind":"string","value":"22 Oct, 2021\nA namespace is a container for multiple items which includes classes, constants, other modules, and more. It is ensured in a namespace that all the objects have unique names for easy identification. Generally, they are structured in a hierarchical format so, that names can be reused. \nNamespace in Ruby allows multiple structures to be written using hierarchical manner. Thus, one can reuse the names within the single main namespace.\nThe namespace in Ruby is defined by prefixing the keyword module in front of the namespace name.\nThe name of namespaces and classes always start from a capital letter.\nYou can access the sub members of double with the help of :: operator. It is also called the constant resolution operator.\nRuby allows nested namespace.\nYou can use include keyword to copy the other module’s objects into the existing namespace without qualifying their name.\nSyntax: \nmodule Namespace_name\n # modules.. and classes..\nend\nExample 1: This is an example of the simple formation of the namespace with a class and then executing the class methods defined within the class. Here, we access the sub members within the namespace, the “::” operator is used. It is also called the constant resolution operator. \nRuby\n# Ruby program to illustrate namespace # Defining a namespace called Geekmodule Geek class GeeksforGeeks # The variable gfg attr_reader :gfg # Class GeeksforGeeks constructor def initialize(value) @gfg = value end endend # Accessing the sub members of# module using '::' operatorobj = Geek::GeeksforGeeks.new(\"GeeksForGeeks\")puts obj.gfg\nOutput: \nGeeksForGeeks\nExample 2: This is an example showing the implementation of hierarchical namespacing. In this, there is a combination of class and namespace within the single namespace. Here, the use of the class name is done multiple times under the concept of hierarchical namespacing. \nRuby\n# Ruby program to illustrate namespace # The main namespacemodule Geek class GeeksforGeeks attr_reader :gfg def initialize(value) @gfg = value end end # Hierarchical namespace module Geek_1 # Reuse of the class names class GeeksforGeeks @@var = \"This is the module Geek_1 \" + \"and class GeeksforGeeks\" def printVar() puts @@var end end end # Hierarchical namespace module Geek_2 # Reuse of the class names class GeeksforGeeks attr_reader :var def initialize(var) @var = var end end end end obj_gfg = Geek::GeeksforGeeks.new(\"This is the module Geek \" + \"and class GeeksforGeeks\")obj_gfg1 = Geek::Geek_1::GeeksforGeeks.new()obj_gfg2 = Geek::Geek_2::GeeksforGeeks.new(\"This is the module Geek_2 \" + \"and class GeeksforGeeks\")puts obj_gfg.gfgputs obj_gfg1.printVar()puts obj_gfg2.var\nOutput: \nThis is the module Geek and class GeeksforGeeks\nThis is the module Geek_1 and class GeeksforGeeks\n\nThis is the module Geek_2 and class GeeksforGeeks\n \ngabaa406\nPicked\nRuby\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nHow to Make a Custom Array of Hashes in Ruby?\nRuby | Enumerator each_with_index function\nRuby | unless Statement and unless Modifier\nRuby | Array class find_index() operation\nRuby For Beginners\nRuby | String concat Method\nRuby | Types of Variables\nRuby on Rails Introduction\nRuby | Array shift() function"},"parsed":{"kind":"list like","value":[{"code":null,"e":28,"s":0,"text":"\n22 Oct, 2021"},{"code":null,"e":315,"s":28,"text":"A namespace is a container for multiple items which includes classes, constants, other modules, and more. It is ensured in a namespace that all the objects have unique names for easy identification. Generally, they are structured in a hierarchical format so, that names can be reused. "},{"code":null,"e":465,"s":315,"text":"Namespace in Ruby allows multiple structures to be written using hierarchical manner. Thus, one can reuse the names within the single main namespace."},{"code":null,"e":562,"s":465,"text":"The namespace in Ruby is defined by prefixing the keyword module in front of the namespace name."},{"code":null,"e":633,"s":562,"text":"The name of namespaces and classes always start from a capital letter."},{"code":null,"e":756,"s":633,"text":"You can access the sub members of double with the help of :: operator. It is also called the constant resolution operator."},{"code":null,"e":786,"s":756,"text":"Ruby allows nested namespace."},{"code":null,"e":908,"s":786,"text":"You can use include keyword to copy the other module’s objects into the existing namespace without qualifying their name."},{"code":null,"e":918,"s":908,"text":"Syntax: "},{"code":null,"e":974,"s":918,"text":"module Namespace_name\n # modules.. and classes..\nend"},{"code":null,"e":1256,"s":974,"text":"Example 1: This is an example of the simple formation of the namespace with a class and then executing the class methods defined within the class. Here, we access the sub members within the namespace, the “::” operator is used. It is also called the constant resolution operator. "},{"code":null,"e":1261,"s":1256,"text":"Ruby"},{"code":"# Ruby program to illustrate namespace # Defining a namespace called Geekmodule Geek class GeeksforGeeks # The variable gfg attr_reader :gfg # Class GeeksforGeeks constructor def initialize(value) @gfg = value end endend # Accessing the sub members of# module using '::' operatorobj = Geek::GeeksforGeeks.new(\"GeeksForGeeks\")puts obj.gfg","e":1667,"s":1261,"text":null},{"code":null,"e":1677,"s":1667,"text":"Output: "},{"code":null,"e":1691,"s":1677,"text":"GeeksForGeeks"},{"code":null,"e":1965,"s":1691,"text":"Example 2: This is an example showing the implementation of hierarchical namespacing. In this, there is a combination of class and namespace within the single namespace. Here, the use of the class name is done multiple times under the concept of hierarchical namespacing. "},{"code":null,"e":1970,"s":1965,"text":"Ruby"},{"code":"# Ruby program to illustrate namespace # The main namespacemodule Geek class GeeksforGeeks attr_reader :gfg def initialize(value) @gfg = value end end # Hierarchical namespace module Geek_1 # Reuse of the class names class GeeksforGeeks @@var = \"This is the module Geek_1 \" + \"and class GeeksforGeeks\" def printVar() puts @@var end end end # Hierarchical namespace module Geek_2 # Reuse of the class names class GeeksforGeeks attr_reader :var def initialize(var) @var = var end end end end obj_gfg = Geek::GeeksforGeeks.new(\"This is the module Geek \" + \"and class GeeksforGeeks\")obj_gfg1 = Geek::Geek_1::GeeksforGeeks.new()obj_gfg2 = Geek::Geek_2::GeeksforGeeks.new(\"This is the module Geek_2 \" + \"and class GeeksforGeeks\")puts obj_gfg.gfgputs obj_gfg1.printVar()puts obj_gfg2.var","e":3014,"s":1970,"text":null},{"code":null,"e":3024,"s":3014,"text":"Output: "},{"code":null,"e":3173,"s":3024,"text":"This is the module Geek and class GeeksforGeeks\nThis is the module Geek_1 and class GeeksforGeeks\n\nThis is the module Geek_2 and class GeeksforGeeks"},{"code":null,"e":3184,"s":3175,"text":"gabaa406"},{"code":null,"e":3191,"s":3184,"text":"Picked"},{"code":null,"e":3196,"s":3191,"text":"Ruby"},{"code":null,"e":3294,"s":3196,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":3340,"s":3294,"text":"How to Make a Custom Array of Hashes in Ruby?"},{"code":null,"e":3383,"s":3340,"text":"Ruby | Enumerator each_with_index function"},{"code":null,"e":3427,"s":3383,"text":"Ruby | unless Statement and unless Modifier"},{"code":null,"e":3469,"s":3427,"text":"Ruby | Array class find_index() operation"},{"code":null,"e":3488,"s":3469,"text":"Ruby For Beginners"},{"code":null,"e":3516,"s":3488,"text":"Ruby | String concat Method"},{"code":null,"e":3542,"s":3516,"text":"Ruby | Types of Variables"},{"code":null,"e":3569,"s":3542,"text":"Ruby on Rails Introduction"}],"string":"[\n {\n \"code\": null,\n \"e\": 28,\n \"s\": 0,\n \"text\": \"\\n22 Oct, 2021\"\n },\n {\n \"code\": null,\n \"e\": 315,\n \"s\": 28,\n \"text\": \"A namespace is a container for multiple items which includes classes, constants, other modules, and more. It is ensured in a namespace that all the objects have unique names for easy identification. Generally, they are structured in a hierarchical format so, that names can be reused. \"\n },\n {\n \"code\": null,\n \"e\": 465,\n \"s\": 315,\n \"text\": \"Namespace in Ruby allows multiple structures to be written using hierarchical manner. Thus, one can reuse the names within the single main namespace.\"\n },\n {\n \"code\": null,\n \"e\": 562,\n \"s\": 465,\n \"text\": \"The namespace in Ruby is defined by prefixing the keyword module in front of the namespace name.\"\n },\n {\n \"code\": null,\n \"e\": 633,\n \"s\": 562,\n \"text\": \"The name of namespaces and classes always start from a capital letter.\"\n },\n {\n \"code\": null,\n \"e\": 756,\n \"s\": 633,\n \"text\": \"You can access the sub members of double with the help of :: operator. It is also called the constant resolution operator.\"\n },\n {\n \"code\": null,\n \"e\": 786,\n \"s\": 756,\n \"text\": \"Ruby allows nested namespace.\"\n },\n {\n \"code\": null,\n \"e\": 908,\n \"s\": 786,\n \"text\": \"You can use include keyword to copy the other module’s objects into the existing namespace without qualifying their name.\"\n },\n {\n \"code\": null,\n \"e\": 918,\n \"s\": 908,\n \"text\": \"Syntax: \"\n },\n {\n \"code\": null,\n \"e\": 974,\n \"s\": 918,\n \"text\": \"module Namespace_name\\n # modules.. and classes..\\nend\"\n },\n {\n \"code\": null,\n \"e\": 1256,\n \"s\": 974,\n \"text\": \"Example 1: This is an example of the simple formation of the namespace with a class and then executing the class methods defined within the class. Here, we access the sub members within the namespace, the “::” operator is used. It is also called the constant resolution operator. \"\n },\n {\n \"code\": null,\n \"e\": 1261,\n \"s\": 1256,\n \"text\": \"Ruby\"\n },\n {\n \"code\": \"# Ruby program to illustrate namespace # Defining a namespace called Geekmodule Geek class GeeksforGeeks # The variable gfg attr_reader :gfg # Class GeeksforGeeks constructor def initialize(value) @gfg = value end endend # Accessing the sub members of# module using '::' operatorobj = Geek::GeeksforGeeks.new(\\\"GeeksForGeeks\\\")puts obj.gfg\",\n \"e\": 1667,\n \"s\": 1261,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1677,\n \"s\": 1667,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 1691,\n \"s\": 1677,\n \"text\": \"GeeksForGeeks\"\n },\n {\n \"code\": null,\n \"e\": 1965,\n \"s\": 1691,\n \"text\": \"Example 2: This is an example showing the implementation of hierarchical namespacing. In this, there is a combination of class and namespace within the single namespace. Here, the use of the class name is done multiple times under the concept of hierarchical namespacing. \"\n },\n {\n \"code\": null,\n \"e\": 1970,\n \"s\": 1965,\n \"text\": \"Ruby\"\n },\n {\n \"code\": \"# Ruby program to illustrate namespace # The main namespacemodule Geek class GeeksforGeeks attr_reader :gfg def initialize(value) @gfg = value end end # Hierarchical namespace module Geek_1 # Reuse of the class names class GeeksforGeeks @@var = \\\"This is the module Geek_1 \\\" + \\\"and class GeeksforGeeks\\\" def printVar() puts @@var end end end # Hierarchical namespace module Geek_2 # Reuse of the class names class GeeksforGeeks attr_reader :var def initialize(var) @var = var end end end end obj_gfg = Geek::GeeksforGeeks.new(\\\"This is the module Geek \\\" + \\\"and class GeeksforGeeks\\\")obj_gfg1 = Geek::Geek_1::GeeksforGeeks.new()obj_gfg2 = Geek::Geek_2::GeeksforGeeks.new(\\\"This is the module Geek_2 \\\" + \\\"and class GeeksforGeeks\\\")puts obj_gfg.gfgputs obj_gfg1.printVar()puts obj_gfg2.var\",\n \"e\": 3014,\n \"s\": 1970,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 3024,\n \"s\": 3014,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 3173,\n \"s\": 3024,\n \"text\": \"This is the module Geek and class GeeksforGeeks\\nThis is the module Geek_1 and class GeeksforGeeks\\n\\nThis is the module Geek_2 and class GeeksforGeeks\"\n },\n {\n \"code\": null,\n \"e\": 3184,\n \"s\": 3175,\n \"text\": \"gabaa406\"\n },\n {\n \"code\": null,\n \"e\": 3191,\n \"s\": 3184,\n \"text\": \"Picked\"\n },\n {\n \"code\": null,\n \"e\": 3196,\n \"s\": 3191,\n \"text\": \"Ruby\"\n },\n {\n \"code\": null,\n \"e\": 3294,\n \"s\": 3196,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 3340,\n \"s\": 3294,\n \"text\": \"How to Make a Custom Array of Hashes in Ruby?\"\n },\n {\n \"code\": null,\n \"e\": 3383,\n \"s\": 3340,\n \"text\": \"Ruby | Enumerator each_with_index function\"\n },\n {\n \"code\": null,\n \"e\": 3427,\n \"s\": 3383,\n \"text\": \"Ruby | unless Statement and unless Modifier\"\n },\n {\n \"code\": null,\n \"e\": 3469,\n \"s\": 3427,\n \"text\": \"Ruby | Array class find_index() operation\"\n },\n {\n \"code\": null,\n \"e\": 3488,\n \"s\": 3469,\n \"text\": \"Ruby For Beginners\"\n },\n {\n \"code\": null,\n \"e\": 3516,\n \"s\": 3488,\n \"text\": \"Ruby | String concat Method\"\n },\n {\n \"code\": null,\n \"e\": 3542,\n \"s\": 3516,\n \"text\": \"Ruby | Types of Variables\"\n },\n {\n \"code\": null,\n \"e\": 3569,\n \"s\": 3542,\n \"text\": \"Ruby on Rails Introduction\"\n }\n]"}}},{"rowIdx":75716,"cells":{"title":{"kind":"string","value":"How to make elements float to center?"},"text":{"kind":"string","value":"19 May, 2022\nThe CSS float property is used to set or return the horizontal alignment of elements. But this property allows an element to float only right or left side of the parent body with rest of the elements wrapped around it. There is no way to float center in CSS layout. So, we can center the elements by using position property.\nExample 1: This example set the position of elements exactly at the center of the screen. \nhtml\n Make float to center to element
\nOutput:\n \nExample: This example set the position of text float elements exactly at the center of the screen. \nhtml\n

Text is centered:

GeeksForGeeks A Computer Science Portal for Geeks

\nOutput:\n \nCSS is the foundation of webpages, is used for webpage development by styling websites and web apps. You can learn CSS from the ground up by following this CSS Tutorial and CSS Examples.\nhardikkoriintern\nCSS-Misc\nHTML-Misc\nPicked\nWeb-Programs\nCSS\nHTML\nWeb Technologies\nHTML\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nTypes of CSS (Cascading Style Sheet)\nDesign a Tribute Page using HTML & CSS\nHow to set space between the flexbox ?\nHow to position a div at the bottom of its container using CSS?\nHow to Upload Image into Database and Display it using PHP ?\nREST API (Introduction)\nHide or show elements in HTML using display property\nHow to set the default value for an HTML element ?"},{"code":null,"e":2427,"s":2366,"text":"How to set input type date in dd-mm-yyyy format using HTML ?"}],"string":"[\n {\n \"code\": null,\n \"e\": 52,\n \"s\": 24,\n \"text\": \"\\n19 May, 2022\"\n },\n {\n \"code\": null,\n \"e\": 377,\n \"s\": 52,\n \"text\": \"The CSS float property is used to set or return the horizontal alignment of elements. But this property allows an element to float only right or left side of the parent body with rest of the elements wrapped around it. There is no way to float center in CSS layout. So, we can center the elements by using position property.\"\n },\n {\n \"code\": null,\n \"e\": 468,\n \"s\": 377,\n \"text\": \"Example 1: This example set the position of elements exactly at the center of the screen. \"\n },\n {\n \"code\": null,\n \"e\": 473,\n \"s\": 468,\n \"text\": \"html\"\n },\n {\n \"code\": \" Make float to center to element
\",\n \"e\": 970,\n \"s\": 473,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 978,\n \"s\": 970,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1081,\n \"s\": 981,\n \"text\": \"Example: This example set the position of text float elements exactly at the center of the screen. \"\n },\n {\n \"code\": null,\n \"e\": 1086,\n \"s\": 1081,\n \"text\": \"html\"\n },\n {\n \"code\": \"

Text is centered:

GeeksForGeeks A Computer Science Portal for Geeks

\",\n \"e\": 1607,\n \"s\": 1086,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1615,\n \"s\": 1607,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1804,\n \"s\": 1617,\n \"text\": \"CSS is the foundation of webpages, is used for webpage development by styling websites and web apps. You can learn CSS from the ground up by following this CSS Tutorial and CSS Examples.\"\n },\n {\n \"code\": null,\n \"e\": 1821,\n \"s\": 1804,\n \"text\": \"hardikkoriintern\"\n },\n {\n \"code\": null,\n \"e\": 1830,\n \"s\": 1821,\n \"text\": \"CSS-Misc\"\n },\n {\n \"code\": null,\n \"e\": 1840,\n \"s\": 1830,\n \"text\": \"HTML-Misc\"\n },\n {\n \"code\": null,\n \"e\": 1847,\n \"s\": 1840,\n \"text\": \"Picked\"\n },\n {\n \"code\": null,\n \"e\": 1860,\n \"s\": 1847,\n \"text\": \"Web-Programs\"\n },\n {\n \"code\": null,\n \"e\": 1864,\n \"s\": 1860,\n \"text\": \"CSS\"\n },\n {\n \"code\": null,\n \"e\": 1869,\n \"s\": 1864,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 1886,\n \"s\": 1869,\n \"text\": \"Web Technologies\"\n },\n {\n \"code\": null,\n \"e\": 1891,\n \"s\": 1886,\n \"text\": \"HTML\"\n },\n {\n \"code\": null,\n \"e\": 1989,\n \"s\": 1891,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 2026,\n \"s\": 1989,\n \"text\": \"Types of CSS (Cascading Style Sheet)\"\n },\n {\n \"code\": null,\n \"e\": 2065,\n \"s\": 2026,\n \"text\": \"Design a Tribute Page using HTML & CSS\"\n },\n {\n \"code\": null,\n \"e\": 2104,\n \"s\": 2065,\n \"text\": \"How to set space between the flexbox ?\"\n },\n {\n \"code\": null,\n \"e\": 2168,\n \"s\": 2104,\n \"text\": \"How to position a div at the bottom of its container using CSS?\"\n },\n {\n \"code\": null,\n \"e\": 2229,\n \"s\": 2168,\n \"text\": \"How to Upload Image into Database and Display it using PHP ?\"\n },\n {\n \"code\": null,\n \"e\": 2253,\n \"s\": 2229,\n \"text\": \"REST API (Introduction)\"\n },\n {\n \"code\": null,\n \"e\": 2306,\n \"s\": 2253,\n \"text\": \"Hide or show elements in HTML using display property\"\n },\n {\n \"code\": null,\n \"e\": 2366,\n \"s\": 2306,\n \"text\": \"How to set the default value for an HTML element ?\nHide or show elements in HTML using display property\nJQuery | Set the value of an input text field\nForm validation using jQuery\nHow to change selected value of a drop-down list using jQuery?\nHow to change the background color after clicking the button in JavaScript ?\nHow to fetch data from JSON file and display in HTML table using jQuery ?"},"parsed":{"kind":"list like","value":[{"code":null,"e":52596,"s":52568,"text":"\n13 Jan, 2021"},{"code":null,"e":52685,"s":52596,"text":"destroy() Method is used to destroy the dialog. This method does not accept any argument"},{"code":null,"e":52693,"s":52685,"text":"Syntax:"},{"code":null,"e":52729,"s":52693,"text":"$( \".selector\" ).dialog(\"destroy\");"},{"code":null,"e":52793,"s":52729,"text":"Approach: First, add jQuery UI scripts needed for your project."},{"code":null,"e":53034,"s":52793,"text":""},{"code":null,"e":53043,"s":53034,"text":"Example:"},{"code":null,"e":53048,"s":53043,"text":"HTML"},{"code":"
Jquery UI| destroy dialog method
","e":53757,"s":53048,"text":null},{"code":null,"e":53765,"s":53757,"text":"Output:"},{"code":null,"e":53902,"s":53765,"text":"Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course."},{"code":null,"e":53912,"s":53902,"text":"jQuery-UI"},{"code":null,"e":53917,"s":53912,"text":"HTML"},{"code":null,"e":53924,"s":53917,"text":"JQuery"},{"code":null,"e":53941,"s":53924,"text":"Web Technologies"},{"code":null,"e":53946,"s":53941,"text":"HTML"},{"code":null,"e":54044,"s":53946,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":54106,"s":54044,"text":"Top 10 Projects For Beginners To Practice HTML and CSS Skills"},{"code":null,"e":54156,"s":54106,"text":"How to insert spaces/tabs in text using HTML/CSS?"},{"code":null,"e":54204,"s":54156,"text":"How to update Node.js and NPM to next version ?"},{"code":null,"e":54264,"s":54204,"text":"How to set the default value for an HTML element ?\"\n },\n {\n \"code\": null,\n \"e\": 54317,\n \"s\": 54264,\n \"text\": \"Hide or show elements in HTML using display property\"\n },\n {\n \"code\": null,\n \"e\": 54363,\n \"s\": 54317,\n \"text\": \"JQuery | Set the value of an input text field\"\n },\n {\n \"code\": null,\n \"e\": 54392,\n \"s\": 54363,\n \"text\": \"Form validation using jQuery\"\n },\n {\n \"code\": null,\n \"e\": 54455,\n \"s\": 54392,\n \"text\": \"How to change selected value of a drop-down list using jQuery?\"\n },\n {\n \"code\": null,\n \"e\": 54532,\n \"s\": 54455,\n \"text\": \"How to change the background color after clicking the button in JavaScript ?\"\n }\n]"}}},{"rowIdx":75755,"cells":{"title":{"kind":"string","value":"How to sorting an array without using loops in Node.js ? - GeeksforGeeks"},"text":{"kind":"string","value":"31 Aug, 2020\nThe setInterval() method repeats or re-schedules the given function at every given time-interval. It is somewhat like window.setInterval() Method of JavaScript API, however, a string of code can’t be passed to get it executed.\nSyntax:\nsetInterval(timerFunction, millisecondsTime);\nParameter: It accepts two parameters which are mentioned above and described below:\ntimerFunction : It is the function to be executed.\nmillisecondsTime