From 3e15548f6b94d78e7ff8f2c9ec759d8a5f4f7ce6 Mon Sep 17 00:00:00 2001 From: Shubham Darda Date: Sun, 1 Feb 2026 17:16:51 +0530 Subject: [PATCH 01/36] v26.2.1 - Refactor string examples in Python, R, and Selenium documentation - Updated Python string methods examples to use consistent variable names and improved comments for clarity. - Revised R functions documentation to include additional examples and comments for better understanding. - Enhanced R list and data frame examples with clearer explanations and corrected outputs. - Improved R vector and matrix operations with added comments for better readability. - Updated date and time functions in R with more comprehensive examples and comments. - Refined Selenium XPath example to use consistent variable names and improved loop logic. --- .github/ISSUE_TEMPLATE/badge.yml | 4 +- _data/gd.yml | 58 ++-- _layouts/modern.html | 6 +- assets/css/color.css | 23 +- assets/css/gd.css | 15 - assets/js/search.js | 2 +- pages/learn/asm/32-bit/gdbhdky.html | 5 +- pages/learn/asm/32-bit/gdvvdud.html | 8 +- pages/learn/asm/64-bit/gdcgame.html | 8 +- pages/learn/asm/64-bit/gdwagtz.html | 8 +- pages/learn/asm/64-bit/gdwdwaz.html | 8 +- pages/learn/c/strings/gdnsdqd.html | 6 +- pages/learn/c/strings/gdozdow.html | 10 +- pages/learn/c/strings/gdpnkez.html | 8 +- pages/learn/cpp/strings/gdadbwe.html | 11 +- pages/learn/cpp/strings/gdarayv.html | 6 +- pages/learn/cpp/strings/gdecfeo.html | 14 +- pages/learn/cpp/strings/gdywzwa.html | 8 +- pages/learn/csharp/strings/gddoika.html | 8 +- pages/learn/csharp/strings/gdgicda.html | 20 +- pages/learn/csharp/strings/gdqdfzd.html | 10 +- pages/learn/csharp/strings/gdywhul.html | 12 +- pages/learn/csharp/strings/gdyyeee.html | 14 +- pages/learn/java/strings/gdhzaue.html | 36 +-- pages/learn/java/strings/gdlggbd.html | 32 +-- pages/learn/java/strings/gdrmyed.html | 18 +- pages/learn/java/strings/gdvdkzc.html | 12 +- pages/learn/java/strings/gdygaza.html | 10 +- pages/learn/julia/fundamentals/gdadvew.html | 17 +- pages/learn/julia/fundamentals/gdavgeq.html | 27 +- pages/learn/julia/fundamentals/gdxkekw.html | 64 ++++- pages/learn/linux/commands/gdasgke.html | 14 +- pages/learn/linux/commands/gdaznye.html | 19 +- pages/learn/linux/commands/gdfyvze.html | 14 +- pages/learn/linux/commands/gdgzyzd.html | 33 ++- pages/learn/linux/commands/gdnvuaa.html | 11 +- pages/learn/linux/commands/gdrrasp.html | 38 ++- pages/learn/linux/commands/gdspezu.html | 29 +- pages/learn/linux/commands/gdvmazz.html | 32 ++- pages/learn/linux/commands/gdwoddg.html | 14 +- pages/learn/linux/commands/gdwzqca.html | 87 +++--- pages/learn/linux/commands/gdyzygf.html | 31 ++- pages/learn/linux/commands/gdzbgoi.html | 261 ++++++++++-------- pages/learn/lisp/fundamentals/gdggadz.html | 40 ++- pages/learn/lisp/fundamentals/gdggdyw.html | 113 +++++--- pages/learn/mongodb/crud/gdeuazw.html | 10 +- pages/learn/mongodb/crud/gdhydqg.html | 5 +- pages/learn/mongodb/crud/gdhzgdy.html | 13 +- pages/learn/mongodb/crud/gdrmzzy.html | 9 +- pages/learn/mongodb/crud/gdwawvv.html | 10 +- pages/learn/mongodb/crud/gdyxxwo.html | 9 +- pages/learn/mongodb/fundamentals/gdaiaar.html | 19 +- pages/learn/mongodb/fundamentals/gdalyqa.html | 10 +- pages/learn/mongodb/fundamentals/gdvivwa.html | 27 +- pages/learn/mysql/ddl/gddvvtd.html | 16 +- pages/learn/mysql/ddl/gddvwtv.html | 12 +- pages/learn/mysql/ddl/gddwgvc.html | 9 +- pages/learn/mysql/ddl/gddwtwf.html | 27 +- pages/learn/mysql/ddl/gdedvew.html | 13 +- pages/learn/mysql/dml/gdbbevd.html | 13 +- pages/learn/mysql/dml/gdczgza.html | 21 +- pages/learn/mysql/dml/gdnhhen.html | 19 +- pages/learn/mysql/dml/gdpdvnx.html | 17 +- pages/learn/mysql/dml/gdpwzaz.html | 11 +- pages/learn/mysql/dml/gdpzyig.html | 10 +- pages/learn/mysql/dml/gduidey.html | 17 +- pages/learn/mysql/dml/gdvzkzw.html | 12 +- pages/learn/mysql/dml/gdzsgwd.html | 15 +- pages/learn/mysql/dml/gdzzcev.html | 12 +- pages/learn/mysql/fundamentals/gdgpzwy.html | 125 ++++++--- pages/learn/mysql/fundamentals/gdrgtrz.html | 33 ++- pages/learn/mysql/index.html | 8 +- pages/learn/octave/fundamentals/gdazzam.html | 15 +- pages/learn/octave/fundamentals/gddggad.html | 11 +- pages/learn/octave/fundamentals/gdeezgn.html | 23 +- pages/learn/octave/fundamentals/gdfxzpq.html | 32 ++- pages/learn/octave/fundamentals/gdgeiev.html | 16 +- pages/learn/octave/strings/gdawdqp.html | 19 +- pages/learn/octave/strings/gdcvyzd.html | 11 +- pages/learn/octave/strings/gdeceiw.html | 31 ++- pages/learn/octave/strings/gduaulz.html | 34 ++- pages/learn/python/fundamentals/gddveuh.html | 23 +- pages/learn/python/fundamentals/gdexazw.html | 33 ++- pages/learn/python/fundamentals/gdvyafu.html | 15 +- pages/learn/python/fundamentals/gdwwvga.html | 78 +++++- pages/learn/python/fundamentals/gdzexcz.html | 36 ++- pages/learn/python/networking/gdyslwy.html | 81 +++++- pages/learn/python/strings/gddduzz.html | 60 ++-- pages/learn/python/strings/gdkgyxy.html | 31 ++- pages/learn/python/strings/gdozvev.html | 18 +- pages/learn/python/strings/gdyqzaz.html | 110 +++++--- pages/learn/python/strings/gdzdngz.html | 51 ++-- pages/learn/r/cli/gdadmvw.html | 42 ++- pages/learn/r/cli/gdarfve.html | 9 +- pages/learn/r/cli/gdazeek.html | 6 +- pages/learn/r/cli/gddlyle.html | 13 +- pages/learn/r/cli/gdegdgz.html | 30 +- pages/learn/r/cli/gdexavz.html | 26 +- pages/learn/r/cli/gdexdvy.html | 23 +- pages/learn/r/cli/gdgebwv.html | 32 +-- pages/learn/selenium/xpath/gdzctqk.html | 14 +- 101 files changed, 1888 insertions(+), 761 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/badge.yml b/.github/ISSUE_TEMPLATE/badge.yml index a6dc8ef..d4ab47e 100644 --- a/.github/ISSUE_TEMPLATE/badge.yml +++ b/.github/ISSUE_TEMPLATE/badge.yml @@ -3,7 +3,7 @@ name: πŸ… Badge Request description: Request a contributor badge for your meaningful work on GoDarda labels: [recognition, needs-review] assignees: - - shubham-dev + - shubhamrdarda body: - type: markdown attributes: @@ -44,4 +44,4 @@ body: id: message attributes: label: Optional message - description: Share anything you'd like us to know about your contribution or experience. \ No newline at end of file + description: Share anything you'd like us to know about your contribution or experience. diff --git a/_data/gd.yml b/_data/gd.yml index e3b74f9..f56d231 100644 --- a/_data/gd.yml +++ b/_data/gd.yml @@ -1,116 +1,116 @@ segments: - title: C Programming url: c - parent: " / C " + parent: " C " - title: C++ Programming url: cpp - parent: " / C++ " + parent: " C++ " - title: Java Programming url: java - parent: " / Java " + parent: " Java " - title: Python Programming url: python - parent: " / Python " + parent: " Python " - title: Data Science url: ds - parent: " / DS " + parent: " DS " - title: R Programming url: r - parent: " / R " + parent: " R " - title: Julia Programming url: julia - parent: " / Julia " + parent: " Julia " - title: GNU Octave url: octave - parent: " / Octave " + parent: " Octave " - title: C# Programming url: csharp - parent: " / CSharp " + parent: " CSharp " - title: F# Programming url: fsharp - parent: " / FSharp " + parent: " FSharp " - title: Rust Programming url: rust - parent: " / Rust " + parent: " Rust " - title: LISP Programming url: lisp - parent: " / LISP " + parent: " LISP " - title: Data Structures and Algorithms url: dsa - parent: " / DSA " + parent: " DSA " - title: Linux Commands and Scripting url: linux - parent: " / Linux " + parent: " Linux " - title: MySQL (Relational Database) url: mysql - parent: " / MySQL " + parent: " MySQL " - title: MongoDB (NoSQL Database) url: mongodb - parent: " / MongoDB " + parent: " MongoDB " - title: Selenium WebDriver url: selenium - parent: " / Selenium " + parent: " Selenium " - title: Computer Graphics url: cg - parent: " / CG " + parent: " CG " - title: Assembly Programming url: asm - parent: " / ASM " + parent: " ASM " - title: Cluster url: cluster - parent: " / Cluster " + parent: " Cluster " - title: About Us url: about - parent: " / About " + parent: " About " - title: Tools url: tools - parent: " / Tools " + parent: " Tools " - title: Calculators url: calculators - parent: " / Calculators " + parent: " Calculators " - title: Converters url: converters - parent: " / Converters " + parent: " Converters " - title: Generators url: generators - parent: " / Generators " + parent: " Generators " - title: Utilities url: utilities - parent: " / Utilities " + parent: " Utilities " - title: Programming and Tutorials url: learn - parent: " / Learn " + parent: " Learn " - title: Shubham Darda url: shubhamrdarda - parent: " / Shubham Darda " + parent: " Shubham Darda " - title: GoDarda's TestApp url: testapp - parent: " / TestApp " + parent: " TestApp " diff --git a/_layouts/modern.html b/_layouts/modern.html index c454998..4e97812 100644 --- a/_layouts/modern.html +++ b/_layouts/modern.html @@ -12,7 +12,7 @@ {%- unless is_sidebar_page -%} {%- else -%} diff --git a/assets/css/color.css b/assets/css/color.css index 7c6bc94..91efc71 100644 --- a/assets/css/color.css +++ b/assets/css/color.css @@ -153,6 +153,17 @@ layout: none {%- assign learn_urls = site.data.learn.learn.segments | map: "url" -%} {%- assign urls = tool_urls | concat: learn_urls -%} +/* Generic highlight color fallback */ +a.card.codecard[data-category]:hover { + border-left: 5px solid var(--other); +} + +.codecard[data-category] mark { + background-color: transparent; + color: var(--other); + font-weight: bold; +} + {%- for segment in site.data.gd.segments -%}{%- assign s = segment.url | split: '/' -%} {%- if urls contains segment.url -%} {%- assign color_var = "var(--" | append: segment.url | append: ")" -%} @@ -160,7 +171,7 @@ layout: none {%- assign color_var = "var(--other)" -%} {%- endif -%} - a.{{ s }}:hover, a.{{ s }}:focus, #{{ s }} > a:hover, #{{ s }} > a:focus, .procard.{{ s }}, .nav-link.sidebar-item-active.{{ s }} + .procard.{{ s }}, .nav-link.sidebar-item-active.{{ s }} { border-left: 5px solid {{ color_var }}; } #fc-{{ s }}, #fc-{{ s }}:hover, .wvnav-item-active-{{ s }} @@ -188,6 +199,14 @@ layout: none { color: {{ color_var }}; } + + /* Specific highlight color based on category */ + a.card.codecard[data-category="{{ segment.url }}"]:hover { + border-left: 5px solid {{ color_var }}; + } + .codecard[data-category="{{ segment.url }}"] mark { + color: {{ color_var }}; + } {%- endfor -%} div#GDS_input-, div#GDS_input-search @@ -213,7 +232,7 @@ div#GDS_input-.search-loading.indeterminate::after, div#GDS_input-search.search- color: var(--other); } -#other > a:hover, #other > a:focus, #search > a:hover, #search > a:focus, .nav-link.sidebar-item-active.about, a.about:hover, a.about:focus +#other > a:hover, #other > a:focus, .nav-link.sidebar-item-active.about, a.about:hover, a.about:focus { border-left: 5px solid var(--other); } #fc-, #fc-search, #fc-about, #fc-shubhamrdarda, .wvnav-item-active-, .wvnav-item-active-search, .wvnav-item-active-about, #fc-:hover, #fc-search:hover, #fc-about:hover, #fc-shubhamrdarda:hover diff --git a/assets/css/gd.css b/assets/css/gd.css index a4ca457..51f11ff 100644 --- a/assets/css/gd.css +++ b/assets/css/gd.css @@ -1,19 +1,4 @@ -@media(min-width: 767px) { - img#logo { - width: 40px; - height: 40px; - border-radius: 5px; - } -} - @media (max-width: 767.98px) { - img#logo { - margin: -4px 0px 0px 0px; - width: 35px; - height: 35px; - border-radius: 5px; - } - div.navbar-brand { margin-left: 40px; position: fixed; diff --git a/assets/js/search.js b/assets/js/search.js index 37e528a..0c41d32 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -476,7 +476,7 @@ // Performance: Build a single HTML string instead of creating DOM nodes in a loop. const html = displayed.map(r => { - return `${buildHighlighted(r, qtrim, tokens, r.type)}`; + return `${buildHighlighted(r, qtrim, tokens, r.type)}`; }).join(''); // Batch the DOM update using requestAnimationFrame for smoother rendering. diff --git a/pages/learn/asm/32-bit/gdbhdky.html b/pages/learn/asm/32-bit/gdbhdky.html index 92f2dba..42768c6 100644 --- a/pages/learn/asm/32-bit/gdbhdky.html +++ b/pages/learn/asm/32-bit/gdbhdky.html @@ -30,5 +30,6 @@ Hello, World! Hello, World! Hello, World! -Hellkodingwindow@gd:~$ - \ No newline at end of file +Hello, World! +godarda@gd:~$ + diff --git a/pages/learn/asm/32-bit/gdvvdud.html b/pages/learn/asm/32-bit/gdvvdud.html index 78812c2..b7dd765 100644 --- a/pages/learn/asm/32-bit/gdvvdud.html +++ b/pages/learn/asm/32-bit/gdvvdud.html @@ -71,9 +71,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the length of given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Length of string 00000012 +Length of string 00000007 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/asm/64-bit/gdcgame.html b/pages/learn/asm/64-bit/gdcgame.html index e4d82c8..e5ab844 100644 --- a/pages/learn/asm/64-bit/gdcgame.html +++ b/pages/learn/asm/64-bit/gdcgame.html @@ -69,9 +69,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the length of given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Length of string 00000012 +Length of string 00000007 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/asm/64-bit/gdwagtz.html b/pages/learn/asm/64-bit/gdwagtz.html index d41b9fd..f7d4873 100644 --- a/pages/learn/asm/64-bit/gdwagtz.html +++ b/pages/learn/asm/64-bit/gdwagtz.html @@ -53,9 +53,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter The String KODINGWINDOW +Enter The String GoDarda -Given string is KODINGWINDOW +Given string is GoDarda β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/asm/64-bit/gdwdwaz.html b/pages/learn/asm/64-bit/gdwdwaz.html index 4a1e2f5..8862c14 100644 --- a/pages/learn/asm/64-bit/gdwdwaz.html +++ b/pages/learn/asm/64-bit/gdwdwaz.html @@ -72,9 +72,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to reverse a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Reverse string is WODNIWGNIDOK +Reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/c/strings/gdnsdqd.html b/pages/learn/c/strings/gdnsdqd.html index 31d7743..f8f3a7e 100644 --- a/pages/learn/c/strings/gdnsdqd.html +++ b/pages/learn/c/strings/gdnsdqd.html @@ -35,7 +35,7 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter the string GoDarda -The reverse string is wodniwgnidoK +The reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/c/strings/gdozdow.html b/pages/learn/c/strings/gdozdow.html index 81b8494..ca545ba 100644 --- a/pages/learn/c/strings/gdozdow.html +++ b/pages/learn/c/strings/gdozdow.html @@ -30,11 +30,11 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to concatenate the two strings β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the 1st string KODING +Enter the 1st string Go -Enter the 2nd string WINDOW +Enter the 2nd string Darda -The concatenated string is KODINGWINDOW +The concatenated string is GoDarda β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/c/strings/gdpnkez.html b/pages/learn/c/strings/gdpnkez.html index 4c52678..6127762 100644 --- a/pages/learn/c/strings/gdpnkez.html +++ b/pages/learn/c/strings/gdpnkez.html @@ -28,9 +28,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to print length of a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Length of string is 12 +Length of string is 7 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/cpp/strings/gdadbwe.html b/pages/learn/cpp/strings/gdadbwe.html index 163c0af..8bd0495 100644 --- a/pages/learn/cpp/strings/gdadbwe.html +++ b/pages/learn/cpp/strings/gdadbwe.html @@ -17,8 +17,9 @@
{{ site.output }}
 {{ site.runcpp }}
-12
-godarda@gd:~$ 
+7
+7
+godarda@gd:~$
 
{{ page.title }}
@@ -35,6 +36,6 @@
{{ site.output }}
 {{ site.runcpp }}
-12
-godarda@gd:~$ 
-
\ No newline at end of file +7 +godarda@gd:~$ + diff --git a/pages/learn/cpp/strings/gdarayv.html b/pages/learn/cpp/strings/gdarayv.html index e841c49..c67d9ab 100644 --- a/pages/learn/cpp/strings/gdarayv.html +++ b/pages/learn/cpp/strings/gdarayv.html @@ -38,7 +38,7 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter the string GoDarda -The reverse string is wodniWgnidoK +The reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/cpp/strings/gdecfeo.html b/pages/learn/cpp/strings/gdecfeo.html index b62f759..7eba678 100644 --- a/pages/learn/cpp/strings/gdecfeo.html +++ b/pages/learn/cpp/strings/gdecfeo.html @@ -31,11 +31,11 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to reverse a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -The reverse string is WODNIWGNIDOK +The reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ +godarda@gd:~$
C++ program to reverse a given string by swapping characters
@@ -79,9 +79,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to reverse a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -The reverse string is WODNIWGNIDOK +The reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/cpp/strings/gdywzwa.html b/pages/learn/cpp/strings/gdywzwa.html index 3489a2d..fe1d045 100644 --- a/pages/learn/cpp/strings/gdywzwa.html +++ b/pages/learn/cpp/strings/gdywzwa.html @@ -68,9 +68,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to reverse a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -The reverse string is WODNIWGNIDOK +The reverse string is adraDoG β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/csharp/strings/gddoika.html b/pages/learn/csharp/strings/gddoika.html index 6941b77..e61f0e9 100644 --- a/pages/learn/csharp/strings/gddoika.html +++ b/pages/learn/csharp/strings/gddoika.html @@ -20,9 +20,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to find the length of a given string β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Length of string is 12 +Length of string is 7 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~/csharp$ - \ No newline at end of file +godarda@gd:~/csharp$ + diff --git a/pages/learn/csharp/strings/gdgicda.html b/pages/learn/csharp/strings/gdgicda.html index 2aafcbc..f95fd43 100644 --- a/pages/learn/csharp/strings/gdgicda.html +++ b/pages/learn/csharp/strings/gdgicda.html @@ -6,20 +6,20 @@
Example 1: {{ page.title }}
{{ site.csfile }}
{%- highlight csharp -%}
-string s = "KODINGWINDOW";
+string s = "GoDarda";
 Console.WriteLine(s.Reverse().ToArray());
 {%- endhighlight -%}
{{ site.output }}
 {{ site.runcs }}
-WODNIWGNIDOK
-godarda@gd:~/csharp$ 
+adraDoG
+godarda@gd:~/csharp$
 
Example 2: {{ page.title }}
{{ site.csfile }}
{%- highlight csharp -%}
-string s = "KODINGWINDOW";
+string s = "GoDarda";
 char[] arr = s.ToCharArray();
 Array.Reverse(arr);
 Console.WriteLine(arr);
@@ -27,15 +27,15 @@
 
{{ site.output }}
 {{ site.runcs }}
-WODNIWGNIDOK
-godarda@gd:~/csharp$ 
+adraDoG
+godarda@gd:~/csharp$
 
Example 3: {{ page.title }}
{{ site.csfile }}
{%- highlight csharp -%}
 string r = "", s;
-s = "KODINGWINDOW";
+s = "GoDarda";
 int len = s.Length - 1;
 while (len >= 0)
 {
@@ -47,6 +47,6 @@
 
{{ site.output }}
 {{ site.runcs }}
-WODNIWGNIDOK
-godarda@gd:~/csharp$ 
-
\ No newline at end of file +adraDoG +godarda@gd:~/csharp$ +
diff --git a/pages/learn/csharp/strings/gdqdfzd.html b/pages/learn/csharp/strings/gdqdfzd.html index 53bc728..01d5ca7 100644 --- a/pages/learn/csharp/strings/gdqdfzd.html +++ b/pages/learn/csharp/strings/gdqdfzd.html @@ -12,8 +12,8 @@
{{ site.output }}
 {{ site.runcs }}
-KODINGWINDOW
-godarda@gd:~/csharp$ 
+GODARDA
+godarda@gd:~/csharp$
 
C# program to convert lowercase to an uppercase string using ASCII values
@@ -33,6 +33,6 @@
{{ site.output }}
 {{ site.runcs }}
-KODINGWINDOW
-godarda@gd:~/csharp$ 
-
\ No newline at end of file +GODARDA +godarda@gd:~/csharp$ +
diff --git a/pages/learn/csharp/strings/gdywhul.html b/pages/learn/csharp/strings/gdywhul.html index ed07b82..49d5c44 100644 --- a/pages/learn/csharp/strings/gdywhul.html +++ b/pages/learn/csharp/strings/gdywhul.html @@ -6,8 +6,8 @@
{{ page.title }}
{{ site.csfile }}
{%- highlight csharp -%}
-string s1 ="Koding";
-string s2 = "window";
+string s1 = "Go";
+string s2 = "Darda";
 
 Console.WriteLine(String.Concat(s1, s2));
 Console.WriteLine(s1+s2);
@@ -15,7 +15,7 @@
 
{{ site.output }}
 {{ site.runcs }}
-kodigwindow
-kodigwindow
-godarda@gd:~/csharp$ 
-
\ No newline at end of file +GoDarda +GoDarda +godarda@gd:~/csharp$ +
diff --git a/pages/learn/csharp/strings/gdyyeee.html b/pages/learn/csharp/strings/gdyyeee.html index 345fd9f..23683ab 100644 --- a/pages/learn/csharp/strings/gdyyeee.html +++ b/pages/learn/csharp/strings/gdyyeee.html @@ -6,20 +6,20 @@
{{ page.title }}
{{ site.csfile }}
{%- highlight csharp -%}
-string s = "KODIGWINDOW";
+string s = "GODARDA";
 Console.WriteLine(s.ToLower());
 {%- endhighlight -%}
{{ site.output }}
 {{ site.runcs }}
-kodigwindow
-godarda@gd:~/csharp$ 
+godarda
+godarda@gd:~/csharp$
 
C# program to convert uppercase to a lowercase string using ASCII values
{{ site.csfile }}
{%- highlight csharp -%}
-string s1 = "KODIGWINDOW";
+string s1 = "GODARDA";
 string s2 = "";
 for (int i = 0; i < s1.Length; i++)
 {
@@ -33,6 +33,6 @@
 
{{ site.output }}
 {{ site.runcs }}
-kodigwindow
-godarda@gd:~/csharp$ 
-
\ No newline at end of file +godarda +godarda@gd:~/csharp$ +
diff --git a/pages/learn/java/strings/gdhzaue.html b/pages/learn/java/strings/gdhzaue.html index 7b8d3a1..5fdbad7 100644 --- a/pages/learn/java/strings/gdhzaue.html +++ b/pages/learn/java/strings/gdhzaue.html @@ -28,23 +28,23 @@ Scanner sc=new Scanner(System.in); System.out.print("Enter any string "); s=sc.nextLine(); - + s=s.replaceAll("[^\\p{ASCII}]",""); System.out.print("\nKeyboard characters "+s); - + int count=0; - char[] ch=s.toCharArray(); - for(int i=0;i @@ -102,14 +102,14 @@ s=sc.nextLine(); int count=0,holes=0; - for(int i=0;i \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/java/strings/gdlggbd.html b/pages/learn/java/strings/gdlggbd.html index 87643c9..25df082 100644 --- a/pages/learn/java/strings/gdlggbd.html +++ b/pages/learn/java/strings/gdlggbd.html @@ -10,13 +10,13 @@ { public static void main(String args[]) { - String s = "KODINGWINDOW"; + String s = "GoDarda"; int length=0; for(char c: s.toCharArray()) { - length++; - } - System.out.println("Length of a string is: "+length); + length++; + } + System.out.println("Length of a string is: "+length); } } {%- endhighlight -%} @@ -27,13 +27,13 @@ { public static void main(String args[]) { - String s = "KODINGWINDOW\0"; + String s = "GoDarda\0"; int length=0; for(int i=0; s.charAt(i)!='\0';i++) { - length++; - } - System.out.println("Length of a string is: "+length); + length++; + } + System.out.println("Length of a string is: "+length); } } {%- endhighlight -%} @@ -44,13 +44,13 @@ { public static void main(String args[]) { - String s1="KODINGWINDOW"; + String s1="GoDarda"; int length=0; for(String s2:s1.split("")) { length++; } - System.out.println("Length of a string is: "+length); + System.out.println("Length of a string is: "+length); } } {%- endhighlight -%} @@ -62,21 +62,21 @@ { public static void main(String args[]) { - String s="KODINGWINDOW"; + String s="GoDarda"; int length=0; CharacterIterator it=new StringCharacterIterator(s); - while(it.current()!=CharacterIterator.DONE) + while(it.current()!=CharacterIterator.DONE) { it.next(); length++; } - System.out.println("Length of a string is: "+length); + System.out.println("Length of a string is: "+length); } } {%- endhighlight -%}
{{ site.output }}
 {{ site.runjava }}
-Length of a string is: 12
-godarda@gd:~$ 
-
\ No newline at end of file +Length of a string is: 7 +godarda@gd:~$ + diff --git a/pages/learn/java/strings/gdrmyed.html b/pages/learn/java/strings/gdrmyed.html index 2a03d7e..ccbe365 100644 --- a/pages/learn/java/strings/gdrmyed.html +++ b/pages/learn/java/strings/gdrmyed.html @@ -36,11 +36,11 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to find unique characters β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda -Unique characters KODINGW +Unique characters GoDard β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ +godarda@gd:~$
Example 2: {{ page.title }}
@@ -80,15 +80,13 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to find unique characters β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Enter the string KODINGWINDOW +Enter the string GoDarda +Unique character A Unique character D Unique character G -Unique character I -Unique character K -Unique character N Unique character O -Unique character W +Unique character R β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/java/strings/gdvdkzc.html b/pages/learn/java/strings/gdvdkzc.html index d81e40e..8ccc2a7 100644 --- a/pages/learn/java/strings/gdvdkzc.html +++ b/pages/learn/java/strings/gdvdkzc.html @@ -37,7 +37,7 @@ The length of (Hello, World!) = 13 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ +godarda@gd:~$
{{ page.title }}
@@ -47,19 +47,19 @@ { public static void main(String args[]) { - String s1="KODINGWINDOW"; + String s1="GoDarda"; int length=0; for(String s2:s1.split("")) { length++; } - System.out.println("Length of a string is: "+length); + System.out.println("Length of a string is: "+length); } } {%- endhighlight -%}
{{ site.output }}
 {{ site.runjava }}
-Length of a string is: 12
-godarda@gd:~$ 
-
\ No newline at end of file +Length of a string is: 7 +godarda@gd:~$ + diff --git a/pages/learn/java/strings/gdygaza.html b/pages/learn/java/strings/gdygaza.html index 6bab28b..1cc941f 100644 --- a/pages/learn/java/strings/gdygaza.html +++ b/pages/learn/java/strings/gdygaza.html @@ -6,16 +6,16 @@
{{ page.title }}
{{ site.javafile }}
{%- highlight java -%}
-class GD 
+class GD
 {
     @SuppressWarnings("preview")
-    public static void main(String[] args) 
+    public static void main(String[] args)
     {
         String s1 = """
                 Welcome
                 to
                 GoDarda""";
-        String s2 = "Welcome\nto\nKodingWindow";
+        String s2 = "Welcome\nto\nGoDarda";
         System.out.println(s1);     //text block string
         System.out.println("β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”");
         System.out.println(s2);     //normal string
@@ -38,5 +38,5 @@
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 true
 true
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/julia/fundamentals/gdadvew.html b/pages/learn/julia/fundamentals/gdadvew.html index e189723..bb39ccb 100644 --- a/pages/learn/julia/fundamentals/gdadvew.html +++ b/pages/learn/julia/fundamentals/gdadvew.html @@ -5,54 +5,69 @@
Exponents
+# e raised to the power of 0
 julia> exp(0)
 1.0
 
+# exp(0) - 1
 julia> expm1(0)
 0.0
 
+# e raised to the power of 1
 julia> exp(1)
 2.718281828459045
 
+# exp(1) - 1
 julia> expm1(1)
 1.7182818284590453
 
+# e raised to the power of 2
 julia> exp(2)
 7.38905609893065
 
+# exp(2) - 1
 julia> expm1(2)
 6.38905609893065
 
Logarithms
+# natural logarithm (base e)
 julia> log(0)
 -Inf
 
+# natural logarithm (base e)
 julia> log(2)
 0.6931471805599453
 
+# base-10 logarithm
 julia> log10(0)
 -Inf
 
+# base-10 logarithm
 julia> log10(2)
 0.3010299956639812
 
+# base-2 logarithm
 julia> log2(0)
 -Inf
 
+# base-2 logarithm
 julia> log2(2)
 1.0
 
Square root and Cube root functions
+# square root
 julia> sqrt(100)
 10.0
 
+# cube root
 julia> cbrt(27)
 3.0
 
+# 2 raised to the power of 10
 julia> 2^10
 1024
-
\ No newline at end of file + diff --git a/pages/learn/julia/fundamentals/gdavgeq.html b/pages/learn/julia/fundamentals/gdavgeq.html index 2c084a8..39cc49a 100644 --- a/pages/learn/julia/fundamentals/gdavgeq.html +++ b/pages/learn/julia/fundamentals/gdavgeq.html @@ -5,6 +5,7 @@
{{ page.title }}
+# Bitwise OR
 julia> 1 | 1
 1
 
@@ -16,7 +17,9 @@
 
 julia> 0 | 0
 0
-
julia> true | true +
+# Logical OR +julia> true | true true julia> true | false @@ -27,7 +30,9 @@ julia> false | false false -
julia> 1 & 1 +
+# Bitwise AND +julia> 1 & 1 1 julia> 1 & 0 @@ -38,7 +43,9 @@ julia> 0 & 0 0 -
julia> true & true +
+# Logical AND +julia> true & true true julia> true & false @@ -49,7 +56,9 @@ julia> false & false false -
julia> true+true +
+# Arithmetic operations with booleans +julia> true+true 2 julia> false-true @@ -60,7 +69,9 @@ julia> false-false 0 -
julia> 1==1 +
+# Comparison operators +julia> 1==1 true julia> 1<1 @@ -74,7 +85,9 @@ julia> 10//30==1//3 true -
julia> NaN == NaN +
+# Special value comparisons +julia> NaN == NaN false julia> isequal(NaN, NaN) @@ -85,4 +98,4 @@ julia> isequal(-0.0, 0.0) false -
\ No newline at end of file + diff --git a/pages/learn/julia/fundamentals/gdxkekw.html b/pages/learn/julia/fundamentals/gdxkekw.html index 5b58a9f..34e7ef6 100644 --- a/pages/learn/julia/fundamentals/gdxkekw.html +++ b/pages/learn/julia/fundamentals/gdxkekw.html @@ -7,171 +7,223 @@
 godarda@gd:~$ julia
 ...
+# Addition
 julia> 10+20
 30
 
+# Subtraction
 julia> 10-20
 -10
 
+# Multiplication
 julia> 10*20
 200
 
+# Division
 julia> 10/20
 0.5
 
+# Power
 julia> 2^10
 1024
 
+# Modulus
 julia> mod(-7,4)
 1
 
+# Modulus
 julia> mod(7,4)
 3
 
+# Remainder
 julia> rem(-7,4)
 -3
 
+# Remainder
 julia> rem(7,4)
 3
 
+# Integer division
 julia> div(-7,4)
 -1
 
+# Integer division
 julia> div(7,4)
 1
 
+# Division and remainder
 julia> divrem(-7,4)
 (-1, -3)
 
+# Division and remainder
 julia> divrem(7,4)
 (1, 3)
 
+# Rational number
 julia> 2//3
 2//3
 
+# Numerator
 julia> numerator(2//3)
 2
 
+# Denominator
 julia> denominator(2//3)
 3
 
+# Rational number simplification
 julia> 10//30
 1//3
 
+# Infinity
 julia> Inf
 Inf
 
+# Not a Number
 julia> NaN
 NaN
 
+# NaN result
 julia> Inf*0
 NaN
 
+# Greatest Common Divisor
 julia> gcd(18,21)
 3
 
+# Least Common Multiple
 julia> lcm(24,36)
 72
 
Arithmetic operations on complex numbers
+# Complex number addition
 julia> complex(4+5im)+complex(2+6im)
 6 + 11im
-        
+
 julia> c1=4+5im
 4 + 5im
 
 julia> c2=2+6im
 2 + 6im
 
+# Addition
 julia> c1+c2
 6 + 11im
 
+# Subtraction
 julia> c1-c2
 2 - 1im
 
+# Multiplication
 julia> c1*c2
 -22 + 34im
 
+# Division
 julia> c1/c2
 0.95 - 0.35000000000000003im
 
+# Power
 julia> c1^2
 -9 + 40im
 
+# Multiplication by scalar
 julia> 10(c1)
 40 + 50im
 
round(), floor(), ceil() and trunc() functions
+# Round to nearest integer
 julia> round(2.3)
 2.0
 
+# Round to nearest integer
 julia> round(2.8)
 3.0
 
+# Round to nearest integer
 julia> round(-2.3)
 -2.0
 
+# Round to nearest integer
 julia> round(-2.8)
 -3.0
-
julia> floor(2.3) +
# Largest integer <= x +julia> floor(2.3) 2.0 +# Largest integer <= x julia> floor(2.8) 2.0 +# Largest integer <= x julia> floor(-2.3) -3.0 +# Largest integer <= x julia> floor(-2.8) -3.0 -
julia> ceil(2.3) +
# Smallest integer >= x +julia> ceil(2.3) 3.0 +# Smallest integer >= x julia> ceil(2.8) 3.0 +# Smallest integer >= x julia> ceil(-2.3) -2.0 +# Smallest integer >= x julia> ceil(-2.8) -2.0 -
julia> trunc(2.3) +
# Truncate to integer +julia> trunc(2.3) 2.0 +# Truncate to integer julia> trunc(2.8) 2.0 +# Truncate to integer julia> trunc(-2.3) -2.0 +# Truncate to integer julia> trunc(-2.8) --2.0 +-2.0
typeof() function
+# Type of integer
 julia> typeof(2)
 Int64
 
+# Type of float
 julia> typeof(2.3)
 Float64
 
+# Type of integer
 julia> typeof(-1)
 Int64
 
+# Type of unsigned integer
 julia> typeof(0x02)
 UInt8
 
+# Type of irrational number
 julia> typeof(pi)
 Irrational{:Ο€}
 
+# Type of infinity
 julia> typeof(Inf)
 Float64
 
+# Type of NaN
 julia> typeof(NaN)
 Float64
-
\ No newline at end of file + diff --git a/pages/learn/linux/commands/gdasgke.html b/pages/learn/linux/commands/gdasgke.html index 8f6c53e..d2c65d4 100644 --- a/pages/learn/linux/commands/gdasgke.html +++ b/pages/learn/linux/commands/gdasgke.html @@ -6,10 +6,12 @@
{{ page.title }}
ls command with options
+# List files in the current directory
 godarda@gd:~$ ls
 a.out  GD.class  GD.java  Desktop    Downloads	Pictures  Templates  Weekdays
 gd.c   gd.csv	 gd.py	  Documents  Music	Public	  Videos
 
+# List all files including hidden ones
 godarda@gd:~$ ls -a
 .	       gd.csv	  .mozilla	    .ssh
 ..	       GD.java	  Music		    .sudo_as_admin_successful
@@ -21,6 +23,7 @@
 gd.c	       .keras	  .Rhistory
 GD.class       .local	  .rstudio-desktop
 
+# List almost all files (excluding . and ..)
 godarda@gd:~$ ls -A
 a.out	       gd.csv	  .keras    .python_history	       .theano
 .bash_history  GD.java	  .local    .r			       Videos
@@ -30,6 +33,7 @@
 gd.c	       Downloads  .pki	    .sudo_as_admin_successful
 GD.class       .gnupg	  Public    Templates
 
+# List one file per line
 godarda@gd:~$ ls -1
 a.out
 gd.c
@@ -46,11 +50,12 @@
 Templates
 Videos
 Weekdays
-godarda@gd:~$ 
+godarda@gd:~$
 
Display the permissions of files/directories
+# List files in long format
 godarda@gd:~$ ls -l
 total 72
 -rwxr-xr-x 1 godarda godarda 13968 May 16  2019 a.out
@@ -72,6 +77,7 @@
 
 
Display the inode (index number) of files/directories
+# List files with inode numbers in long format
 godarda@gd:~$ ls -li
 total 72
 3408466 -rwxr-xr-x 1 godarda godarda 13968 May 16  2019 a.out
@@ -90,6 +96,7 @@
 3407947 drwxr-xr-x 2 godarda godarda  4096 Jun  4 20:38 Videos
 3408355 -rw-rw-r-- 1 godarda godarda    84 May 31 11:23 Weekdays
 
+# List files with inode numbers
 godarda@gd:~$ ls -i
 3408466 a.out	  3413037 GD.java    3407941 Downloads	3407942 Templates
 3408372 gd.c	  3419358 gd.py      3407945 Music	3407947 Videos
@@ -99,6 +106,7 @@
 
 
Explore the ls command with man page(s)
+# Display manual page for ls
 godarda@gd:~$ man ls
 
 LS(1)                            User Commands                           LS(1)
@@ -140,6 +148,7 @@
 
 
Explore the ls command with info page(s)
+# Display info page for ls
 godarda@gd:~$ info ls
 
 Next: dir invocation,  Up: Directory listing
@@ -162,6 +171,7 @@
 
 
Explore the ls command with help option(s)
+# Display help message
 godarda@gd:~$ ls --help
 Usage: ls [OPTION]... [FILE]...
 List information about the FILEs (the current directory by default).
@@ -177,4 +187,4 @@
   -B, --ignore-backups       do not list implied entries ending with ~
 
 ...
-
\ No newline at end of file +
diff --git a/pages/learn/linux/commands/gdaznye.html b/pages/learn/linux/commands/gdaznye.html index e4f6ffa..6fdfa7d 100644 --- a/pages/learn/linux/commands/gdaznye.html +++ b/pages/learn/linux/commands/gdaznye.html @@ -6,19 +6,25 @@
{{ page.title }}
mkdir command with options
+# List files in current directory
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Music     Public     Videos
 gd.c   GD.java  Desktop  Downloads  Pictures  Templates  Weekdays
 
+# Print working directory
 godarda@gd:~$ pwd
 /home/godarda
 
+# Create a new directory
 godarda@gd:~$ mkdir Linux
+# Change directory
 godarda@gd:~$ cd Linux/
 
 godarda@gd:~/Linux$ pwd
 /home/godarda/Linux
-
godarda@gd:~/Linux$ ls +
+godarda@gd:~/Linux$ ls +# Create nested directories (parent directories) godarda@gd:~/Linux$ mkdir -p Flavours/{Ubuntu/{Ubuntu_18.04,Ubuntu_20.04},Fedora/{Fedora_31,Fedora_32}} godarda@gd:~/Linux$ ls Flavours @@ -27,10 +33,12 @@ godarda@gd:~/Linux/Flavours/Ubuntu$ ls Ubuntu_18.04 Ubuntu_20.04 +# Go up one directory level godarda@gd:~/Linux/Flavours/Ubuntu$ cd .. godarda@gd:~/Linux/Flavours$ ls Fedora Ubuntu +# Create directory with specific permissions godarda@gd:~/Linux/Flavours$ mkdir -m a=r KaliLinux godarda@gd:~/Linux/Flavours$ ls Fedora KaliLinux Ubuntu @@ -41,6 +49,7 @@ dr--r--r-- 2 godarda godarda 4096 Jun 13 12:04 KaliLinux drwxrwxr-x 4 godarda godarda 4096 Jun 13 12:03 Ubuntu +# Create directories with verbose output godarda@gd:~/Linux/Flavours$ mkdir -v CentOS LinuxMint mkdir: created directory 'CentOS' mkdir: created directory 'LinuxMint' @@ -51,24 +60,28 @@
rmdir command with options
+# Remove an empty directory
 godarda@gd:~/Linux/Flavours$ rmdir CentOS/
 godarda@gd:~/Linux/Flavours$ ls
 Fedora  KaliLinux  LinuxMint  Ubuntu
 
+# Remove a directory recursively
 godarda@gd:~/Linux/Flavours$ rm -r KaliLinux/
 rm: remove write-protected directory 'KaliLinux/'? y
 
 godarda@gd:~/Linux/Flavours$ ls
 Fedora LinuxMint Ubuntu
 
+# Return to home directory
 godarda@gd:~/Linux/Flavours$ cd
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Linux  Pictures  Templates  Weekdays
 gd.c   GD.java  Desktop  Downloads  Music  Public    Videos
 
+# Force remove a directory recursively
 godarda@gd:~$ rm -rf Linux/
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Music     Public     Videos
 gd.c   GD.java  Desktop  Downloads  Pictures  Templates  Weekdays
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdfyvze.html b/pages/learn/linux/commands/gdfyvze.html index fcab43d..9e38d8a 100644 --- a/pages/learn/linux/commands/gdfyvze.html +++ b/pages/learn/linux/commands/gdfyvze.html @@ -3,34 +3,42 @@ title: Linux commands to display the logged-in user and information --- -
{{ page.title }}
+
{{ page.title }}
who command with options
+# Show who is logged on
 godarda@gd:~$ who
 godarda :0           2020-05-31 10:48 (:0)
 
+# Print effective user ID
 godarda@gd:~$ whoami
 godarda
 
+# Show all information
 godarda@gd:~$ who -a
            system boot  2020-05-31 16:15
            run-level 5  2020-05-31 10:46
 godarda ? :0           2020-05-31 10:48   ?          1859 (:0)
 
+# Show time of last system boot
 godarda@gd:~$ who -b
          system boot  2020-05-31 16:15
 
+# Print heading and list logged in users
 godarda@gd:~$ who -Hu
 NAME     LINE         TIME             IDLE          PID COMMENT
 godarda :0           2020-05-31 10:48   ?          1859 (:0)
 
+# Count all login names and number of users
 godarda@gd:~$ who -q
 godarda
 # users=1
 
+# Show user's message status
 godarda@gd:~$ who -T
 godarda ? :0           2020-05-31 10:48 (:0)
 
+# Display help message
 godarda@gd:~$ who --help
 Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]
 Print information about users who are currently logged in.
@@ -63,5 +71,5 @@
 GNU coreutils online help: https://www.gnu.org/software/coreutils/
 Full documentation at: https://www.gnu.org/software/coreutils/who
 or available locally via: info '(coreutils) who invocation'
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdgzyzd.html b/pages/learn/linux/commands/gdgzyzd.html index 7e44564..be59749 100644 --- a/pages/learn/linux/commands/gdgzyzd.html +++ b/pages/learn/linux/commands/gdgzyzd.html @@ -6,6 +6,7 @@
{{ page.title }}
lscpu command
+# Display CPU architecture information
 godarda@gd:~$ lscpu
 Architecture:             x86_64
   CPU op-mode(s):         32-bit, 64-bit
@@ -30,9 +31,10 @@
 
 
lshw command
+# List hardware configuration
 godarda@gd:~$ lshw
 WARNING: you should run this program as super-user.
-gd                          
+gd
     description: Computer
     width: 64 bits
     capabilities: smp vsyscall32
@@ -57,6 +59,7 @@
 
 
lspci command
+# List all PCI devices
 godarda@gd:~$ lspci
 0000:00:00.0 Host bridge: Intel Corporation Device 9a04 (rev 01)
 0000:00:02.0 VGA compatible controller: Intel Corporation Tiger Lake-LP GT2 [UHD Graphics G4] (rev 01)
@@ -66,8 +69,9 @@
 
 
Hardware information using cat command
+# Show interrupts per CPU
 godarda@gd:~$ cat /proc/interrupts | head -10
-            CPU0       CPU1       CPU2       CPU3       
+            CPU0       CPU1       CPU2       CPU3
    1:          0          0       2955          0  IR-IO-APIC    1-edge      i8042
    8:          0          0          0          0  IR-IO-APIC    8-edge      rtc0
    9:          0      10273          0          0  IR-IO-APIC    9-fasteoi   acpi
@@ -77,7 +81,9 @@
   37:          0          0          0          0  IR-IO-APIC   37-fasteoi   idma64.3, pxa2xx-spi.3
   40:          0       1678          0          0  IR-IO-APIC   40-fasteoi   idma64.1, i2c_designware.1
  120:          0          0          0          0  DMAR-MSI    0-edge      dmar0
-
godarda@gd:~$ cat /proc/cpuinfo | head -10 +
+# Show CPU information +godarda@gd:~$ cat /proc/cpuinfo | head -10 processor : 0 vendor_id : GenuineIntel cpu family : 6 @@ -88,7 +94,9 @@ cpu MHz : 1300.127 cache size : 6144 KB physical id : 0 -
godarda@gd:~$ cat /proc/meminfo | head -10 +
+# Show memory information +godarda@gd:~$ cat /proc/meminfo | head -10 MemTotal: 7911628 kB MemFree: 2623644 kB MemAvailable: 4531468 kB @@ -99,7 +107,9 @@ Inactive: 2654764 kB Active(anon): 1218664 kB Inactive(anon): 1305352 kB -
godarda@gd:~$ cat /proc/zoneinfo | head -10 +
+# Show memory zone information +godarda@gd:~$ cat /proc/zoneinfo | head -10 Node 0, zone DMA per-node stats nr_inactive_anon 326267 @@ -114,16 +124,19 @@
Commands to display memory information
+# Display amount of free and used memory
 godarda@gd:~$ free
                total        used        free      shared  buff/cache   available
 Mem:         7911628     3369904     2633604      504844     2725544     4541724
 Swap:        4194300      104960     4089340
 
+# Report virtual memory statistics
 godarda@gd:~$ vmstat
 procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st gu
  0  0 104960 2643164  51876 2668680    0   19   503  1955 2596   12  9  3 88  0  0  0
 
+# Report file system disk space usage
 godarda@gd:~$ df
 Filesystem     1K-blocks     Used Available Use% Mounted on
 tmpfs             791164     2244    788920   1% /run
@@ -134,7 +147,9 @@
 /dev/nvme0n1p1    262144    63860    198284  25% /boot/efi
 tmpfs             791160     2568    788592   1% /run/user/1000
 
-
godarda@gd:~$ lsusb +
+# List USB devices +godarda@gd:~$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub @@ -142,7 +157,9 @@ Bus 003 Device 003: ID 5986:2137 Bison Electronics Inc. Integrated Camera Bus 003 Device 004: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP) Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub -
godarda@gd:~$ id +
+# Print user and group IDs +godarda@gd:~$ id uid=1000(godarda) gid=1000(godarda) groups=1000(godarda), 4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),100(users),114(lpadmin) -
\ No newline at end of file +
diff --git a/pages/learn/linux/commands/gdnvuaa.html b/pages/learn/linux/commands/gdnvuaa.html index b7a8453..0dc7ee4 100644 --- a/pages/learn/linux/commands/gdnvuaa.html +++ b/pages/learn/linux/commands/gdnvuaa.html @@ -6,16 +6,19 @@
{{ page.title }}
touch and cat commands to create the files
+# List files in current directory
 godarda@gd:~$ ls
 a.out  GD.class  GD.java  Desktop    Downloads	Pictures  Templates  Weekdays
 gd.c   gd.csv	 gd.py	  Documents  Music	Public	  Videos
 
+# Create empty files
 godarda@gd:~$ touch Ubuntu.txt Fedora.txt
 godarda@gd:~$ ls
 a.out	  gd.csv   Desktop    Fedora.txt  Public      Videos
 gd.c	  GD.java  Documents  Music	  Templates   Weekdays
 GD.class  gd.py    Downloads  Pictures	  Ubuntu.txt
 
+# Create a file using redirection
 godarda@gd:~$ cat > KaliLinux
 ^C
 godarda@gd:~$ ls
@@ -23,6 +26,7 @@
 gd.c	  GD.java  Documents  KaliLinux   Public     Videos
 GD.class  gd.py    Downloads  Music	  Templates  Weekdays
 
+# Determine file type
 godarda@gd:~$ file Fedora.txt gd.c gd.csv
 Fedora.txt: empty
 gd.c:       C source, ASCII text
@@ -31,6 +35,7 @@
 
 
rm command to remove the file(s)
+# Remove files
 godarda@gd:~$ rm KaliLinux Weekdays
 godarda@gd:~$ ls
 a.out	  gd.csv   Desktop    Fedora.txt  Public      Videos
@@ -40,7 +45,9 @@
 
 
rm command with a regular expression to remove multiple files of the same extension
+# Remove files with .txt extension
 godarda@gd:~$ rm *.txt
+# List files one per line
 godarda@gd:~$ ls -1
 a.out
 gd.c
@@ -56,5 +63,5 @@
 Public
 Templates
 Videos
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdrrasp.html b/pages/learn/linux/commands/gdrrasp.html index f6ddf37..e4dc9af 100644 --- a/pages/learn/linux/commands/gdrrasp.html +++ b/pages/learn/linux/commands/gdrrasp.html @@ -6,6 +6,7 @@
{{ page.title }}
cat and wc commands with options
+# Display file content
 godarda@gd:~$ cat gd.c
 #include<stdio.h>
 int main()
@@ -15,30 +16,40 @@
     return 0;
 }
 
+# Count bytes in the first line
 godarda@gd:~$ head -1 gd.c | wc -c
 18
 
+# Count lines, words, and bytes
 godarda@gd:~$ wc gd.c
  7 10 90 gd.c
 
+# Print byte counts
 godarda@gd:~$ wc -c gd.c
 90 gd.c
 
+# Print newline counts
 godarda@gd:~$ wc -l gd.c
 7 gd.c
 
+# Print maximum line length
 godarda@gd:~$ wc -L gd.c
 30 gd.c
 
+# Print character counts
 godarda@gd:~$ wc -m gd.c
 90 gd.c
 
+# Print character and word counts
 godarda@gd:~$ wc -mw gd.c
 10 90 gd.c
 
+# Print word counts
 godarda@gd:~$ wc -w gd.c
 10 gd.c
-
godarda@gd:~$ nl gd.c +
+# Number lines of file +godarda@gd:~$ nl gd.c 1 #include<stdio.h> 2 int main() 3 { @@ -50,7 +61,9 @@
less, more, od, and xxd commands
+# View file content one screen at a time
 godarda@gd:~$ less gd.c
+# View file content one screen at a time
 godarda@gd:~$ more gd.c
 #include<stdio.h>
 int main()
@@ -59,7 +72,9 @@
     printf("Hello, World!\n");
     return 0;
 }
-
godarda@gd:~$ od gd.c +
+# Dump file in octal format +godarda@gd:~$ od gd.c 0000000 064443 061556 072554 062544 071474 062164 067551 064056 0000020 005076 067151 020164 060555 067151 024450 075412 020012 0000040 020040 063040 071157 024153 035451 020012 020040 070040 @@ -68,9 +83,10 @@ 0000120 072564 067162 030040 005073 005175 0000132 +# Create a hexdump godarda@gd:~$ xxd gd.c 00000000: 2369 6e63 6c75 6465 3c73 7464 696f 2e68 #include<stdio.h -00000010: 3e0a 696e 7420 6d61 696e 2829 0a7b 0a20 >.int main().{. +00000010: 3e0a 696e 7420 6d61 696e 2829 0a7b 0a20 >.int main().{. 00000020: 2020 2066 6f72 6b28 293b 0a20 2020 2070 fork();. p 00000030: 7269 6e74 6628 2248 656c 6c6f 2c20 576f rintf("Hello, Wo 00000040: 726c 6421 5c6e 2229 3b0a 2020 2020 7265 rld!\n");. re @@ -79,6 +95,7 @@
cat command with options
+# Concatenate and print file content
 godarda@gd:~$ cat gd.c
 #include<stdio.h>
 int main()
@@ -88,6 +105,7 @@
     return 0;
 }
 
+# Display $ at end of each line
 godarda@gd:~$ cat -E gd.c
 #include<stdio.h>$
 int main()$
@@ -97,6 +115,7 @@
     return 0;$
 }$
 
+# Number all output lines
 godarda@gd:~$ cat -n gd.c
      1  #include<stdio.h>
      2  int main()
@@ -106,6 +125,7 @@
      6      return 0;
      7  }
 
+# Number nonempty output lines
 godarda@gd:~$ cat -b gd.c
      1  #include<stdio.h>
      2  int main()
@@ -118,6 +138,7 @@
 
 
history, tty, stty, mtools commands
+# Display command history
 godarda@gd:~$ history | tail -6
   127  xxd gd.c
   128  cat gd.c
@@ -126,6 +147,7 @@
   131  cat -b gd.c
   132  history | tail -6
 
+# Execute command by history number
 godarda@gd:~$ !132
 history | tail -6
   128  cat gd.c
@@ -134,18 +156,22 @@
   131  cat -b gd.c
   132  history | tail -6
   133  history | tail -6
-
godarda@gd:~$ tty +
+# Print filename of terminal connected to standard input +godarda@gd:~$ tty /dev/pts/3 +# Change and print terminal line settings godarda@gd:~$ stty speed 38400 baud; line = 0; -brkint -imaxbel iutf8 +# Utilities to access MS-DOS disks godarda@gd:~$ mtools Supported commands: mattrib, mbadblocks, mcat, mcd, mclasserase, mcopy, mdel, mdeltree mdir, mdoctorfat, mdu, mformat, minfo, mlabel, mmd, mmount mpartition, mrd, mread, mmove, mren, mshowfat, mshortname, mtoolstest mtype, mwrite, mzip -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdspezu.html b/pages/learn/linux/commands/gdspezu.html index 695af74..2b4d6cc 100644 --- a/pages/learn/linux/commands/gdspezu.html +++ b/pages/learn/linux/commands/gdspezu.html @@ -6,61 +6,80 @@
{{ page.title }}
conversion of text format
+# Convert to uppercase
 godarda@gd:~$ echo 'Hello, World!' | tr "[:lower:]" "[:upper:]"
 HELLO, WORLD!
 
+# Convert to lowercase
 godarda@gd:~$ echo 'HeLLo, WORLD!' | tr "[:upper:]" "[:lower:]"
 hello, world!
-
godarda@gd:~$ typeset -l lcase +
+# Declare lowercase variable +godarda@gd:~$ typeset -l lcase godarda@gd:~$ lcase="Hello, World!" godarda@gd:~$ echo $lcase hello, world! +# Declare uppercase variable godarda@gd:~$ typeset -u ucase godarda@gd:~$ ucase="Hello, World!" godarda@gd:~$ echo $ucase HELLO, WORLD! -
godarda@gd:~$ s1="HeLLo, WORLD!" +
+godarda@gd:~$ s1="HeLLo, WORLD!" godarda@gd:~$ echo $s1 HeLLo, WORLD! +# Convert to lowercase godarda@gd:~$ echo ${s1,,} hello, world! +# Convert to uppercase godarda@gd:~$ echo ${s1^^} HELLO, WORLD!
conversion of number systems
+# Convert decimal to octal
 godarda@gd:~$ printf "Octal of 65535 = %o\n" 65535
 Octal of 65535 = 177777
 
+# Convert decimal to hexadecimal
 godarda@gd:~$ printf "Hexadecimal of 65535 = %x\n" 65535
 Hexadecimal of 65535 = ffff
 
+# Convert decimal to float
 godarda@gd:~$ printf "Floating point in 65535 = %f\n" 65535
 Floating point in 65535 = 65535.000000
-
godarda@gd:~$ D2B=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}) +
+# Convert decimal to binary using array +godarda@gd:~$ D2B=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}) godarda@gd:~$ echo "Binary of 255 = "${D2B[255]} Binary of 255 = 11111111 +# Convert hexadecimal to decimal godarda@gd:~$ echo "Decimal of 01AE = "$((0x01AE)) Decimal of 01AE = 430 +# Convert binary to decimal godarda@gd:~$ echo "Decimal of 11111111 = "$((2#11111111)) Decimal of 11111111 = 255 +# Convert decimal to binary using bc godarda@gd:~$ echo "obase=2;255" | bc 11111111 +# Convert binary to decimal using bc godarda@gd:~$ echo "ibase=2;11111111" | bc 255 +# Convert decimal to base 7 using bc godarda@gd:~$ echo "obase=7;255" | bc 513 +# Convert decimal to hexadecimal using bc godarda@gd:~$ echo "obase=16;255" | bc FF -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdvmazz.html b/pages/learn/linux/commands/gdvmazz.html index 5222e3d..d464e23 100644 --- a/pages/learn/linux/commands/gdvmazz.html +++ b/pages/learn/linux/commands/gdvmazz.html @@ -6,36 +6,47 @@
{{ page.title }}
uname command with options
+# Print system information
 godarda@gd:~$ uname
 Linux
 
+# Print all system information
 godarda@gd:~$ uname -a
 Linux gd 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 
+# Print hardware platform
 godarda@gd:~$ uname -i
 x86_64
 
+# Print machine hardware name
 godarda@gd:~$ uname -m
 x86_64
 
+# Print network node hostname
 godarda@gd:~$ uname -n
 gd
 
+# Print operating system
 godarda@gd:~$ uname -o
 GNU/Linux
 
+# Print processor type
 godarda@gd:~$ uname -p
 x86_64
 
+# Print kernel release
 godarda@gd:~$ uname -r
 6.8.0-31-generic
 
+# Print kernel name
 godarda@gd:~$ uname -s
 Linux
 
+# Print kernel version
 godarda@gd:~$ uname -v
 #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024
 
+# Display help message
 godarda@gd:~$ uname --help
 Usage: uname [OPTION]...
 Print certain system information.  With no OPTION, same as -s.
@@ -57,6 +68,7 @@
 Full documentation at: https://www.gnu.org/software/coreutils/uname
 or available locally via: info '(coreutils) uname invocation'
 
+# Display version information
 godarda@gd:~$ uname --version
 uname (GNU coreutils) 9.4
 Copyright (C) 2023 Free Software Foundation, Inc.
@@ -64,9 +76,12 @@
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
-Written by David MacKenzie.
godarda@gd:~$ hostname +Written by David MacKenzie.
+# Show system hostname +godarda@gd:~$ hostname gd +# Lookup user information godarda@gd:~$ finger Login Name Tty Idle Login Time Office Office Phone godarda GoDarda *:0 May 31 10:48 (:0) @@ -74,6 +89,7 @@
lsb_release command with options
+# Show all distribution information
 godarda@gd:~$ lsb_release -a
 No LSB modules are available.
 Distributor ID:	Ubuntu
@@ -81,25 +97,31 @@
 Release:	24.04
 Codename:	noble
 
+# Show distribution codename
 godarda@gd:~$ lsb_release -c
 No LSB modules are available.
 Codename:	noble
 
+# Show distribution description
 godarda@gd:~$ lsb_release -d
 No LSB modules are available.
 Description:	Ubuntu 24.04 LTS
 
+# Show distributor ID
 godarda@gd:~$ lsb_release -i
 No LSB modules are available.
 Distributor ID: Ubuntu
 
+# Show distribution release number
 godarda@gd:~$ lsb_release -r
 No LSB modules are available.
 Release:	24.04
 
+# Show information in short format
 godarda@gd:~$ lsb_release -s
 No LSB modules are available.
 
+# Display help message
 godarda@gd:~$ lsb_release -h
 Usage: lsb_release [options]
 
@@ -116,26 +138,32 @@
 
 
System information using cat command
+# Print kernel version
 godarda@gd:~$ cat /proc/version
 Linux version 6.8.0-31-generic (buildd@lcy02-amd64-080) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024
 
+# Print kernel details
 godarda@gd:~$ cat /proc/sys/kernel/{ostype,osrelease,version}
 Linux
 6.8.0-31-generic
 #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024
 
+# Print distribution specific information
 godarda@gd:~$ cat /etc/lsb-release
 DISTRIB_ID=Ubuntu
 DISTRIB_RELEASE=24.04
 DISTRIB_CODENAME=noble
 DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"
 
+# Print system identification
 godarda@gd:~$ cat /etc/issue.net
 Ubuntu 24.04 LTS
 
+# Print Debian version
 godarda@gd:~$ cat /etc/debian_version
 trixie/sid
 
+# Print OS identification data
 godarda@gd:~$ cat /etc/os-release
 PRETTY_NAME="Ubuntu 24.04 LTS"
 NAME="Ubuntu"
@@ -150,4 +178,4 @@
 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
 UBUNTU_CODENAME=noble
 LOGO=ubuntu-logo
-
\ No newline at end of file +
diff --git a/pages/learn/linux/commands/gdwoddg.html b/pages/learn/linux/commands/gdwoddg.html index 3f95874..21b9545 100644 --- a/pages/learn/linux/commands/gdwoddg.html +++ b/pages/learn/linux/commands/gdwoddg.html @@ -6,10 +6,13 @@
{{ page.title }}
mv command to rename a file
+# List files in current directory
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Fedora.txt  Pictures  Templates   Videos
 gd.c   GD.java  Desktop  Downloads  Music   Public    Ubuntu.txt  Weekdays
-
godarda@gd:~$ mv Fedora.txt FEDORA.TXT +
+# Rename a file +godarda@gd:~$ mv Fedora.txt FEDORA.TXT godarda@gd:~$ ls a.out gd.cpp gd.py Documents FEDORA.TXT Pictures Templates Videos gd.c GD.java Desktop Downloads Music Public Ubuntu.txt Weekdays @@ -17,6 +20,7 @@
cp command to copy a file
+# Copy a file to another directory
 godarda@gd:~$ cp FEDORA.TXT /home/godarda/Documents/
 godarda@gd:~$ ls $cat /home/godarda/Documents/
 FEDORA.TXT
@@ -24,18 +28,23 @@
 
 
cp and mv commands to copy and move the files
+# Create a new directory
 godarda@gd:~$ mkdir Linux
+# Create empty files
 godarda@gd:~$ touch Ubuntu.txt Fedora.txt
+# Copy a file
 godarda@gd:~$ cp Ubuntu.txt Fedora.txt
 godarda@gd:~$ ls
 a.out   GD.java  Documents   Linux     Public      Videos
 gd.c    gd.py    Downloads   Music     Templates   Weekdays
 gd.cpp  Desktop  Fedora.txt  Pictures  Ubuntu.txt
 
+# Copy a file into a directory
 godarda@gd:~$ cp Ubuntu.txt /home/godarda/Linux/
 godarda@gd:~$ ls $cat /home/godarda/Linux/
 Ubuntu.txt
 
+# Move a file into a directory
 godarda@gd:~$ mv Fedora.txt /home/godarda/Linux/
 godarda@gd:~$ ls $cat /home/godarda/Linux/
 Fedora.txt  Ubuntu.txt
@@ -43,7 +52,8 @@
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Linux  Pictures  Templates   Videos
 gd.c   GD.java  Desktop  Downloads  Music  Public    Ubuntu.txt  Weekdays
+# Change directory
 godarda@gd:~$ cd Linux/
 godarda@gd:~/Linux$ ls
 Fedora.txt  Ubuntu.txt
-
\ No newline at end of file +
diff --git a/pages/learn/linux/commands/gdwzqca.html b/pages/learn/linux/commands/gdwzqca.html index c382884..d17bab9 100644 --- a/pages/learn/linux/commands/gdwzqca.html +++ b/pages/learn/linux/commands/gdwzqca.html @@ -6,17 +6,20 @@
{{ page.title }}
ps command
+# Report a snapshot of current processes
 godarda@gd:~$ ps
     PID TTY          TIME CMD
    3368 pts/0    00:00:00 bash
    3372 pts/0    00:00:00 ps
 
+# View all running processes
 godarda@gd:~$ ps -a
     PID TTY          TIME CMD
    2377 tty2     00:00:08 Xorg
    2417 tty2     00:00:00 gnome-session-b
    3373 pts/0    00:00:00 ps
 
+# View all running processes with user
 godarda@gd:~$ ps -aux
 USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 root           1  0.5  0.1 167952 11684 ?        Ss   18:24   0:01 /sbin/init sp
@@ -32,12 +35,13 @@
 root        3579  0.0  0.0   9492  3348 ?        S    18:30   0:00 /bin/bash /et
 root        3585  0.0  0.0   8272   776 ?        S    18:30   0:00 flock --nonbl
 root        3586  4.5  0.0   8168  2328 ?        DN   18:30   0:00 /usr/bin/upda
-kodingw+    3587  0.0  0.0  11888  3724 pts/0    R+   18:30   0:00 ps -aux
+godarda     3587  0.0  0.0  11888  3724 pts/0    R+   18:30   0:00 ps -aux
 godarda@gd:~$ 
 
Extract specific columns
+# View all processes
 godarda@gd:~$ ps -e
     PID TTY          TIME CMD
       1 ?        00:00:02 systemd
@@ -50,6 +54,7 @@
       9 ?        00:00:00 mm_percpu_wq
      10 ?        00:00:00 ksoftirqd/0
 
+# View specific columns
 godarda@gd:~$ ps -eo pid,ppid,ni
     PID    PPID  NI
       1       0   0
@@ -64,31 +69,36 @@
 
 
Sort processes based on column attributes
+# Sort processes by user
 godarda@gd:~$ ps aux --sort user
 USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 avahi        949  0.0  0.0   8808  3676 ?        Ss   18:25   0:00 avahi-daemon:
 avahi       1003  0.0  0.0   8544   356 ?        S    18:25   0:00 avahi-daemon:
-kodingw+    2286  0.0  0.1  19472 10760 ?        Ss   18:26   0:00 /lib/systemd/
-kodingw+    2287  0.0  0.0 169324  3816 ?        S    18:26   0:00 (sd-pam)
-kodingw+    2300  0.0  0.2 2268840 19676 ?       S<sl 18:27   0:00 /usr/bin/puls
-kodingw+    2302  0.0  0.3 511384 24320 ?        SNsl 18:27   0:00 /usr/libexec/
-kodingw+    2305  0.0  0.0   8452  5624 ?        Ss   18:27   0:00 /usr/bin/dbus
-kodingw+    2310  0.0  0.0 240184  7716 ?        Sl   18:27   0:00 /usr/bin/gnom
-kodingw+    2325  0.0  0.0 239696  7820 ?        Ssl  18:27   0:00 /usr/libexec/
+godarda     2286  0.0  0.1  19472 10760 ?        Ss   18:26   0:00 /lib/systemd/
+godarda     2287  0.0  0.0 169324  3816 ?        S    18:26   0:00 (sd-pam)
+godarda     2300  0.0  0.2 2268840 19676 ?       S<sl 18:27   0:00 /usr/bin/puls
+godarda     2302  0.0  0.3 511384 24320 ?        SNsl 18:27   0:00 /usr/libexec/
+godarda     2305  0.0  0.0   8452  5624 ?        Ss   18:27   0:00 /usr/bin/dbus
+godarda     2310  0.0  0.0 240184  7716 ?        Sl   18:27   0:00 /usr/bin/gnom
+godarda     2325  0.0  0.0 239696  7820 ?        Ssl  18:27   0:00 /usr/libexec/
 
Extract specific process
+# Filter specific process
 godarda@gd:~$ ps -aux | grep mysql
 mysql       1172  1.1  4.4 2120856 352952 ?      Ssl  18:25   0:04 /usr/sbin/mysqld
-kodingw+    3607  0.0  0.0   8900   724 pts/0    S+   18:32   0:00 grep mysql
+godarda     3607  0.0  0.0   8900   724 pts/0    S+   18:32   0:00 grep mysql
 
+# Look up process ID
 godarda@gd:~$ pgrep mysql
 1172
 
+# List process name and ID
 godarda@gd:~$ pgrep -l mysql
 1172 mysqld
 
+# View process by ID
 godarda@gd:~$ ps -lp 1172
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
 4 S   122    1172       1  1  80   0 - 530214 -     ?        00:00:10 mysqld
@@ -96,25 +106,32 @@
 
 
Assign and change the process priority
+# Switch to root user
 godarda@gd:~$ su
-Password: 
+Password:
+# View processes in long format
 root@gd:/home/godarda#  ps -l
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
 4 S     0    4426    4424  0  80   0 -  2875 do_wai pts/0    00:00:00 su
 4 S     0    4427    4426  0  80   0 -  2546 do_wai pts/0    00:00:00 bash
 4 R     0    4440    4427  0  80   0 -  2849 -      pts/0    00:00:00 ps
+# Print current niceness
 root@gd:/home/godarda#  nice
 0
+# Run program with modified scheduling priority
 root@gd:/home/godarda#  nice -n 5 bash
+# View processes in long format
 root@gd:/home/godarda#  ps -l
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
 4 S     0    4426    4424  0  80   0 -  2875 do_wai pts/0    00:00:00 su
 4 S     0    4427    4426  0  80   0 -  2546 do_wai pts/0    00:00:00 bash
 0 S     0    4442    4427  0  85   5 -  2545 do_wai pts/0    00:00:00 bash
 4 R     0    4453    4442  0  85   5 -  2849 -      pts/0    00:00:00 ps
+# Alter priority of running process
 root@gd:/home/godarda#  renice -0 4442
 4442 (process ID) old priority 5, new priority 0
 
+# View processes in long format
 root@gd:/home/godarda#  ps -l
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
 4 S     0    4426    4424  0  80   0 -  2875 do_wai pts/0    00:00:00 su
@@ -123,20 +140,23 @@
 4 R     0    4455    4442  0  80   0 -  2849 -      pts/0    00:00:00 ps
 
 
+# Alter priority of running process
 root@gd:/home/godarda#  renice -21 4442
 4442 (process ID) old priority 0, new priority -20
 
+# View processes in long format
 root@gd:/home/godarda#  ps -l
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
 4 S     0    4426    4424  0  80   0 -  2875 do_wai pts/0    00:00:00 su
 4 S     0    4427    4426  0  80   0 -  2546 do_wai pts/0    00:00:00 bash
 0 S     0    4442    4427  0  60 -20 -  2545 do_wai pts/0    00:00:00 bash
 4 R     0    4476    4442  0  60 -20 -  2849 -      pts/0    00:00:00 ps
-root@gd:/home/godarda#  
+root@gd:/home/godarda# 
 
pstree command
+# Display a tree of processes
 godarda@gd:~$ pstree
 systemd─┬─ModemManager───2*[{ModemManager}]
         β”œβ”€NetworkManager───2*[{NetworkManager}]
@@ -161,34 +181,35 @@
         β”‚             β”œβ”€ibus-engine-sim───2*[{ibus-engine-sim}]
         β”‚             β”œβ”€ibus-extension-───3*[{ibus-extension-}]
         β”‚             β”œβ”€ibus-ui-gtk3───3*[{ibus-ui-gtk3}]
-...  
+...
 
top command
+# Display Linux processes
 godarda@gd:~$ top
 top - 18:38:14 up 13 min,  1 user,  load average: 0.63, 0.87, 0.87
 Tasks: 224 total,   1 running, 223 sleeping,   0 stopped,   0 zombie
 %Cpu(s):  4.7 us,  2.0 sy,  0.0 ni, 93.1 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
 MiB Mem :   7744.8 total,   4550.7 free,   1583.5 used,   1610.6 buff/cache
-MiB Swap:   3815.0 total,   3815.0 free,      0.0 used.   5675.2 avail Mem 
-
-    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND  
-   3099 kodingw+  20   0 2987604 367320 170248 S   8.0   4.6   0:40.19 MainThr+ 
-   2377 kodingw+  20   0 1143856  87276  54980 S   7.0   1.1   0:32.62 Xorg     
-   2629 kodingw+  20   0 4488208 257140 101068 S   6.0   3.2   0:40.69 gnome-s+ 
-   3357 kodingw+  20   0  962192  51452  39424 S   3.0   0.6   0:08.14 gnome-t+ 
-   3296 kodingw+  20   0 2684072 250256 153392 S   2.0   3.2   0:18.56 Web Con+ 
-    433 root     -51   0       0      0      0 S   1.0   0.0   0:02.03 irq/87-+ 
-      1 root      20   0  167952  11684   8228 S   0.7   0.1   0:02.50 systemd  
-   1172 mysql     20   0 2120856 352952  33540 S   0.7   4.5   0:08.17 mysqld   
-   2506 kodingw+  20   0  311420   7728   6056 S   0.7   0.1   0:03.57 ibus-da+ 
-   3737 kodingw+  20   0   12168   4240   3444 R   0.7   0.1   0:00.14 top      
-      8 root      20   0       0      0      0 I   0.3   0.0   0:01.17 kworker+ 
-   2515 kodingw+  20   0  674584  58852  39052 S   0.3   0.7   0:01.86 ibus-ex+ 
-   2592 kodingw+  20   0  162684   7048   6412 S   0.3   0.1   0:00.99 ibus-en+ 
-   3203 kodingw+  20   0 2765492 248912 139908 S   0.3   3.1   1:08.42 Web Con+ 
-   3610 root      20   0       0      0      0 I   0.3   0.0   0:00.56 kworker+ 
-      2 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kthreadd 
-      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp   
-
\ No newline at end of file +MiB Swap: 3815.0 total, 3815.0 free, 0.0 used. 5675.2 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 3099 godarda 20 0 2987604 367320 170248 S 8.0 4.6 0:40.19 MainThr+ + 2377 godarda 20 0 1143856 87276 54980 S 7.0 1.1 0:32.62 Xorg + 2629 godarda 20 0 4488208 257140 101068 S 6.0 3.2 0:40.69 gnome-s+ + 3357 godarda 20 0 962192 51452 39424 S 3.0 0.6 0:08.14 gnome-t+ + 3296 godarda 20 0 2684072 250256 153392 S 2.0 3.2 0:18.56 Web Con+ + 433 root -51 0 0 0 0 S 1.0 0.0 0:02.03 irq/87-+ + 1 root 20 0 167952 11684 8228 S 0.7 0.1 0:02.50 systemd + 1172 mysql 20 0 2120856 352952 33540 S 0.7 4.5 0:08.17 mysqld + 2506 godarda 20 0 311420 7728 6056 S 0.7 0.1 0:03.57 ibus-da+ + 3737 godarda 20 0 12168 4240 3444 R 0.7 0.1 0:00.14 top + 8 root 20 0 0 0 0 I 0.3 0.0 0:01.17 kworker+ + 2515 godarda 20 0 674584 58852 39052 S 0.3 0.7 0:01.86 ibus-ex+ + 2592 godarda 20 0 162684 7048 6412 S 0.3 0.1 0:00.99 ibus-en+ + 3203 godarda 20 0 2765492 248912 139908 S 0.3 3.1 1:08.42 Web Con+ + 3610 root 20 0 0 0 0 I 0.3 0.0 0:00.56 kworker+ + 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd + 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp +
diff --git a/pages/learn/linux/commands/gdyzygf.html b/pages/learn/linux/commands/gdyzygf.html index 3fbee44..c4fe33a 100644 --- a/pages/learn/linux/commands/gdyzygf.html +++ b/pages/learn/linux/commands/gdyzygf.html @@ -6,15 +6,18 @@
{{ page.title }}
sort tsort and grep commands with options
+# List files in current directory
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Music     Public     Videos
 gd.c   GD.java  Desktop  Downloads  Pictures  Templates
 
+# Create a file
 godarda@gd:~$ touch Weekdays
 godarda@gd:~$ ls
 a.out  gd.cpp   gd.py    Documents  Music     Public     Videos
 gd.c   GD.java  Desktop  Downloads  Pictures  Templates  Weekdays
 
+# Display file content
 godarda@gd:~$ cat Weekdays
 Weekdays
 Monday
@@ -28,6 +31,7 @@
 Thursday
 Friday
 
+# Sort lines of text file
 godarda@gd:~$ sort Weekdays
 Friday
 Friday
@@ -41,6 +45,7 @@
 Wednesday
 Weekdays
 
+# Sort and remove duplicates
 godarda@gd:~$ sort Weekdays | uniq
 Friday
 Monday
@@ -48,10 +53,13 @@
 Tuesday
 Wednesday
 Weekdays
-
godarda@gd:~$ tsort Weekdays +
+# Perform topological sort +godarda@gd:~$ tsort Weekdays tsort: Weekdays: input contains an odd number of tokens -godarda@gd:~$ cat Weekdays +# Display file content +godarda@gd:~$ cat Weekdays Weekdays Monday Tuesday @@ -63,6 +71,7 @@ Wednesday Thursday +# Perform topological sort godarda@gd:~$ tsort Weekdays Weekdays Monday @@ -71,7 +80,8 @@ Thursday Friday -godarda@gd:~$ tac Weekdays +# Concatenate and print file in reverse +godarda@gd:~$ tac Weekdays Thursday Wednesday Tuesday @@ -82,7 +92,9 @@ Tuesday Monday Weekdays -
godarda@gd:~$ cat Weekdays | grep day +
+# Print lines matching a pattern +godarda@gd:~$ cat Weekdays | grep day Weekdays Monday Tuesday @@ -94,6 +106,7 @@ Wednesday Thursday +# Print lines matching a pattern godarda@gd:~$ grep day Weekdays Weekdays Monday @@ -106,7 +119,8 @@ Wednesday Thursday -godarda@gd:~$ grep -v days Weekdays +# Invert match +godarda@gd:~$ grep -v days Weekdays Monday Tuesday Wednesday @@ -117,7 +131,8 @@ Wednesday Thursday -godarda@gd:~$ grep -i days Weekdays +# Ignore case +godarda@gd:~$ grep -i days Weekdays Weekdays -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/linux/commands/gdzbgoi.html b/pages/learn/linux/commands/gdzbgoi.html index 354a76b..3f884fd 100644 --- a/pages/learn/linux/commands/gdzbgoi.html +++ b/pages/learn/linux/commands/gdzbgoi.html @@ -6,176 +6,205 @@
{{ page.title }}
date and time commands with options
+# Display current date and time
 godarda@gd:~$ date
 Sunday 31 May 2020 10:52:00 AM IST
 
+# Show system uptime
 godarda@gd:~$ uptime
  10:53:11 up 8 min,  1 user,  load average: 0.65, 1.44, 0.93
 
+# Measure command execution time
 godarda@gd:~$ time
 real	0m0.000s
 user	0m0.000s
 sys	0m0.000s
 
+# Print accumulated user and system times
 godarda@gd:~$ times
 0m0.022s 0m0.012s
 0m0.021s 0m0.016s
-
godarda@gd:~$ date +"%D %H:%M:%S" +
+# Display date in MM/DD/YY format with time +godarda@gd:~$ date +"%D %H:%M:%S" 05/31/20 10:54:52 +# Display date with epoch timestamp godarda@gd:~$ date +"%D %H:%M:%s" 05/31/20 10:55:1590902704 +# Display date with month number and epoch godarda@gd:~$ date +"%D %H:%m:%s" 05/31/20 10:05:1590902707 +# Display date with abbreviated month and epoch godarda@gd:~$ date +"%D %h:%m:%s" 05/31/20 May:05:1590902711 +# Display day, month, and epoch godarda@gd:~$ date +"%d %h:%m:%s" 31 May:05:1590902716 +# Display full weekday, month, and day godarda@gd:~$ date +"%A %B %d" Sunday May 31 +# Display month number godarda@gd:~$ date +%m 05 +# Display abbreviated month name godarda@gd:~$ date +%h May +# Display month name and number godarda@gd:~$ date +"%h %m" May 05 +# Display date and time with seconds godarda@gd:~$ date +"%h %m %d %T" May 05 31 10:56:48
cal command with options
+# Display current month calendar
 godarda@gd:~$ cal
-      May 2020        
-Su Mo Tu We Th Fr Sa  
-                1  2  
- 3  4  5  6  7  8  9  
-10 11 12 13 14 15 16  
-17 18 19 20 21 22 23  
-24 25 26 27 28 29 30  
-31                    
+      May 2020
+Su Mo Tu We Th Fr Sa
+                1  2
+ 3  4  5  6  7  8  9
+10 11 12 13 14 15 16
+17 18 19 20 21 22 23
+24 25 26 27 28 29 30
+31
+# Try to display calendar for year 0 (error)
 godarda@gd:~$ cal 5 0
 cal: year `0' not in range 1..9999
 
+# Display calendar for specific month and year
 godarda@gd:~$ cal 2 2020
-   February 2020      
-Su Mo Tu We Th Fr Sa  
-                   1  
- 2  3  4  5  6  7  8  
- 9 10 11 12 13 14 15  
-16 17 18 19 20 21 22  
-23 24 25 26 27 28 29  
-
+   February 2020
+Su Mo Tu We Th Fr Sa
+                   1
+ 2  3  4  5  6  7  8
+ 9 10 11 12 13 14 15
+16 17 18 19 20 21 22
+23 24 25 26 27 28 29
+
+# Command substitution (inline)
 godarda@gd:~$ echo $(cal)
 May 2020 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 
+# Command substitution (preserve formatting)
 godarda@gd:~$ echo "$(cal)"
-      May 2020        
-Su Mo Tu We Th Fr Sa  
-                1  2  
- 3  4  5  6  7  8  9  
-10 11 12 13 14 15 16  
-17 18 19 20 21 22 23  
-24 25 26 27 28 29 30  
-31                    
-
godarda@gd:~$ cal -j 2021 + May 2020 +Su Mo Tu We Th Fr Sa + 1 2 + 3 4 5 6 7 8 9 +10 11 12 13 14 15 16 +17 18 19 20 21 22 23 +24 25 26 27 28 29 30 +31 +
+# Display calendar with Julian days +godarda@gd:~$ cal -j 2021 + 2021 + January February +... +
+# Display calendar for the whole year +godarda@gd:~$ cal -y 2021 2021 - January February - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 1 2 32 33 34 35 36 37 - 3 4 5 6 7 8 9 38 39 40 41 42 43 44 - 10 11 12 13 14 15 16 45 46 47 48 49 50 51 - 17 18 19 20 21 22 23 52 53 54 55 56 57 58 - 24 25 26 27 28 29 30 59 - 31 - - March April - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 60 61 62 63 64 65 91 92 93 - 66 67 68 69 70 71 72 94 95 96 97 98 99 100 - 73 74 75 76 77 78 79 101 102 103 104 105 106 107 - 80 81 82 83 84 85 86 108 109 110 111 112 113 114 - 87 88 89 90 115 116 117 118 119 120 - - - May June - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 121 152 153 154 155 156 -122 123 124 125 126 127 128 157 158 159 160 161 162 163 -129 130 131 132 133 134 135 164 165 166 167 168 169 170 -136 137 138 139 140 141 142 171 172 173 174 175 176 177 -143 144 145 146 147 148 149 178 179 180 181 -150 151 - - July August - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 182 183 184 213 214 215 216 217 218 219 -185 186 187 188 189 190 191 220 221 222 223 224 225 226 -192 193 194 195 196 197 198 227 228 229 230 231 232 233 -199 200 201 202 203 204 205 234 235 236 237 238 239 240 -206 207 208 209 210 211 212 241 242 243 - - - September October - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 244 245 246 247 274 275 -248 249 250 251 252 253 254 276 277 278 279 280 281 282 -255 256 257 258 259 260 261 283 284 285 286 287 288 289 -262 263 264 265 266 267 268 290 291 292 293 294 295 296 -269 270 271 272 273 297 298 299 300 301 302 303 - 304 - - November December - Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 305 306 307 308 309 310 335 336 337 338 -311 312 313 314 315 316 317 339 340 341 342 343 344 345 -318 319 320 321 322 323 324 346 347 348 349 350 351 352 -325 326 327 328 329 330 331 353 354 355 356 357 358 359 -332 333 334 360 361 362 363 364 365 -
godarda@gd:~$ cal -y 2021 + January February + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 32 33 34 35 36 37 + 3 4 5 6 7 8 9 38 39 40 41 42 43 44 + 10 11 12 13 14 15 16 45 46 47 48 49 50 51 + 17 18 19 20 21 22 23 52 53 54 55 56 57 58 + 24 25 26 27 28 29 30 59 + 31 + + March April + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 60 61 62 63 64 65 91 92 93 + 66 67 68 69 70 71 72 94 95 96 97 98 99 100 + 73 74 75 76 77 78 79 101 102 103 104 105 106 107 + 80 81 82 83 84 85 86 108 109 110 111 112 113 114 + 87 88 89 90 115 116 117 118 119 120 + + + May June + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 121 152 153 154 155 156 +122 123 124 125 126 127 128 157 158 159 160 161 162 163 +129 130 131 132 133 134 135 164 165 166 167 168 169 170 +136 137 138 139 140 141 142 171 172 173 174 175 176 177 +143 144 145 146 147 148 149 178 179 180 181 +150 151 + + July August + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 182 183 184 213 214 215 216 217 218 219 +185 186 187 188 189 190 191 220 221 222 223 224 225 226 +192 193 194 195 196 197 198 227 228 229 230 231 232 233 +199 200 201 202 203 204 205 234 235 236 237 238 239 240 +206 207 208 209 210 211 212 241 242 243 + + + September October + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 244 245 246 247 274 275 +248 249 250 251 252 253 254 276 277 278 279 280 281 282 +255 256 257 258 259 260 261 283 284 285 286 287 288 289 +262 263 264 265 266 267 268 290 291 292 293 294 295 296 +269 270 271 272 273 297 298 299 300 301 302 303 + 304 + + November December + Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 305 306 307 308 309 310 335 336 337 338 +311 312 313 314 315 316 317 339 340 341 342 343 344 345 +318 319 320 321 322 323 324 346 347 348 349 350 351 352 +325 326 327 328 329 330 331 353 354 355 356 357 358 359 +332 333 334 360 361 362 363 364 365 +
# Display calendar for the whole year +godarda@gd:~$ cal -y 2021 2021 - January February March -Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 1 2 1 2 3 4 5 6 1 2 3 4 5 6 - 3 4 5 6 7 8 9 7 8 9 10 11 12 13 7 8 9 10 11 12 13 -10 11 12 13 14 15 16 14 15 16 17 18 19 20 14 15 16 17 18 19 20 -17 18 19 20 21 22 23 21 22 23 24 25 26 27 21 22 23 24 25 26 27 -24 25 26 27 28 29 30 28 28 29 30 31 -31 - - April May June -Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 1 2 3 1 1 2 3 4 5 - 4 5 6 7 8 9 10 2 3 4 5 6 7 8 6 7 8 9 10 11 12 -11 12 13 14 15 16 17 9 10 11 12 13 14 15 13 14 15 16 17 18 19 -18 19 20 21 22 23 24 16 17 18 19 20 21 22 20 21 22 23 24 25 26 -25 26 27 28 29 30 23 24 25 26 27 28 29 27 28 29 30 - 30 31 - - July August September -Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 1 2 3 1 2 3 4 5 6 7 1 2 3 4 - 4 5 6 7 8 9 10 8 9 10 11 12 13 14 5 6 7 8 9 10 11 -11 12 13 14 15 16 17 15 16 17 18 19 20 21 12 13 14 15 16 17 18 -18 19 20 21 22 23 24 22 23 24 25 26 27 28 19 20 21 22 23 24 25 -25 26 27 28 29 30 31 29 30 31 26 27 28 29 30 - - - October November December -Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa - 1 2 1 2 3 4 5 6 1 2 3 4 - 3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11 -10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18 -17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25 -24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 -31 -godarda@gd:~$ -
\ No newline at end of file + January February March +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 1 2 3 4 5 6 1 2 3 4 5 6 + 3 4 5 6 7 8 9 7 8 9 10 11 12 13 7 8 9 10 11 12 13 +10 11 12 13 14 15 16 14 15 16 17 18 19 20 14 15 16 17 18 19 20 +17 18 19 20 21 22 23 21 22 23 24 25 26 27 21 22 23 24 25 26 27 +24 25 26 27 28 29 30 28 28 29 30 31 +31 + + April May June +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 3 1 1 2 3 4 5 + 4 5 6 7 8 9 10 2 3 4 5 6 7 8 6 7 8 9 10 11 12 +11 12 13 14 15 16 17 9 10 11 12 13 14 15 13 14 15 16 17 18 19 +18 19 20 21 22 23 24 16 17 18 19 20 21 22 20 21 22 23 24 25 26 +25 26 27 28 29 30 23 24 25 26 27 28 29 27 28 29 30 + 30 31 + + July August September +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 3 1 2 3 4 5 6 7 1 2 3 4 + 4 5 6 7 8 9 10 8 9 10 11 12 13 14 5 6 7 8 9 10 11 +11 12 13 14 15 16 17 15 16 17 18 19 20 21 12 13 14 15 16 17 18 +18 19 20 21 22 23 24 22 23 24 25 26 27 28 19 20 21 22 23 24 25 +25 26 27 28 29 30 31 29 30 31 26 27 28 29 30 + + + October November December +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 1 2 3 4 5 6 1 2 3 4 + 3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11 +10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18 +17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25 +24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 +31 +godarda@gd:~$ +
diff --git a/pages/learn/lisp/fundamentals/gdggadz.html b/pages/learn/lisp/fundamentals/gdggadz.html index 84e02bc..b0218ba 100644 --- a/pages/learn/lisp/fundamentals/gdggadz.html +++ b/pages/learn/lisp/fundamentals/gdggadz.html @@ -8,47 +8,56 @@
 godarda@gd:~$ maxima
 ...
+# Calculate the factorial of 50
 (%i1) 50!;
 (%o1)  30414093201713378043612608166064768844377641568960512000000000000
 
+# Calculate 2 to the power of 64
 (%i2) 2^64;
 (%o2)                        18446744073709551616
 
+# Define a function f(x)
 (%i3) f(x):=x^8;
                                            8
 (%o3)                             f(x) := x
 
+# Evaluate f(10)
 (%i4) f(10);
 (%o4)                              100000000
 
+# Evaluate f(5)
 (%i5) f(5);
 (%o5)                               390625
 
+# Calculate the sine of pi/3
 (%i6) sin(%pi/3);
                                     sqrt(3)
 (%o6)                               -------
                                        2
 
+# Factor the polynomial
 (%i7) factor(x^2+x-20);
 (%o7)                           (x - 4) (x + 5)
 
Units
+# Load the unit package
 (%i8) load(unit);
-******************************************************************* 
-*                       Units version 0.50                        * 
-*          Definitions based on the NIST Reference on             * 
-*              Constants, Units, and Uncertainty                  * 
-*       Conversion factors from various sources including         * 
-*                   NIST and the GNU units package                * 
-******************************************************************* 
- 
-Redefining necessary functions... 
-Initializing unit arrays... 
-Done. 
+*******************************************************************
+*                       Units version 0.50                        *
+*          Definitions based on the NIST Reference on             *
+*              Constants, Units, and Uncertainty                  *
+*       Conversion factors from various sources including         *
+*                   NIST and the GNU units package                *
+*******************************************************************
+
+Redefining necessary functions...
+Initializing unit arrays...
+Done.
 (%o8)        /usr/share/maxima/5.41.0/share/contrib/unit/unit.mac
 
+# Check definitions of derived units
 (%i9) [N,Pa,J,W,C,V,F];
                                   2      2           2   2  4
                   kg m   kg   kg m   kg m        kg m   A  s
@@ -56,6 +65,7 @@
                     2      2    2      3            3       2
                    s    m s    s      s          A s    kg m
 
+# Check definitions of derived units
 (%i10) [Ohm,T,H,lm,lx];
                               2            2
                           kg m    kg   kg m       cd
@@ -63,11 +73,13 @@
                            2  3     2   2  2       2
                           A  s   A s   A  s       m
 
+# Calculate force from mass and acceleration
 (%i11) mass:5*kg $ acc:1.8*m/s^2 $ force:mass*acc;
                                        kg m
 (%o13)                            (9) (----)
                                          2
                                         s
+# Calculate kinetic energy
 (%i14) mass:15*kg $ velocity:5*m/s $ KE=0.5*mass*velocity^2;
                                                2
                                            kg m
@@ -75,17 +87,21 @@
                                              2
                                             s
 
+# Set preferred units for output
 (%i17) setunits([N,J]);
 (%o17)                               done
 
+# Calculate using preferred units
 (%i18) [(5*kg)*(26.8*m/s^2),(1.5*N)*(3*m)];
                                           9
 (%o18)                       [(134) (N), (-) (J)]
                                           2
 
+# Forget preferred units
 (%i19) uforget([N,J]);
 (%o19)                          [false, false]
 
+# Calculate showing base units
 (%i20) [(5*kg)*(26.8*m/s^2),(1.5*N)*(3*m)];
                                                    2
                                    kg m    9   kg m
@@ -94,4 +110,4 @@
                                     s           s
 
 (%i21) CTRL+D to Exit;
-
\ No newline at end of file +
diff --git a/pages/learn/lisp/fundamentals/gdggdyw.html b/pages/learn/lisp/fundamentals/gdggdyw.html index 62b15ed..61def74 100644 --- a/pages/learn/lisp/fundamentals/gdggdyw.html +++ b/pages/learn/lisp/fundamentals/gdggdyw.html @@ -8,143 +8,184 @@
 godarda@gd:~$ clisp
 ...
+# Add two numbers
 [1]> (+ 7 19)
 26
 
+# Add multiple numbers
 [2]> (+ 7 93 100 900)
-1100 
+1100
 
+# Add two numbers
 [3]> (+ 7 93)
-100 
+100
 
-[4]> (- 7 93) 
--86 
+# Subtract two numbers
+[4]> (- 7 93)
+-86
 
+# Multiply two numbers
 [5]> (* 7 93)
-651 
+651
 
+# Attempt division by zero
 [6]> (/ 1 0)
-*** - /: division by zero 
-The following restarts are available: 
-ABORT          :R1      Abort main loop 
+*** - /: division by zero
+The following restarts are available:
+ABORT          :R1      Abort main loop
+# Exit the error loop
 [7]> :q
 
+# Divide two numbers returning a rational
 [8]> (/ 7 93)
-7/93 
+7/93
 
+# Divide two numbers returning a float
 [9]> (/ 7 93.0)
 0.07526882
 
+# Check if the expression equals 100
 [10]> (= 100(+ 7 93))
 T
+# Display the value of PI
 [11]
> PI -3.1415926535897932385L0 +3.1415926535897932385L0 +# Display the value of pi (case-insensitive) [12]> pi 3.1415926535897932385L0
String operations
+# Print a string literal
 [1]> "Hello World"
 "Hello World"
 
+# Get the length of the string
 [2]> (length "Hello World")
-11 
+11
 
+# Get the character at index 0
 [3]> (char "Hello World"0)
-#\H 
+#\H
 
+# Get the character at index 10
 [4]> (char "Hello World"10)
-#\d 
+#\d
 
+# Return the symbol HELLO
 [5]> 'hello
-HELLO 
+HELLO
 
+# Return a symbol with mixed case using escape
 [6]> 'h\ello
-|HeLLO| 
+|HeLLO|
 
+# Return a symbol preserving case using bars
 [7]> 'h|ello|
 |Hello|
 
type-of function
+# Check the type of the number 0
 [1]> (type-of 0)
-BIT 
+BIT
 
+# Check the type of the number 1
 [2]> (type-of 1)
-BIT 
+BIT
 
+# Check the type of the number 2
 [3]> (type-of 2)
-(INTEGER 0 281474976710655) 
+(INTEGER 0 281474976710655)
 
+# Check the type of a float literal
 [4]> (type-of '1e2)
-SINGLE-FLOAT 
+SINGLE-FLOAT
 
+# Check the type of the constant pi
 [5]> (type-of pi)
-LONG-FLOAT 
+LONG-FLOAT
 
+# Check the type of the symbol pi
 [6]> (type-of 'pi)
-SYMBOL 
+SYMBOL
 
+# Check the type of the + variable
 [7]> (type-of +)
-CONS 
+CONS
 
+# Check the type of the - variable
 [8]> (type-of -)
-CONS 
+CONS
 
+# Check the type of the * variable
 [9]> (type-of *)
-SYMBOL 
+SYMBOL
 
+# Check the type of the / variable
 [10]> (type-of /)
-CONS 
+CONS
 
+# Check the type of a string
 [11]> (type-of "Hello World")
-(SIMPLE-BASE-STRING 11) 
+(SIMPLE-BASE-STRING 11)
 
+# Check the type of the *package* variable
 [12]> (type-of *package*)
-PACKAGE 
+PACKAGE
 
symbol-name function
+# Get the name of the symbol 'hello
 [1]> (symbol-name 'hello)
-"HELLO" 
+"HELLO"
 
+# Get the name of the symbol '|hello|
 [2]> (symbol-name '|hello|)
 "hello"
 
+# Check if the symbol name equals "Hello"
 [3]> (string=(symbol-name'h|ello|)"Hello")
-T 
+T
 
eql function
+# Check if symbol 'A is eql to 'a
 [1]> (eql'A'a)
-T 
+T
 
+# Check if integer 50 is eql to float 50.0
 [2]> (eql 50 50.0)
-NIL 
+NIL
 
+# Check if two integers are equal
 [3]> (eql 50 50)
-T 
+T
 
random function
+# Generate a random integer up to 500
 [1]> (random 500)
-153 
+153
 
+# Generate a random float up to 500.0
 [2]> (random 500.0)
-497.5427 
+497.5427
 
remove function
+# Remove all occurrences of 1 from the list
 [1]> (remove 1'(4 1 5 1 7 2 9 1 5 2 1))
-(4 5 7 2 9 5 2) 
+(4 5 7 2 9 5 2)
 
+# Remove all occurrences of 'r from the list
 [2]> (remove 'r'(r a d a r))
 (A D A)
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdeuazw.html b/pages/learn/mongodb/crud/gdeuazw.html index db5f32e..fcf35e0 100644 --- a/pages/learn/mongodb/crud/gdeuazw.html +++ b/pages/learn/mongodb/crud/gdeuazw.html @@ -8,15 +8,18 @@ godarda@gd:~$ mongosh ... +# List all databases DB> show dbs DB 8.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# List all collections DB> db.getCollectionNames() [ "holders" ] +# Insert a single document DB> db.holders.insertOne( ... { ... account_no: 2562348989, @@ -38,6 +41,7 @@
Insert multiple documents
+# Insert multiple documents
 DB> db.holders.insertMany([
 ... {
 ... account_no: 2562348990,
@@ -90,18 +94,22 @@
 
 
Show databases and collection info
+# List all databases
 DB> show databases
 DB       40.00 KiB
 admin    40.00 KiB
 config  108.00 KiB
 local    40.00 KiB
 
+# Count total documents
 DB> db.holders.countDocuments()
 4
 
+# Estimate total documents
 DB> db.holders.estimatedDocumentCount()
 4
 
+# Get collection details
 DB> db.getCollectionInfos()
 [
   {
@@ -115,4 +123,4 @@
     idIndex: { v: 2, key: { _id: 1 }, name: '_id_' }
   }
 ]
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdhydqg.html b/pages/learn/mongodb/crud/gdhydqg.html index 044cfa2..eacab84 100644 --- a/pages/learn/mongodb/crud/gdhydqg.html +++ b/pages/learn/mongodb/crud/gdhydqg.html @@ -8,15 +8,18 @@ godarda@gd:~$ mongosh ... +# List all databases DB> show dbs DB 72.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# List all collections DB> db.getCollectionNames() [ "holders" ] +# Find all documents DB> db.holders.find() [ { @@ -60,4 +63,4 @@ loan: [ { Personal: null, Home: null, Car: null } ] } ] -
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdhzgdy.html b/pages/learn/mongodb/crud/gdhzgdy.html index a3daf3b..214cf7b 100644 --- a/pages/learn/mongodb/crud/gdhzgdy.html +++ b/pages/learn/mongodb/crud/gdhzgdy.html @@ -8,15 +8,18 @@ godarda@gd:~$ mongosh ... +# List all databases DB> show dbs DB 72.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# List all collections DB> db.getCollectionNames() [ "holders" ] +# Find by city DB> db.holders.find({city: 'Phoenix'}) [ { @@ -31,6 +34,7 @@ } ] +# Find by account number DB> db.holders.find({account_no: 2562348989}) [ { @@ -48,6 +52,7 @@
Find documents using $and operator
+# Find using AND operator
 DB> db.holders.find(
 ... {$and: [{city: 'Irvine'},{account_no: 2562348991}]}
 ... )
@@ -67,6 +72,7 @@
 
 
Find documents using $or operator
+# Find using OR operator
 DB> db.holders.find(
 ... {$or: [{city: 'Irvine'},{account_no: 2562348991}]}
 ... )
@@ -96,6 +102,7 @@
 
 
Find documents using $lte operator
+# Find using Less Than or Equal
 DB> db.holders.find(
 ... {account_no:{$lte: 2562348990}}
 ... )
@@ -125,6 +132,7 @@
 
 
Find documents using $not operator
+# Find using NOT operator
 DB> db.holders.find(
 ... {account_no:{$not:{$lte: 2562348990}}}
 ... )
@@ -154,7 +162,8 @@
 
 
Find documents using $nor operator
-DB> db.holders.find( 
+# Find using NOR operator
+DB> db.holders.find(
 ... {$nor:[{account_no: 2562348989},{account_no: 2562348991}]}
 ... )
 [
@@ -179,4 +188,4 @@
     loan: [ { Personal: null, Home: null, Car: null } ]
   }
 ]
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdrmzzy.html b/pages/learn/mongodb/crud/gdrmzzy.html index 62311a0..c671bf7 100644 --- a/pages/learn/mongodb/crud/gdrmzzy.html +++ b/pages/learn/mongodb/crud/gdrmzzy.html @@ -8,15 +8,18 @@ godarda@gd:~$ mongosh ... +# List all databases DB> show dbs DB 72.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# List all collections DB> db.getCollectionNames() [ "holders" ] +# Projection to include specific fields DB> db.holders.find({},{name:1,city:1,_id:0}) [ { name: 'James Moore', city: 'Phoenix' }, @@ -28,6 +31,7 @@
{{ page.title }} - limit() and skip() methods
+# Limit the result set
 DB> db.holders.find({},{account_no: 2562348989,city: 'Irvine'}).limit(2)
 [
   {
@@ -42,6 +46,7 @@
   }
 ]
 
+# Skip and limit the result set
 DB> db.holders.find({},{account_no: 2562348989,city: 'Irvine'}).limit(2).skip(1)
 [
   {
@@ -59,6 +64,7 @@
 
 
City names are in ascending order
+# Sort by city in ascending order
 DB> db.holders.find().sort({city: 1})
 [
   {
@@ -106,6 +112,7 @@
 
 
Account numbers are in descending order
+# Sort by account_no in descending order
 DB> db.holders.find().sort({account_no: -1})
 [
   {
@@ -149,4 +156,4 @@
     loan: [ { Personal: 5660, Home: 15000 } ]
   }
 ]
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdwawvv.html b/pages/learn/mongodb/crud/gdwawvv.html index c53c966..b4ce476 100644 --- a/pages/learn/mongodb/crud/gdwawvv.html +++ b/pages/learn/mongodb/crud/gdwawvv.html @@ -8,15 +8,18 @@ godarda@gd:~$ mongosh ... +# List all databases DB> show dbs DB 72.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# List all collections DB> db.getCollectionNames() [ "holders" ] +# Update a single document DB> db.holders.updateOne( ... {city: 'Phoenix'}, ... {$set: {currency: 'USD'}} @@ -29,6 +32,7 @@ upsertedCount: 0 } +# Find all documents DB> db.holders.find() [ { @@ -77,6 +81,7 @@
Set a new field value (updating all matches)
+# Update multiple documents
 DB> db.holders.updateMany(
 ... {city: 'Irvine'},
 ... {$set: {currency: 'USD'}},
@@ -90,6 +95,7 @@
   upsertedCount: 0
 }
 
+# Find all documents
 DB> db.holders.find()
 [
   {
@@ -140,6 +146,7 @@
 
 
Unset field value (updating all matches)
+# Unset field in documents
 DB> db.holders.updateMany(
 ... {account_no: {$lte: 2562348991}},
 ... {$unset: {currency:1}},
@@ -153,6 +160,7 @@
   upsertedCount: 0
 }
 
+# Find all documents
 DB> db.holders.find()
 [
   {
@@ -196,4 +204,4 @@
     loan: [ { Personal: null, Home: null, Car: null } ]
   }
 ]
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/crud/gdyxxwo.html b/pages/learn/mongodb/crud/gdyxxwo.html index 954782a..328afda 100644 --- a/pages/learn/mongodb/crud/gdyxxwo.html +++ b/pages/learn/mongodb/crud/gdyxxwo.html @@ -8,29 +8,36 @@ godarda@gd:~$ mongosh ... +# List all databases test> show databases admin 40.00 KiB config 108.00 KiB local 40.00 KiB +# Switch to database test> use DB switched to db DB +# Check current database DB> db DB +# Get database name DB> db.getName() DB +# Create a collection DB> db.createCollection("holders") { "ok" : 1 } +# List all collections DB> db.getCollectionNames() [ "holders" ] +# List all databases DB> show dbs DB 8.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB -
\ No newline at end of file +
diff --git a/pages/learn/mongodb/fundamentals/gdaiaar.html b/pages/learn/mongodb/fundamentals/gdaiaar.html index 85d5e8c..1bdbe83 100644 --- a/pages/learn/mongodb/fundamentals/gdaiaar.html +++ b/pages/learn/mongodb/fundamentals/gdaiaar.html @@ -7,54 +7,71 @@
 godarda@gd:~$ mongosh
 ...
+# PI
 test> Math.PI
 3.141592653589793
 
+# Euler's constant
 test> Math.E
 2.718281828459045
 
+# Minimum
 test> Math.min(-4,3)
 -4
 
+# Maximum
 test> Math.max(-4,3)
 3
 
+# Absolute
 test> Math.abs(-2.3)
 2.3
 
+# Round
 test> Math.round(-2.3)
 -2
 
+# Floor
 test> Math.floor(-2.3)
 -3
 
+# Ceil
 test> Math.ceil(-2.3)
 -2
 
+# Exponent
 test> Math.exp(0)
 1
 
+# Power
 test> Math.pow(0,0)
 1
 
+# Square Root
 test> Math.sqrt(25)
 5
 
+# Cube Root
 test> Math.cbrt(27)
 3
 
+# Log
 test> Math.log(2)
 0.6931471805599453
 
+# Log10
 test> Math.log10(2)
 0.3010299956639812
 
+# Sin
 test> Math.sin(90)
 0.8939966636005579
 
+# Cos
 test> Math.cos(90)
 -0.4480736161291701
 
+# Tan
 test> Math.tan(90)
 -1.995200412208242
-
\ No newline at end of file +
diff --git a/pages/learn/mongodb/fundamentals/gdalyqa.html b/pages/learn/mongodb/fundamentals/gdalyqa.html index 0ca8359..edd224f 100644 --- a/pages/learn/mongodb/fundamentals/gdalyqa.html +++ b/pages/learn/mongodb/fundamentals/gdalyqa.html @@ -8,6 +8,7 @@ godarda@gd:~$ mongosh ... +# Define a function test> function factorial(n){ ... if(n<=-1) ... return 'Enter Positive Integer'; @@ -16,21 +17,26 @@ ... return n*factorial(n-1); ... } +# Factorial of 0 test> factorial(0); 1 +# Factorial of 10 test> factorial(10); 3628800 +# Factorial of -10 test> factorial(-10); Enter Positive Integer +# Factorial of 170 test> factorial(170); 7.257415615307994e+306 +# Factorial of 171 test> factorial(171); Infinity test> quit() -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/mongodb/fundamentals/gdvivwa.html b/pages/learn/mongodb/fundamentals/gdvivwa.html index 4291c37..f02722c 100644 --- a/pages/learn/mongodb/fundamentals/gdvivwa.html +++ b/pages/learn/mongodb/fundamentals/gdvivwa.html @@ -8,20 +8,26 @@ godarda@gd:~$ mongosh ... +# Check DB Version test> db.version() 7.0.9 +# Check Shell Version test> version() 2.2.5 -
test> db.runCommand({whatsmyuri:1}) +
# Run Command +test> db.runCommand({whatsmyuri:1}) { you: '127.0.0.1:57612', ok: 1 } +# Get Mongo Connection test> db.getMongo() mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5 -
test> "Hello World" +
# Print String +test> "Hello World" Hello World +# Replace String test> "Hello World".replace("World","Learners") Hello Learners
@@ -34,21 +40,26 @@ test> b=30 30 +# Addition test> a+b 1030 +# Multiplication test> a*b 30000 +# Subtraction test> a-b 970 +# Subtraction test> b-a -970 test> (a+b)*a 1030000 +# Division test> a/b 33.333333333333336 @@ -56,27 +67,33 @@ 1 test> b=0 0 +# Division by Zero test> a/b Infinity
Date and Time Functions
+# Date as String
 test> Date()
 Thu Sep 28 2023 15:15:51 GMT+0530 (India Standard Time)
 
+# Date Object
 test> new Date()
 ISODate("2023-09-28T09:46:17.052Z")
 
+# Get Time
 test> new Date().getTime()
 1695894392513
 
+# Get Timezone Offset
 test> new Date().getTimezoneOffset()
 -330
 
db.hostInfo() Function
+# Host Info
 test> db.hostInfo()
 {
     system: {
@@ -100,9 +117,11 @@
 
Running Hosts and Services
 godarda@gd:~$ su
-Password: 
+Password:
+# Install nmap
 root@gd:/home/godarda# apt-get install nmap
 
+# Scan localhost
 godarda@gd:~$ nmap -p- localhost
 Starting Nmap 7.93 ( https://nmap.org ) at 2023-09-28 15:18 IST
 Nmap scan report for localhost (127.0.0.1)
@@ -160,4 +179,4 @@
   fsTotalSize: 0,
   ok: 1
 }
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/ddl/gddvvtd.html b/pages/learn/mysql/ddl/gddvvtd.html index afe952a..e5d2169 100644 --- a/pages/learn/mysql/ddl/gddvvtd.html +++ b/pages/learn/mysql/ddl/gddvvtd.html @@ -10,6 +10,7 @@
Defining NOT NULL constraint
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,9 +23,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# Create a table with NOT NULL constraints
 mysql> CREATE TABLE holders(
     -> account_no BIGINT PRIMARY KEY,
     -> name VARCHAR(30) NOT NULL,
@@ -34,6 +37,7 @@
     -> amount BIGINT NOT NULL);
 Query OK, 0 rows affected (0.52 sec)
 
+# Show table structure
 mysql> DESCRIBE holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -50,10 +54,12 @@
 
 
Adding NOT NULL constraint to a column
+# Add NOT NULL constraint to the dob column
 mysql> ALTER TABLE holders MODIFY dob DATE NOT NULL;
 Query OK, 0 rows affected (2.77 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -71,9 +77,11 @@
 
Retrieving records from a table
If you observe the records, the last record's city is NULL. Hence, while adding the NOT NULL constraint to a city column, got ERROR 1138 (22004): Invalid use of NULL value. To fix this issue, we need to update the last record's city in the holders table.
+# Attempt to add NOT NULL constraint to city column
 mysql> ALTER TABLE holders MODIFY city VARCHAR(20) NOT NULL;
 ERROR 1138 (22004): Invalid use of NULL value
 
+# Retrieve all records from the table
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -91,10 +99,12 @@
 
 
Updating a record and fixing ERROR 1138 (22004): Invalid use of NULL value
+# Update the city for a specific account
 mysql> UPDATE holders SET city='New York' where account_no=25622348995;
 Query OK, 1 row affected (0.15 sec)
 Rows matched: 1  Changed: 1  Warnings: 0
 
+# Retrieve all records from the table
 mysql> SELECT * FROM holders;
 +-------------+---------------+----------+------------+----------+--------+
 | account_no  | name          | city     | dob        | bank     | amount |
@@ -109,10 +119,12 @@
 +-------------+---------------+----------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Add NOT NULL constraint to the city column
 mysql> ALTER TABLE holders MODIFY city VARCHAR(20) NOT NULL;
 Query OK, 0 rows affected (1.31 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -129,10 +141,12 @@
 
 
Removing NOT NULL constraint
+# Remove NOT NULL constraint from the city column
 mysql> ALTER TABLE holders MODIFY city VARCHAR(20) NULL;
 Query OK, 0 rows affected (1.48 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -145,4 +159,4 @@
 | amount     | bigint(20)  | NO   |     | NULL    |       |
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.01 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/ddl/gddvwtv.html b/pages/learn/mysql/ddl/gddvwtv.html index 9f1ca73..8552197 100644 --- a/pages/learn/mysql/ddl/gddvwtv.html +++ b/pages/learn/mysql/ddl/gddvwtv.html @@ -10,6 +10,7 @@
Selecting all the records from a parent table
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,9 +23,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -33,6 +36,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -47,7 +51,8 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
-mysql> DESC holders;                                                          
+# Show table structure
+mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
 +------------+-------------+------+-----+---------+-------+
@@ -63,6 +68,7 @@
 
 
Creating a table with foreign key
+# Create table with foreign key
 mysql> CREATE TABLE loans(
     -> loan_id INT AUTO_INCREMENT PRIMARY KEY,
     -> loan_type VARCHAR(20) NOT NULL,
@@ -71,6 +77,7 @@
     -> FOREIGN KEY(account_no) REFERENCES holders(account_no));
 Query OK, 0 rows affected (1.79 sec)
 
+# Show table structure
 mysql> DESC loans;
 +-------------+-------------+------+-----+---------+----------------+
 | Field       | Type        | Null | Key | Default | Extra          |
@@ -82,6 +89,7 @@
 +-------------+-------------+------+-----+---------+----------------+
 4 rows in set (0.01 sec)
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -90,4 +98,4 @@
 | loans        |
 +--------------+
 2 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/ddl/gddwgvc.html b/pages/learn/mysql/ddl/gddwgvc.html index d8ad662..b40ab6c 100644 --- a/pages/learn/mysql/ddl/gddwgvc.html +++ b/pages/learn/mysql/ddl/gddwgvc.html @@ -7,6 +7,7 @@
Showing existing databases
The SHOW DATABASES statement used to retrieve the existing databases. This statement returns the databases that are currently in the MySQL server, and the results are useful to avoid the conflicts while creating a new database.
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,9 +23,11 @@
 
Creating and using a databasse
The CREATE DATABASE statement used to create a database where all the tables maintained in the DATABASE directory. The USE statement notifies MySQL to use the mentioned database for subsequent database and table operations.
+# Create a new database
 mysql> CREATE DATABASE DB;
 Query OK, 1 row affected (0.11 sec)
 
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -37,6 +40,7 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
@@ -44,6 +48,7 @@
Creating Table
The CREATE TABLE statement used to create a table, and the DESCRIBE statement used to obtain information about the table structure. Please consult the following syntax to create a database and table.
+# Create a new table
 mysql> CREATE TABLE holders(
     -> account_no BIGINT PRIMARY KEY,
     -> name VARCHAR(30) NOT NULL,
@@ -56,6 +61,7 @@
 
 
Show and describe a table
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -64,6 +70,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Show table structure
 mysql> DESCRIBE holders;
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
@@ -77,4 +84,4 @@
 | amount     | bigint(20)  | NO   |     | NULL    |       |
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/ddl/gddwtwf.html b/pages/learn/mysql/ddl/gddwtwf.html index 4edefd6..4512779 100644 --- a/pages/learn/mysql/ddl/gddwtwf.html +++ b/pages/learn/mysql/ddl/gddwtwf.html @@ -10,6 +10,7 @@
Showing existing records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,9 +23,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -33,6 +36,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -50,10 +54,12 @@
 
 
Drop column
+# Drop the city column
 mysql> ALTER TABLE holders DROP COLUMN city;
 Query OK, 0 rows affected (1.32 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+------------+----------+--------+
 | account_no  | name          | dob        | bank     | amount |
@@ -71,10 +77,12 @@
 
 
Add single column
+# Add the city column
 mysql> ALTER TABLE holders ADD COLUMN city VARCHAR(20);
 Query OK, 0 rows affected (0.43 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+------------+----------+--------+------+
 | account_no  | name          | dob        | bank     | amount | city |
@@ -89,6 +97,7 @@
 +-------------+---------------+------------+----------+--------+------+
 7 rows in set (0.00 sec)
 
+# Drop the city column
 mysql> ALTER TABLE holders DROP COLUMN city;
 Query OK, 0 rows affected (1.41 sec)
 Records: 0  Duplicates: 0  Warnings: 0
@@ -96,10 +105,12 @@
 
 
Add multiple columns
+# Add city and email columns
 mysql> ALTER TABLE holders ADD COLUMN city VARCHAR(20) AFTER name, ADD email VARCHAR(35) FIRST;
 Query OK, 0 rows affected (3.36 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------+-------------+---------------+------+------------+----------+--------+
 | email | account_no  | name          | city | dob        | bank     | amount |
@@ -117,6 +128,7 @@
 
 
Modify data type of single field
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -131,10 +143,12 @@
 +------------+-------------+------+-----+---------+-------+
 7 rows in set (0.00 sec)
 
+# Modify email column type
 mysql> ALTER TABLE holders MODIFY email VARCHAR(30);
 Query OK, 7 rows affected (1.75 sec)
 Records: 7  Duplicates: 0  Warnings: 0
 
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -152,11 +166,13 @@
 
 
Modify data type of multiple fields
+# Modify email and dob columns
 mysql> ALTER TABLE holders MODIFY email VARCHAR(25), MODIFY dob DATE NOT NULL;
 Query OK, 7 rows affected (1.85 sec)
 Records: 7  Duplicates: 0  Warnings: 0
 
-mysql> DESC holders;                                                            
+# Show table structure
+mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
 +------------+-------------+------+-----+---------+-------+
@@ -173,10 +189,12 @@
 
 
Change column name
+# Rename name column to flname
 mysql> ALTER TABLE holders CHANGE COLUMN name flname VARCHAR(30);
 Query OK, 0 rows affected (1.46 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------+-------------+---------------+------+------------+----------+--------+
 | email | account_no  | flname        | city | dob        | bank     | amount |
@@ -194,10 +212,12 @@
 
 
Drop multiple columns
+# Drop email and city columns
 mysql> ALTER TABLE holders DROP COLUMN email, DROP COLUMN city;
 Query OK, 0 rows affected (1.49 sec)
 Records: 0  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+------------+----------+--------+
 | account_no  | flname        | dob        | bank     | amount |
@@ -215,12 +235,15 @@
 
 
Rename table name
+# Rename table holders to proprietor
 mysql> ALTER TABLE holders RENAME TO proprietor;
 Query OK, 0 rows affected (0.81 sec)
 
+# Attempt to select from old table name
 mysql> SELECT * FROM holders;
 ERROR 1146 (42S02): Table 'DB.holders' doesn't exist
 
+# Retrieve all records from new table name
 mysql> SELECT * FROM proprietor;
 +-------------+---------------+------------+----------+--------+
 | account_no  | flname        | dob        | bank     | amount |
@@ -234,4 +257,4 @@
 | 25622348995 | James Moore   | 1978-06-26 | Citi     |  97800 |
 +-------------+---------------+------------+----------+--------+
 7 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/ddl/gdedvew.html b/pages/learn/mysql/ddl/gdedvew.html index 98b9af7..5d86af6 100644 --- a/pages/learn/mysql/ddl/gdedvew.html +++ b/pages/learn/mysql/ddl/gdedvew.html @@ -7,6 +7,7 @@
Showing existing databases
The SHOW DATABASES statement used to retrieve the existing databases. This statement returns the databases that are currently in the MySQL server, and the results are useful to avoid the conflicts while creating a new database.
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -23,11 +24,13 @@
 
Use database and show tables
The USE statement notifies MySQL to use the mentioned database for subsequent database and table operations.
+# Switch to the DB database
 mysql> USE DB;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A
 
 Database changed
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -36,6 +39,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -53,6 +57,7 @@
 
Drop table
The DESCRIBE statement used to obtain information about the table structure. The DROP TABLE statement drops a specified table and its data permanently.
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -66,15 +71,19 @@
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.01 sec)
 
+# Drop the holders table
 mysql> DROP TABLE holders;
 Query OK, 0 rows affected (0.42 sec)
 
+# Attempt to drop non-existent table
 mysql> DROP TABLE holders;
 ERROR 1051 (42S02): Unknown table 'DB.holders'
 
+# Drop table if it exists
 mysql> DROP TABLE IF EXISTS holders;
 Query OK, 0 rows affected, 1 warning (0.37 sec)
 
+# Show warnings
 mysql> SHOW WARNINGS;
 +-------+------+----------------------------+
 | Level | Code | Message                    |
@@ -86,9 +95,11 @@
 
 
Drop database
+# Drop the DB database
 mysql> DROP DATABASE DB;
 Query OK, 0 rows affected (0.20 sec)
 
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -99,4 +110,4 @@
 | sys                |
 +--------------------+
 4 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdbbevd.html b/pages/learn/mysql/dml/gdbbevd.html index 6f0a4a8..5a47ade 100644 --- a/pages/learn/mysql/dml/gdbbevd.html +++ b/pages/learn/mysql/dml/gdbbevd.html @@ -7,6 +7,7 @@
Selecting specific records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,6 +33,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -44,14 +48,16 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Select records where city is Mumbai
 mysql> SELECT * FROM holders WHERE city = 'Mumbai';
 +------------+-------------+--------+------------+------+--------+
 | account_no | name        | city   | dob        | bank | amount |
 +------------+-------------+--------+------------+------+--------+
 | 2562348992 | Ryan Bakshi | Mumbai | 1982-01-14 | Citi |  50000 |
 +------------+-------------+--------+------------+------+--------+
-1 row in set (0.01 sec) 
+1 row in set (0.01 sec)
 
+# Select record by account number
 mysql> SELECT * FROM holders WHERE account_no = 25622348995;
 +-------------+-------------+------+------------+------+--------+
 | account_no  | name        | city | dob        | bank | amount |
@@ -60,6 +66,7 @@
 +-------------+-------------+------+------------+------+--------+
 1 row in set (0.00 sec)
 
+# Select records with amount >= 50000
 mysql> SELECT * FROM holders WHERE amount >= 50000;
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -74,6 +81,7 @@
 
 
Using IS NULL and IS NOT NULL conditions
+# Select records where city is NULL
 mysql> SELECT *  FROM holders WHERE city IS NULL;
 +-------------+-------------+------+------------+------+--------+
 | account_no  | name        | city | dob        | bank | amount |
@@ -82,6 +90,7 @@
 +-------------+-------------+------+------------+------+--------+
 1 row in set (0.00 sec)
 
+# Select records where city is NOT NULL
 mysql> SELECT *  FROM holders WHERE city IS NOT NULL;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -94,4 +103,4 @@
 | 25622348994 | Aanya         | Delhi   | 1975-08-18 | SBI      | 105000 |
 +-------------+---------------+---------+------------+----------+--------+
 6 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdczgza.html b/pages/learn/mysql/dml/gdczgza.html index 62975e9..ba962c4 100644 --- a/pages/learn/mysql/dml/gdczgza.html +++ b/pages/learn/mysql/dml/gdczgza.html @@ -7,6 +7,7 @@
Retrieving all the records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,7 +33,8 @@
 +--------------+
 1 row in set (0.01 sec)
 
-mysql> SELECT * FROM holders;                                                  
+# Retrieve all records from holders
+mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
 +-------------+---------------+---------+------------+----------+--------+
@@ -48,6 +52,7 @@
 
Using IN operator
The IN operator is used to specify multiple OR conditions.
+# Select records where city is in the list
 mysql> SELECT * FROM holders WHERE city IN ('Mumbai','Irvine');
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -58,6 +63,7 @@
 +-------------+---------------+--------+------------+-------+--------+
 3 rows in set (0.00 sec)
 
+# Select records where city is not in the list
 mysql> SELECT * FROM holders WHERE city NOT IN ('Mumbai','Irvine');
 +-------------+--------------+---------+------------+----------+--------+
 | account_no  | name         | city    | dob        | bank     | amount |
@@ -72,6 +78,7 @@
 
Using BETWEEN operator
The BETWEEN operator used to select values in a specified range and often used in the WHERE clause of SELECT and UPDATE statements. The following syntax and queries will help you to understand practically.
+# Select records with amount in range
 mysql> SELECT * FROM holders WHERE amount BETWEEN 70000 AND 150000;
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -82,6 +89,7 @@
 +-------------+---------------+--------+------------+-------+--------+
 3 rows in set (0.00 sec)
 
+# Select specific columns with amount in range
 mysql> SELECT account_no, name FROM holders WHERE amount BETWEEN 70000 AND 150000;
 +-------------+---------------+
 | account_no  | name          |
@@ -96,7 +104,8 @@
 
Using LIKE operator (percentage wildcard)
The LIKE operator with percentage wildcard often used with the WHERE clause to retrieve specific records by specifying the pattern. The percentage wildcard represents zero, one, or multiple characters, whereas the underscore represents a single character. If you observe the following queries, we have used LIKE j%, which means the name must start with j character, and LIKE %r, which means the name must end with r character. Lastly, we used LIKE %ar%, which means the name must contain ar characters in between.
-mysql> SELECT * FROM holders;                                               
+# Retrieve all records from holders
+mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
 +-------------+---------------+---------+------------+----------+--------+
@@ -110,6 +119,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Match names starting with 'j'
 mysql> SELECT * FROM holders WHERE name LIKE 'j%';
 +-------------+-------------+---------+------------+----------+--------+
 | account_no  | name        | city    | dob        | bank     | amount |
@@ -119,6 +129,7 @@
 +-------------+-------------+---------+------------+----------+--------+
 2 rows in set (0.00 sec)
 
+# Match names ending with 'r'
 mysql> SELECT * FROM holders WHERE name LIKE '%r';
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -128,6 +139,7 @@
 +-------------+---------------+--------+------------+-------+--------+
 2 rows in set (0.00 sec)
 
+# Match names containing 'ar'
 mysql> SELECT * FROM holders WHERE name LIKE '%ar%';
 +-------------+---------------+--------+------------+--------+--------+
 | account_no  | name          | city   | dob        | bank   | amount |
@@ -141,6 +153,7 @@
 
Using LIKE operator (underscore wildcard)
In the following queries, we have used LIKE operator with underscore wildcard LIKE _a%, which means the name's second character must be a. In the second query, we have given five times underscore, which means we want a bank name with exactly five characters in it. Lastly, we have used %_____ which means the bank name should at least contain five characters.
+# Match names with 'a' as the second character
 mysql> SELECT * FROM holders WHERE name LIKE '_a%';
 +-------------+--------------+---------+------------+----------+--------+
 | account_no  | name         | city    | dob        | bank     | amount |
@@ -152,6 +165,7 @@
 +-------------+--------------+---------+------------+----------+--------+
 4 rows in set (0.00 sec)
 
+# Match bank names with exactly 5 characters
 mysql> SELECT * FROM holders WHERE bank LIKE '_____';
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -160,6 +174,7 @@
 +-------------+---------------+--------+------------+-------+--------+
 1 row in set (0.00 sec)
 
+# Match bank names with at least 5 characters
 mysql> SELECT * FROM holders WHERE bank LIKE '%_____';
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -169,4 +184,4 @@
 | 25622348993 | Marie Peters  | Ribe    | 1967-01-05 | DZBank   |  12250 |
 +-------------+---------------+---------+------------+----------+--------+
 3 rows in set (0.01 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdnhhen.html b/pages/learn/mysql/dml/gdnhhen.html index eefee49..632372f 100644 --- a/pages/learn/mysql/dml/gdnhhen.html +++ b/pages/learn/mysql/dml/gdnhhen.html @@ -10,6 +10,7 @@
Show databases and tables
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,11 +23,13 @@
 +--------------------+
 5 rows in set (0.07 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A
 
 Database changed
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -39,7 +42,8 @@
 
 
Retrieving all the records from a parent table
-mysql> DESC holders;                                                          
+# Show table structure
+mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
 +------------+-------------+------+-----+---------+-------+
@@ -52,6 +56,7 @@
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -69,6 +74,7 @@
 
 
Retrieving all the records from a child table
+# Show table structure
 mysql> DESC loans;
 +-------------+-------------+------+-----+---------+----------------+
 | Field       | Type        | Null | Key | Default | Extra          |
@@ -80,6 +86,7 @@
 +-------------+-------------+------+-----+---------+----------------+
 4 rows in set (0.01 sec)
 
+# Retrieve all records from loans
 mysql> SELECT * FROM loans;
 +---------+-----------+-------------+-------------+
 | loan_id | loan_type | loan_amount | account_no  |
@@ -94,6 +101,7 @@
 
 
Inner Join
+# Perform Inner Join
 mysql> SELECT loans.account_no,holders.name,loans.loan_type FROM loans INNER JOIN holders ON loans.account_no=holders.account_no;
 +-------------+-------------+-----------+
 | account_no  | name        | loan_type |
@@ -105,6 +113,7 @@
 +-------------+-------------+-----------+
 4 rows in set (0.00 sec)
 
+# Inner Join with condition and sorting
 mysql> SELECT loans.account_no,holders.name,loans.loan_type FROM loans INNER JOIN holders ON loans.account_no=holders.account_no WHERE loan_type="Home" ORDER BY name;
 +-------------+-------------+-----------+
 | account_no  | name        | loan_type |
@@ -117,6 +126,7 @@
 
 
Left Join
+# Perform Left Join
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders LEFT JOIN loans ON holders.account_no=loans.account_no;
 +-------------+---------------+-------------+
 | account_no  | name          | loan_amount |
@@ -131,6 +141,7 @@
 +-------------+---------------+-------------+
 7 rows in set (0.00 sec)
 
+# Left Join with sorting
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders LEFT JOIN loans ON holders.account_no=loans.account_no ORDER BY name;
 +-------------+---------------+-------------+
 | account_no  | name          | loan_amount |
@@ -145,6 +156,7 @@
 +-------------+---------------+-------------+
 7 rows in set (0.00 sec)
 
+# Left Join finding unmatched records
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders LEFT JOIN loans ON holders.account_no=loans.account_no WHERE loan_amount IS NULL;
 +-------------+---------------+-------------+
 | account_no  | name          | loan_amount |
@@ -158,6 +170,7 @@
 
 
Right Join
+# Perform Right Join
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders RIGHT JOIN loans ON holders.account_no=loans.account_no;
 +-------------+-------------+-------------+
 | account_no  | name        | loan_amount |
@@ -169,6 +182,7 @@
 +-------------+-------------+-------------+
 4 rows in set (0.00 sec)
 
+# Right Join with condition
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders RIGHT JOIN loans ON holders.account_no=loans.account_no WHERE loan_amount>=40000;
 +-------------+-------------+-------------+
 | account_no  | name        | loan_amount |
@@ -179,6 +193,7 @@
 +-------------+-------------+-------------+
 3 rows in set (0.00 sec)
 
+# Right Join finding unmatched records
 mysql> SELECT holders.account_no,holders.name,loans.loan_amount FROM holders RIGHT JOIN loans ON holders.account_no=loans.account_no WHERE loan_amount IS NULL;
 Empty set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdpdvnx.html b/pages/learn/mysql/dml/gdpdvnx.html index ac7aad5..c0cf69b 100644 --- a/pages/learn/mysql/dml/gdpdvnx.html +++ b/pages/learn/mysql/dml/gdpdvnx.html @@ -10,6 +10,7 @@
Show databases and tables
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,11 +23,13 @@
 +--------------------+
 5 rows in set (0.07 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A
 
 Database changed
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -39,7 +42,8 @@
 
 
Database tables preview
-mysql> DESC holders;                                                          
+# Show table structure
+mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
 +------------+-------------+------+-----+---------+-------+
@@ -52,6 +56,7 @@
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)
 
+# Show table structure
 mysql> DESC loans;
 +-------------+-------------+------+-----+---------+----------------+
 | Field       | Type        | Null | Key | Default | Extra          |
@@ -66,6 +71,7 @@
 
 
Inserting multiple records in a parent table
+# Insert multiple records into holders
 mysql> INSERT INTO holders(account_no, name, city, dob, bank, amount) VALUES
     -> (2562348989, 'James Moore', 'Phoenix', '1985-05-26', 'Barclays', 5000),
     -> (2562348990, 'Donald Taylor', 'Irvine', '1990-08-20', 'Citi', 7000),
@@ -77,6 +83,7 @@
 Query OK, 6 rows affected (0.17 sec)
 Records: 6  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +------------+---------------+---------+------------+----------+--------+
 | account_no | name          | city    | dob        | bank     | amount |
@@ -93,9 +100,11 @@
 
 
Inserting a single record in a parent table
+# Insert a single record into holders
 mysql> INSERT INTO holders VALUES(25622348995, 'James Moore', NULL, '1978-06-26', 'Citi', 97800);
 Query OK, 1 row affected (0.23 sec)
-                                            
+
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -113,6 +122,7 @@
 
 
Inserting records in a child table
+# Insert multiple records into loans
 mysql> INSERT INTO loans(loan_type,loan_amount,account_no) VALUES
     -> ("Personal",5660,25622348989),
     -> ("Home",450000,25622348992),
@@ -121,6 +131,7 @@
 Query OK, 4 rows affected (0.20 sec)
 Records: 4  Duplicates: 0  Warnings: 0
 
+# Retrieve all records from loans
 mysql> SELECT * FROM loans;
 +---------+-----------+-------------+-------------+
 | loan_id | loan_type | loan_amount | account_no  |
@@ -131,4 +142,4 @@
 |       4 | Home      |       40000 | 25622348995 |
 +---------+-----------+-------------+-------------+
 4 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdpwzaz.html b/pages/learn/mysql/dml/gdpwzaz.html index 645352d..3688629 100644 --- a/pages/learn/mysql/dml/gdpwzaz.html +++ b/pages/learn/mysql/dml/gdpwzaz.html @@ -10,6 +10,7 @@
Retrieving the existing databases and table records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -22,9 +23,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -33,6 +36,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -50,6 +54,7 @@
 
 
Using LIMIT clause
+# Retrieve the first 3 records
 mysql> SELECT * FROM holders LIMIT 3;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -60,6 +65,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 3 rows in set (0.00 sec)
 
+# Retrieve first 3 records ordered by dob
 mysql> SELECT * FROM holders ORDER BY dob LIMIT 3;
 +-------------+--------------+-------+------------+--------+--------+
 | account_no  | name         | city  | dob        | bank   | amount |
@@ -73,6 +79,7 @@
 
 
Retrieving first and last three records
+# Retrieve all records ordered by bank and amount
 mysql> SELECT * FROM holders ORDER BY bank,amount;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -87,6 +94,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve first 3 records ordered by bank and amount
 mysql> SELECT * FROM holders ORDER BY bank,amount LIMIT 3;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -97,6 +105,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 3 rows in set (0.01 sec)
 
+# Retrieve last 3 records by account number
 mysql> SELECT * FROM holders ORDER BY account_no DESC LIMIT 3;
 +-------------+--------------+-------+------------+--------+--------+
 | account_no  | name         | city  | dob        | bank   | amount |
@@ -106,4 +115,4 @@
 | 25622348993 | Marie Peters | Ribe  | 1967-01-05 | DZBank |  12250 |
 +-------------+--------------+-------+------------+--------+--------+
 3 rows in set (0.01 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdpzyig.html b/pages/learn/mysql/dml/gdpzyig.html index 22d9bef..492850c 100644 --- a/pages/learn/mysql/dml/gdpzyig.html +++ b/pages/learn/mysql/dml/gdpzyig.html @@ -7,6 +7,7 @@
Extracting the records using operators
+# List all available databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the 'DB' database
 mysql> USE DB;
 Database changed
 
+# List all tables in the current database
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,6 +33,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from the 'holders' table
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -44,6 +48,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Select records where amount is >= 50000 AND bank is 'Citi'
 mysql> SELECT * FROM holders WHERE amount >= 50000 AND bank = 'Citi';
 +-------------+-------------+--------+------------+------+--------+
 | account_no  | name        | city   | dob        | bank | amount |
@@ -53,6 +58,7 @@
 +-------------+-------------+--------+------------+------+--------+
 2 rows in set (0.00 sec)
 
+# Select records where amount is > 50000 AND bank is 'Citi'
 mysql> SELECT * FROM holders WHERE amount > 50000 AND bank = 'Citi';
 +-------------+-------------+------+------------+------+--------+
 | account_no  | name        | city | dob        | bank | amount |
@@ -61,6 +67,7 @@
 +-------------+-------------+------+------------+------+--------+
 1 row in set (0.00 sec)
 
+# Select records where amount is >= 50000 OR bank is 'Citi'
 mysql> SELECT * FROM holders WHERE amount >= 50000 OR bank = 'Citi';
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -73,6 +80,7 @@
 +-------------+---------------+--------+------------+-------+--------+
 5 rows in set (0.00 sec)
 
+# Select records where bank is NOT 'Citi'
 mysql> SELECT * FROM holders WHERE NOT bank = 'Citi';
 +------------+---------------+---------+------------+----------+--------+
 | account_no | name          | city    | dob        | bank     | amount |
@@ -83,4 +91,4 @@
 | 2562348994 | Aanya         | Delhi   | 1975-08-18 | SBI      | 105000 |
 +------------+---------------+---------+------------+----------+--------+
 4 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gduidey.html b/pages/learn/mysql/dml/gduidey.html index a287943..066b80a 100644 --- a/pages/learn/mysql/dml/gduidey.html +++ b/pages/learn/mysql/dml/gduidey.html @@ -6,6 +6,7 @@
{{ page.title }}
Show databases and tables
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -18,11 +19,13 @@
 +--------------------+
 5 rows in set (0.07 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A
 
 Database changed
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -35,6 +38,7 @@
 
 
Retrieving all the records from a parent table
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -49,6 +53,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve city column from holders
 mysql> SELECT city FROM holders;
 +---------+
 | city    |
@@ -66,6 +71,7 @@
 
 
Retrieving distinct records
+# Retrieve distinct cities
 mysql> SELECT DISTINCT city FROM holders;
 +---------+
 | city    |
@@ -79,6 +85,7 @@
 +---------+
 6 rows in set (0.00 sec)
 
+# Retrieve distinct name and city combinations
 mysql> SELECT DISTINCT name, city FROM holders;
 +---------------+---------+
 | name          | city    |
@@ -96,6 +103,7 @@
 
 
COUNT, MIN, and MAX Functions
+# Count distinct cities
 mysql> SELECT COUNT(DISTINCT city) AS Count FROM holders;
 +-------+
 | Count |
@@ -104,6 +112,7 @@
 +-------+
 1 row in set (0.00 sec)
 
+# Find minimum amount
 mysql> SELECT MIN(amount) FROM holders;
 +-------------+
 | MIN(amount) |
@@ -112,6 +121,7 @@
 +-------------+
 1 row in set (0.00 sec)
 
+# Find maximum amount
 mysql> SELECT MAX(amount) FROM holders;
 +-------------+
 | MAX(amount) |
@@ -123,6 +133,7 @@
 
 
Retrieving all the records from a child table
+# Retrieve all records from loans
 mysql> SELECT * FROM loans;
 +---------+-----------+-------------+-------------+
 | loan_id | loan_type | loan_amount | account_no  |
@@ -134,9 +145,11 @@
 +---------+-----------+-------------+-------------+
 4 rows in set (0.00 sec)
 
+# Delete record with loan_id 4
 mysql> DELETE FROM loans WHERE loan_id=4;
 Query OK, 1 row affected (0.17 sec)
 
+# Retrieve all records from loans
 mysql> SELECT * FROM loans;
 +---------+-----------+-------------+-------------+
 | loan_id | loan_type | loan_amount | account_no  |
@@ -147,9 +160,11 @@
 +---------+-----------+-------------+-------------+
 3 rows in set (0.00 sec)
 
+# Insert a new loan record
 mysql> INSERT INTO loans(loan_type,loan_amount,account_no) VALUES ("Home",40000,25622348995);
 Query OK, 1 row affected (0.19 sec)
 
+# Retrieve all records from loans
 mysql> SELECT * FROM loans;
 +---------+-----------+-------------+-------------+
 | loan_id | loan_type | loan_amount | account_no  |
@@ -160,4 +175,4 @@
 |       5 | Home      |       40000 | 25622348995 |
 +---------+-----------+-------------+-------------+
 4 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdvzkzw.html b/pages/learn/mysql/dml/gdvzkzw.html index 7ed83c0..e448804 100644 --- a/pages/learn/mysql/dml/gdvzkzw.html +++ b/pages/learn/mysql/dml/gdvzkzw.html @@ -7,6 +7,7 @@
Filtering the records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,6 +33,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve records ordered by name
 mysql> SELECT * FROM holders ORDER BY name;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -44,6 +48,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve records ordered by amount
 mysql> SELECT * FROM holders ORDER BY amount;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -61,6 +66,7 @@
 
 
Using DESC
+# Retrieve records ordered by name descending
 mysql> SELECT * FROM holders ORDER BY name DESC;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -75,6 +81,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve records ordered by amount descending
 mysql> SELECT * FROM holders ORDER BY amount DESC;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -92,6 +99,7 @@
 
 
Using ASC and DESC
+# Retrieve records ordered by city descending and amount ascending
 mysql> SELECT * FROM holders ORDER BY city DESC, amount ASC;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -106,6 +114,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve records ordered by name ascending and amount descending
 mysql> SELECT * FROM holders ORDER BY name ASC, amount DESC;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -120,6 +129,7 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Retrieve records ordered by name ascending and bank descending
 mysql> SELECT * FROM holders ORDER BY name ASC, bank DESC;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -133,4 +143,4 @@
 | 25622348992 | Ryan Bakshi   | Mumbai  | 1982-01-14 | Citi     |  50000 |
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdzsgwd.html b/pages/learn/mysql/dml/gdzsgwd.html index bbe850c..0a15291 100644 --- a/pages/learn/mysql/dml/gdzsgwd.html +++ b/pages/learn/mysql/dml/gdzsgwd.html @@ -7,6 +7,7 @@
Retrieving the existing databases and table records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,6 +33,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -47,9 +51,11 @@
 
 
Deleting the records
+# Delete records where city is NULL
 mysql> DELETE FROM holders WHERE city IS NULL;
 Query OK, 1 row affected (0.20 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -63,9 +69,11 @@
 +-------------+---------------+---------+------------+----------+--------+
 6 rows in set (0.00 sec)
 
+# Delete records where dob is before 1980-12-31
 mysql> DELETE FROM holders WHERE dob < '1980-12-31';
 Query OK, 2 rows affected (0.21 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -77,9 +85,11 @@
 +-------------+---------------+---------+------------+----------+--------+
 4 rows in set (0.00 sec)
 
+# Delete records where city contains 'nix'
 mysql> DELETE FROM holders WHERE city LIKE '%nix%';
 Query OK, 1 row affected (1.34 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+--------+------------+-------+--------+
 | account_no  | name          | city   | dob        | bank  | amount |
@@ -93,12 +103,15 @@
 
 
Deleting all the records
+# Delete all records from holders
 mysql> DELETE FROM holders;
 Query OK, 3 rows affected (0.17 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 Empty set (0.00 sec)
 
+# Show table structure
 mysql> DESC holders;
 +------------+-------------+------+-----+---------+-------+
 | Field      | Type        | Null | Key | Default | Extra |
@@ -111,4 +124,4 @@
 | amount     | bigint(20)  | NO   |     | NULL    |       |
 +------------+-------------+------+-----+---------+-------+
 6 rows in set (0.01 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/dml/gdzzcev.html b/pages/learn/mysql/dml/gdzzcev.html index 107b9e6..a6b5891 100644 --- a/pages/learn/mysql/dml/gdzzcev.html +++ b/pages/learn/mysql/dml/gdzzcev.html @@ -7,6 +7,7 @@
Retrieving the existing databases and table records
+# List all databases
 mysql> SHOW DATABASES;
 +--------------------+
 | Database           |
@@ -19,9 +20,11 @@
 +--------------------+
 5 rows in set (0.00 sec)
 
+# Switch to the DB database
 mysql> USE DB;
 Database changed
 
+# List all tables
 mysql> SHOW TABLES;
 +--------------+
 | Tables_in_DB |
@@ -30,6 +33,7 @@
 +--------------+
 1 row in set (0.01 sec)
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -47,10 +51,12 @@
 
 
Updating the specific records
+# Update amount where city is Irvine
 mysql> UPDATE holders SET amount = amount + 2000 WHERE city = 'Irvine';
 Query OK, 2 rows affected (0.16 sec)
 Rows matched: 2  Changed: 2  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+---------+------------+----------+--------+
 | account_no  | name          | city    | dob        | bank     | amount |
@@ -65,10 +71,12 @@
 +-------------+---------------+---------+------------+----------+--------+
 7 rows in set (0.00 sec)
 
+# Update city for a specific account
 mysql> UPDATE holders SET city = 'New York' WHERE account_no = 25622348995;
 Query OK, 1 row affected (0.19 sec)
 Rows matched: 1  Changed: 1  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+----------+------------+----------+--------+
 | account_no  | name          | city     | dob        | bank     | amount |
@@ -86,10 +94,12 @@
 
 
Updating all the records
+# Update amount for all records
 mysql> UPDATE holders SET amount = amount + 2000;
 Query OK, 7 rows affected (0.19 sec)
 Rows matched: 7  Changed: 7  Warnings: 0
 
+# Retrieve all records from holders
 mysql> SELECT * FROM holders;
 +-------------+---------------+----------+------------+----------+--------+
 | account_no  | name          | city     | dob        | bank     | amount |
@@ -103,4 +113,4 @@
 | 25622348995 | James Moore   | New York | 1978-06-26 | Citi     |  99800 |
 +-------------+---------------+----------+------------+----------+--------+
 7 rows in set (0.01 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/fundamentals/gdgpzwy.html b/pages/learn/mysql/fundamentals/gdgpzwy.html index 10c8e9e..dfc4ebb 100644 --- a/pages/learn/mysql/fundamentals/gdgpzwy.html +++ b/pages/learn/mysql/fundamentals/gdgpzwy.html @@ -6,6 +6,7 @@
{{ page.title }}
ASCII and ORD Functions
+# Return ASCII value of 'A'
 mysql> SELECT ASCII('A');
 +------------+
 | ASCII('A') |
@@ -14,6 +15,7 @@
 +------------+
 1 row in set (0.00 sec)
 
+# Return ASCII value of 'a'
 mysql> SELECT ASCII('a');
 +------------+
 | ASCII('a') |
@@ -22,6 +24,7 @@
 +------------+
 1 row in set (0.00 sec)
 
+# Return ORD value of 'A'
 mysql> SELECT ORD('A');
 +----------+
 | ORD('A') |
@@ -30,6 +33,7 @@
 +----------+
 1 row in set (0.00 sec)
 
+# Return ORD value of 'a'
 mysql> SELECT ORD('a');
 +----------+
 | ORD('a') |
@@ -39,189 +43,210 @@
 1 row in set (0.00 sec)
 
-
LENGHT and CHAR_LENGTH Functions
+
LENGTH and CHAR_LENGTH Functions
+# Get length of string in bytes
 mysql> SELECT LENGTH("GoDarda") AS Length;
 +--------+
 | Length |
 +--------+
-|     12 |
+|      7 |
 +--------+
 1 row in set (0.00 sec)
 
+# Get length of string in characters
 mysql> SELECT CHAR_LENGTH("GoDarda") AS Length;
 +--------+
 | Length |
 +--------+
-|     12 |
+|      7 |
 +--------+
 1 row in set (0.00 sec)
 
CONCAT Function
-mysql> SELECT CONCAT("Koding","Window") AS Concatenation;
+# Concatenate two strings
+mysql> SELECT CONCAT("Go","Darda") AS Concatenation;
 +---------------+
 | Concatenation |
 +---------------+
-| GoDarda  |
+| GoDarda       |
 +---------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT CONCAT("Koding","Window"," Experiments") AS Concatenation;
+# Concatenate multiple strings
+mysql> SELECT CONCAT("Go","Darda"," Experiments") AS Concatenation;
 +--------------------------+
 | Concatenation            |
 +--------------------------+
-| GoDarda Experiments |
+| GoDarda Experiments      |
 +--------------------------+
 1 row in set (0.00 sec)
 
LCASE and UCASE Functions
-mysql> SELECT LOWER("KoDiNgWiNdOw") AS Lowercase;
+# Convert string to lowercase
+mysql> SELECT LOWER("GoDaRdA") AS Lowercase;
 +--------------+
 | Lowercase    |
 +--------------+
-| godarda |
+| godarda      |
 +--------------+
 1 row in set (0.12 sec)
 
+# Convert string to uppercase
 mysql> SELECT UPPER("GoDarda") AS Uppercase;
 +--------------+
 | Uppercase    |
 +--------------+
-| KODINGWINDOW |
+| GODARDA      |
 +--------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT LCASE("KoDiNgWiNdOw") AS Lowercase;
+# Convert string to lowercase
+mysql> SELECT LCASE("GoDaRdA") AS Lowercase;
 +--------------+
 | Lowercase    |
 +--------------+
-| godarda |
+| godarda      |
 +--------------+
 1 row in set (0.00 sec)
 
+# Convert string to uppercase
 mysql> SELECT UCASE("GoDarda") AS Uppdercase;
 +--------------+
 | Uppdercase   |
 +--------------+
-| KODINGWINDOW |
+| GODARDA      |
 +--------------+
 1 row in set (0.00 sec)
 
LEFT and RIGHT Functions
-mysql> SELECT LEFT("GoDarda",6) AS Extraction;
+# Extract 2 characters from left
+mysql> SELECT LEFT("GoDarda",2) AS Extraction;
 +------------+
 | Extraction |
 +------------+
-| Koding     |
+| Go         |
 +------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT RIGHT("GoDarda",6) AS Extraction;
+# Extract 5 characters from right
+mysql> SELECT RIGHT("GoDarda",5) AS Extraction;
 +------------+
 | Extraction |
 +------------+
-| Window     |
+| Darda      |
 +------------+
 1 row in set (0.00 sec)
 
LOCATE and POSITION Functions
-mysql> SELECT LOCATE("O","KODINGWINDOW") AS Locate;
+# Find position of substring
+mysql> SELECT LOCATE("D","GoDarda") AS Locate;
 +--------+
 | Locate |
 +--------+
-|      2 |
+|      3 |
 +--------+
 1 row in set (0.00 sec)
 
-mysql> SELECT LOCATE("window","KODINGWINDOW") AS Locate;
+# Find position of substring
+mysql> SELECT LOCATE("Darda","GoDarda") AS Locate;
 +--------+
 | Locate |
 +--------+
-|      7 |
+|      3 |
 +--------+
 1 row in set (0.00 sec)
 
-mysql> SELECT POSITION("O" IN "KODINGWINDOW") AS Position;
+# Find position of substring
+mysql> SELECT POSITION("D" IN "GoDarda") AS Position;
 +----------+
 | Position |
 +----------+
-|        2 |
+|        3 |
 +----------+
 1 row in set (0.00 sec)
 
-mysql> SELECT POSITION("window" IN "KODINGWINDOW") AS Position;
+# Find position of substring
+mysql> SELECT POSITION("Darda" IN "GoDarda") AS Position;
 +----------+
 | Position |
 +----------+
-|        7 |
+|        3 |
 +----------+
 1 row in set (0.00 sec)
 
SUBSTR and MID Functions
-mysql> SELECT SUBSTR("GoDarda",7,12) AS Substring;
+# Extract substring starting at 3
+mysql> SELECT SUBSTR("GoDarda",3,5) AS Substring;
 +-----------+
 | Substring |
 +-----------+
-| Window    |
+| Darda     |
 +-----------+
 1 row in set (0.00 sec)
 
-mysql> SELECT SUBSTRING("GoDarda",7,12) AS Substring;
+# Extract substring starting at 3
+mysql> SELECT SUBSTRING("GoDarda",3,5) AS Substring;
 +-----------+
 | Substring |
 +-----------+
-| Window    |
+| Darda     |
 +-----------+
 1 row in set (0.00 sec)
 
-mysql> SELECT MID("GoDarda",7,12) AS Substring;
+# Extract substring starting at 3
+mysql> SELECT MID("GoDarda",3,5) AS Substring;
 +-----------+
 | Substring |
 +-----------+
-| Window    |
+| Darda     |
 +-----------+
 1 row in set (0.00 sec)
 
LTRIM, RTRIM, and TRIM Functions
+# Remove leading spaces
 mysql> SELECT LTRIM("  GoDarda   ") AS "Left Trim";
 +-----------------+
 | Left Trim       |
 +-----------------+
-| GoDarda    |
+| GoDarda   |
 +-----------------+
 1 row in set (0.00 sec)
 
+# Remove trailing spaces
 mysql> SELECT RTRIM("  GoDarda   ") AS "Right Trim";
 +----------------+
 | Right Trim     |
 +----------------+
-|   GoDarda |
+|   GoDarda      |
 +----------------+
 1 row in set (0.00 sec)
 
+# Remove leading and trailing spaces
 mysql> SELECT TRIM("  GoDarda   ") AS "Trim";
 +--------------+
 | Trim         |
 +--------------+
-| GoDarda |
+| GoDarda      |
 +--------------+
 1 row in set (0.00 sec)
 
REPEAT, REPLACE, and REVERSE Functions
+# Repeat a number
 mysql> SELECT REPEAT(2,10) AS "Repeat";
 +------------+
 | Repeat     |
@@ -230,41 +255,46 @@
 +------------+
 1 row in set (0.00 sec)
 
+# Repeat a string
 mysql> SELECT REPEAT("GD",5) AS "Repeat";
 +------------+
 | Repeat     |
 +------------+
-| KWKWKWKWKW |
+| GDGDGDGDGD |
 +------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT REPLACE("GoDarda","Koding","Learning") AS "Replace";
+# Replace substring
+mysql> SELECT REPLACE("GoDarda","Go","Come") AS "Replace";
 +----------------+
 | Replace        |
 +----------------+
-| LearningWindow |
+| ComeDarda      |
 +----------------+
 1 row in set (0.00 sec)
 
+# Reverse a string
 mysql> SELECT REVERSE("GoDarda") AS "Reverse";
 +--------------+
 | Reverse      |
 +--------------+
-| wodniWgnidoK |
+| adraDoG      |
 +--------------+
 1 row in set (0.00 sec)
 
LPAD and RPAD Functions
-mysql> SELECT LPAD("K",10,"W") AS "Left Padding";
+# Left pad string
+mysql> SELECT LPAD("G",10,"D") AS "Left Padding";
 +--------------+
 | Left Padding |
 +--------------+
-| WWWWWWWWWK   |
+| DDDDDDDDDG   |
 +--------------+
 1 row in set (0.00 sec)
 
+# Left pad number
 mysql> SELECT LPAD(152212,10,0) AS "Left Padding";
 +--------------+
 | Left Padding |
@@ -273,25 +303,28 @@
 +--------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT RPAD("K",10,"W") AS "Right Padding";
+# Right pad string
+mysql> SELECT RPAD("G",10,"D") AS "Right Padding";
 +---------------+
 | Right Padding |
 +---------------+
-| KWWWWWWWWW    |
+| GDDDDDDDDD    |
 +---------------+
 1 row in set (0.00 sec)
 
-mysql> SELECT RPAD("K",10,"Z") AS "Right Padding";
+# Right pad string
+mysql> SELECT RPAD("G",10,"Z") AS "Right Padding";
 +---------------+
 | Right Padding |
 +---------------+
-| KZZZZZZZZZ    |
+| GZZZZZZZZZ    |
 +---------------+
 1 row in set (0.00 sec)
 
SPACE Function
+# Generate string of spaces
 mysql> SELECT SPACE(50);
 +----------------------------------------------------+
 | SPACE(50)                                          |
@@ -303,6 +336,7 @@
 
 
FORMAT Function
+# Format number with 1 decimal
 mysql> SELECT FORMAT(15247892233,1);
 +-----------------------+
 | FORMAT(15247892233,1) |
@@ -311,6 +345,7 @@
 +-----------------------+
 1 row in set (0.00 sec)
 
+# Format number with 2 decimals
 mysql> SELECT FORMAT(15247892233,2);
 +-----------------------+
 | FORMAT(15247892233,2) |
@@ -318,4 +353,4 @@
 | 15,247,892,233.00     |
 +-----------------------+
 1 row in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/fundamentals/gdrgtrz.html b/pages/learn/mysql/fundamentals/gdrgtrz.html index 9d08d4c..a3579dc 100644 --- a/pages/learn/mysql/fundamentals/gdrgtrz.html +++ b/pages/learn/mysql/fundamentals/gdrgtrz.html @@ -7,6 +7,7 @@
CURDATE and CURTIME Functions
CURDATE(): It returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on which function is used.
+# Get current date
 mysql> SELECT CURDATE();
 +------------+
 | CURDATE()  |
@@ -15,6 +16,7 @@
 +------------+
 1 row in set (0.00 sec)
 
+# Get current date as numeric value
 mysql> SELECT CURDATE() + 0;
 +---------------+
 | CURDATE() + 0 |
@@ -23,6 +25,7 @@
 +---------------+
 1 row in set (0.00 sec)
 
+# Get current time
 mysql> SELECT CURTIME();
 +-----------+
 | CURTIME() |
@@ -31,6 +34,7 @@
 +-----------+
 1 row in set (0.00 sec)
 
+# Get current time as numeric value
 mysql> SELECT CURTIME() + 0;
 +---------------+
 | CURTIME() + 0 |
@@ -43,6 +47,7 @@
 
NOW, SLEEP, and SYSDATE Functions
NOW(): It returns a constant time that indicates the time at which the statement start to execute, and SYSDATE() returns the exact time at which it executes.
+# Get current date and time
 mysql> SELECT NOW();
 +---------------------+
 | NOW()               |
@@ -51,6 +56,7 @@
 +---------------------+
 1 row in set (0.00 sec)
 
+# Demonstrate NOW() remains constant during query execution
 mysql> SELECT NOW(), SLEEP(2), NOW();
 +---------------------+----------+---------------------+
 | NOW()               | SLEEP(2) | NOW()               |
@@ -59,6 +65,7 @@
 +---------------------+----------+---------------------+
 1 row in set (2.34 sec)
 
+# Demonstrate SYSDATE() returns time at execution
 mysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();
 +---------------------+----------+---------------------+
 | SYSDATE()           | SLEEP(2) | SYSDATE()           |
@@ -71,6 +78,7 @@
 
DATEDIFF and DATE_ADD Functions
DATEDIFF(): It returns expr1 βˆ’ expr2 (date or date-and-time expressions) expressed as a value in days from one date to the other
+# Calculate difference in days
 mysql> SELECT DATEDIFF(CURDATE(),'2018-02-19');
 +----------------------------------+
 | DATEDIFF(CURDATE(),'2018-02-19') |
@@ -79,6 +87,7 @@
 +----------------------------------+
 1 row in set (0.00 sec)
 
+# Add 1 day to current date
 mysql> SELECT DATE_ADD(CURDATE(), INTERVAL 1 DAY);
 +-------------------------------------+
 | DATE_ADD(CURDATE(), INTERVAL 1 DAY) |
@@ -87,6 +96,7 @@
 +-------------------------------------+
 1 row in set (0.01 sec)
 
+# Add 5 months to current date
 mysql> SELECT DATE_ADD(CURDATE(), INTERVAL 5 MONTH);
 +---------------------------------------+
 | DATE_ADD(CURDATE(), INTERVAL 5 MONTH) |
@@ -98,6 +108,7 @@
 
 
DATE_FORMAT Function
+# Format date as Weekday Month Year
 mysql> SELECT DATE_FORMAT(CURDATE(), '%W %M %Y');
 +------------------------------------+
 | DATE_FORMAT(CURDATE(), '%W %M %Y') |
@@ -106,6 +117,7 @@
 +------------------------------------+
 1 row in set (0.00 sec)
 
+# Format date with various specifiers
 mysql> SELECT DATE_FORMAT(CURDATE(), '%D %y %a %d %m %b %j') AS DATE_FORMAT;
 +---------------------------+
 | DATE_FORMAT               |
@@ -114,6 +126,7 @@
 +---------------------------+
 1 row in set (0.00 sec)
 
+# Format date using USA standard
 mysql> SELECT DATE_FORMAT('2018-02-19', GET_FORMAT(DATE,'USA')) AS USA_DATE_FORMAT;
 +-----------------+
 | USA_DATE_FORMAT |
@@ -122,6 +135,7 @@
 +-----------------+
 1 row in set (0.00 sec)
 
+# Format date using EUR standard
 mysql> SELECT DATE_FORMAT('2018-02-19', GET_FORMAT(DATE,'EUR')) AS EUR_DATE_FORMAT;
 +-----------------+
 | EUR_DATE_FORMAT |
@@ -133,6 +147,7 @@
 
 
DAYNAME Function
+# Get day name of current date
 mysql> SELECT DAYNAME(CURDATE());
 +--------------------+
 | DAYNAME(CURDATE()) |
@@ -141,6 +156,7 @@
 +--------------------+
 1 row in set (0.00 sec)
 
+# Get day name of specific date
 mysql> SELECT DAYNAME('2018-02-19');
 +-----------------------+
 | DAYNAME('2018-02-19') |
@@ -153,6 +169,7 @@
 
DAYOFMONTH, DAYOFWEEK, and DAYOFYEAR Functions
WEEKDAY(): It Returns the weekday index for date (0 = Monday, 1 = Tuesday, … 6 = Sunday)
+# Get day of the month
 mysql> SELECT DAYOFMONTH(CURDATE());
 +-----------------------+
 | DAYOFMONTH(CURDATE()) |
@@ -161,6 +178,7 @@
 +-----------------------+
 1 row in set (0.00 sec)
 
+# Get day of the week index
 mysql> SELECT DAYOFWEEK('2018-02-19');
 +-------------------------+
 | DAYOFWEEK('2018-02-19') |
@@ -169,6 +187,7 @@
 +-------------------------+
 1 row in set (0.00 sec)
 
+# Get day of the week index
 mysql> SELECT DAYOFWEEK(CURDATE());
 +----------------------+
 | DAYOFWEEK(CURDATE()) |
@@ -177,6 +196,7 @@
 +----------------------+
 1 row in set (0.00 sec)
 
+# Get day of the year
 mysql> SELECT DAYOFYEAR(CURDATE());
 +----------------------+
 | DAYOFYEAR(CURDATE()) |
@@ -185,6 +205,7 @@
 +----------------------+
 1 row in set (0.00 sec)
 
+# Get day of the year
 mysql> SELECT DAYOFYEAR('2018-02-19');
 +-------------------------+
 | DAYOFYEAR('2018-02-19') |
@@ -196,6 +217,7 @@
 
 
EXTRACT Function
+# Extract year from current date
 mysql> SELECT EXTRACT(YEAR FROM CURDATE()) AS YEAR;
 +------+
 | YEAR |
@@ -204,6 +226,7 @@
 +------+
 1 row in set (0.00 sec)
 
+# Extract month from current date
 mysql> SELECT EXTRACT(MONTH FROM CURDATE()) AS MONTH;
 +-------+
 | MONTH |
@@ -215,6 +238,7 @@
 
 
LAST_DAY and MONTHNAME Functions
+# Get last day of the month
 mysql> SELECT LAST_DAY('2018-02-19');
 +------------------------+
 | LAST_DAY('2018-02-19') |
@@ -223,6 +247,7 @@
 +------------------------+
 1 row in set (0.00 sec)
 
+# Get month name
 mysql> SELECT MONTHNAME(CURDATE());
 +----------------------+
 | MONTHNAME(CURDATE()) |
@@ -234,6 +259,7 @@
 
 
SEC_TO_TIME and SUBDATE Functions
+# Convert seconds to time
 mysql> SELECT SEC_TO_TIME(4500);
 +-------------------+
 | SEC_TO_TIME(4500) |
@@ -242,6 +268,7 @@
 +-------------------+
 1 row in set (0.00 sec)
 
+# Subtract days from current date
 mysql> SELECT SUBDATE(CURDATE(), INTERVAL 107 DAY) AS DIFFERENCE;
 +------------+
 | DIFFERENCE |
@@ -253,6 +280,7 @@
 
 
UTC_DATE and UTC_TIME Functions
+# Get UTC date
 mysql> SELECT UTC_DATE();
 +------------+
 | UTC_DATE() |
@@ -261,6 +289,7 @@
 +------------+
 1 row in set (0.01 sec)
 
+# Get UTC time
 mysql> SELECT UTC_TIME();
 +------------+
 | UTC_TIME() |
@@ -269,6 +298,7 @@
 +------------+
 1 row in set (0.00 sec)
 
+# Get UTC timestamp
 mysql> SELECT UTC_TIMESTAMP();
 +---------------------+
 | UTC_TIMESTAMP()     |
@@ -277,6 +307,7 @@
 +---------------------+
 1 row in set (0.00 sec)
 
+# Get week number
 mysql> SELECT WEEK(CURDATE());
 +-----------------+
 | WEEK(CURDATE()) |
@@ -284,4 +315,4 @@
 |              34 |
 +-----------------+
 1 row in set (0.00 sec)
-
\ No newline at end of file +
diff --git a/pages/learn/mysql/index.html b/pages/learn/mysql/index.html index 4da3cef..82718f5 100644 --- a/pages/learn/mysql/index.html +++ b/pages/learn/mysql/index.html @@ -5,14 +5,14 @@ ---
MySQL Introduction
-

MySQL is an open-source database management system. The database is a structured collection of data, and MySQL store data in the form of a table, hence it is called Relational Database Management System (RDBMS). It can run on various platforms like Linux, Windows, macOS, etc. The MySQL is the combination of My and SQL, My is the daughter's name of the MySQL's co-founder, Monty Widenius, and SQL stands for Structured Query Language.


-

If you want to stay logically connected to this tutorial, start with MySQL: CREATE a DATABASE and TABLE, and then accordingly follow the recommended links at the bottom of each page. Throughout this tutorial, we are using MySQL on Linux Ubuntu distribution.
Prerequisite: The MySQL setup is up and running. If not, then refer How to setup, install, and start MySQL on Ubuntu.

+

MySQL is an open-source database management system. A database is a structured collection of data. Since MySQL stores data in tables, it is classified as a Relational Database Management System (RDBMS). It runs on various platforms, including Linux, Windows, and macOS.


+

To follow this tutorial sequentially, start with MySQL: CREATE a DATABASE and TABLE, and then follow the recommended links at the bottom of each page. Throughout this tutorial, we use MySQL on the Ubuntu Linux distribution.
Prerequisite: Ensure MySQL is installed and running. If not, refer to How to setup, install, and start MySQL on Ubuntu.

How to start MySQL on Ubuntu
 godarda@gd:~$ sudo mysql -u root -p
-Enter password: 
+Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 10
 Server version: 8.0.40-0ubuntu0.24.04.1 (Ubuntu)
@@ -24,4 +24,4 @@
 owners.
 
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
\ No newline at end of file +
diff --git a/pages/learn/octave/fundamentals/gdazzam.html b/pages/learn/octave/fundamentals/gdazzam.html index 0ea84e4..8fd9f68 100644 --- a/pages/learn/octave/fundamentals/gdazzam.html +++ b/pages/learn/octave/fundamentals/gdazzam.html @@ -7,20 +7,24 @@
 godarda@gd:~$ octave
 ...
+# Get the value of pi
 octave> pi
 ans = 3.1416
 
+# Convert degrees to radians
 octave> deg2rad([0, 90, 180, 270, 360])
 ans =
 
         0   1.5708   3.1416   4.7124   6.2832
 
 
+# Convert radians to degrees
 octave> rad2deg([0, pi/2, pi, 3/2*pi, 2*pi])
 ans =
 
      0    90   180   270   360
 
+# Sine of angle in radians
 octave> sin(0)
 ans = 0
 
@@ -38,7 +42,9 @@
 
 octave> cot(180)
 ans = 0.7470
-
octave> sind(0) +
+# Sine of angle in degrees +octave> sind(0) ans = 0 octave> cosd(30) @@ -59,6 +65,7 @@
Compute inverse trigonometric ratios (angles are in radians and degrees)
+# Inverse sine in radians
 octave> asin(0)
 ans = 0
 
@@ -76,7 +83,9 @@
 
 octave> acot(180)
 ans = 5.5555e-03
-
octave> asind(0) +
+# Inverse sine in degrees +octave> asind(0) ans = 0 octave> acosd(30) @@ -135,4 +144,4 @@ octave> acoth(180) ans = 5.5556e-03 -
\ No newline at end of file +
diff --git a/pages/learn/octave/fundamentals/gddggad.html b/pages/learn/octave/fundamentals/gddggad.html index 3e477f9..9aeaf67 100644 --- a/pages/learn/octave/fundamentals/gddggad.html +++ b/pages/learn/octave/fundamentals/gddggad.html @@ -8,36 +8,45 @@
 godarda@gd:~$ octave
 ...
+# Generate a random number between 0 and 1
 octave> rand(1)
 ans = 0.7154
 
+# Generate a random number between 0 and 10
 octave> rand(1)*10
 ans = 8.7886
 
+# Generate a random number between 0 and 100
 octave> rand(1)*100
 ans = 78.646
 
+# Generate a random number between 0 and 1000
 octave> rand(1)*1000
 ans = 387.05
 
+# Generate a random integer by rounding
 octave> round(rand(1)*1000)
 ans = 779
 
Generate random integer numbers
+# Generate a random integer between 1 and 100
 octave> randi(100)
 ans = 21
 
+# Generate a random integer between 1 and 1000
 octave> randi(1000)
 ans = 848
 
+# Generate a random integer in a specific range
 octave> randi([10,15])
 ans = 14
 
 octave> randi([10,15])
 ans = 10
 
+# Generate a matrix of random integers
 octave> randi(5,5)
 ans =
 
@@ -46,4 +55,4 @@
     2   4   3   2   3
     2   1   2   3   1
     3   5   5   3   2
-
\ No newline at end of file +
diff --git a/pages/learn/octave/fundamentals/gdeezgn.html b/pages/learn/octave/fundamentals/gdeezgn.html index 35c22a0..db86c35 100644 --- a/pages/learn/octave/fundamentals/gdeezgn.html +++ b/pages/learn/octave/fundamentals/gdeezgn.html @@ -7,6 +7,7 @@
 godarda@gd:~$ octave
 ...
+# Logical OR with numbers
 octave> 1 | 1
 ans = 1
 
@@ -18,7 +19,9 @@
 
 octave> 0 | 0
 ans = 0
-
octave> true | true +
+# Logical OR with booleans +octave> true | true ans = 1 octave> true | false @@ -29,7 +32,9 @@ octave> false | false ans = 0 -
octave> 1 & 1 +
+# Logical AND with numbers +octave> 1 & 1 ans = 1 octave> 1 & 0 @@ -40,7 +45,9 @@ octave> 0 & 0 ans = 0 -
octave> true & true +
+# Logical AND with booleans +octave> true & true ans = 1 octave> true & false @@ -51,7 +58,9 @@ octave> false & false ans = 0 -
octave> true+true +
+# Arithmetic operations with booleans +octave> true+true ans = 2 octave> false-true @@ -62,7 +71,9 @@ octave> true-true ans = 0 -
octave> 1==1 +
+# Comparison operators +octave> 1==1 ans = 1 octave> 1<1 @@ -73,4 +84,4 @@ octave> 1>=1 ans = 1 -
\ No newline at end of file +
diff --git a/pages/learn/octave/fundamentals/gdfxzpq.html b/pages/learn/octave/fundamentals/gdfxzpq.html index 12dcd7b..9da52a8 100644 --- a/pages/learn/octave/fundamentals/gdfxzpq.html +++ b/pages/learn/octave/fundamentals/gdfxzpq.html @@ -7,57 +7,71 @@
 godarda@gd:~$ octave
 ...
+# Addition
 octave> 10+20
 ans = 30
 
+# Subtraction
 octave> 10-20
 ans = -10
 
+# Multiplication
 octave> 10*20
 ans = 200
 
+# Division
 octave> 10/20
 ans = 0.5000
 
+# Exponentiation
 octave> 2^10
 ans = 1024
 
+# Modulo operation
 octave> mod(-7,4)
 ans = 1
 
 octave> mod(7,4)
 ans = 3
 
+# Remainder after division
 octave> rem(-7,4)
 ans = -3
 
Arithmetic operations on complex numbers
+# Add complex numbers directly
 octave> complex(4+5j)+complex(2+6j)
 ans =   6 + 11i
-    
+
+# Define complex variables
 octave> c1=4+5j
 c1 =  4 + 5i
 
 octave> c2=2+6j
 c2 =  2 + 6i
 
+# Add complex variables
 octave> c1+c2
 ans =   6 + 11i
 
+# Subtract complex variables
 octave> c1-c2
 ans =  2 - 1i
 
+# Multiply complex variables
 octave> c1*c2
 ans = -22 + 34i
 
+# Divide complex variables
 octave> c1/c2
 ans =  0.9500 - 0.3500i
 
round(), floor(), ceil() and fix() functions
+# Round to nearest integer
 octave> round(2.3)
 ans = 2
 
@@ -69,7 +83,9 @@
 
 octave> round(-2.8)
 ans = -3
-
octave> floor(2.3) +
+# Round down to nearest integer +octave> floor(2.3) ans = 2 octave> floor(2.8) @@ -80,7 +96,9 @@ octave> floor(-2.8) ans = -3 -
octave> ceil(2.3) +
+# Round up to nearest integer +octave> ceil(2.3) ans = 3 octave> ceil(2.8) @@ -91,7 +109,9 @@ octave> ceil(-2.8) ans = -2 -
octave> fix(2.3) +
+# Round towards zero +octave> fix(2.3) ans = 2 octave> fix(2.8) @@ -101,5 +121,5 @@ ans = -2 octave> fix(-2.8) -ans = -2 -
\ No newline at end of file +ans = -2 +
diff --git a/pages/learn/octave/fundamentals/gdgeiev.html b/pages/learn/octave/fundamentals/gdgeiev.html index 45658b8..1eb134a 100644 --- a/pages/learn/octave/fundamentals/gdgeiev.html +++ b/pages/learn/octave/fundamentals/gdgeiev.html @@ -7,12 +7,15 @@
 godarda@gd:~$ octave
 ...
+# Euler's number
 octave> e
 ans = 2.7183
 
+# Exponential function e^x
 octave> exp(0)
 ans = 1
 
+# Compute e^x - 1 accurately
 octave> expm1(0)
 ans = 0
 
@@ -31,12 +34,14 @@
 
 
Logarithms
+# Natural logarithm (base e)
 octave> log(0)
 ans = -Inf
 
 octave> log(1)
 ans = 0
 
+# Compute log(1+x) accurately
 octave> log1p(0)
 ans = 0
 
@@ -46,6 +51,7 @@
 octave> log(-1)
 ans =       0 + 3.1416i
 
+# Natural logarithm for real inputs
 octave> reallog(0)
 ans = -Inf
 
@@ -55,6 +61,7 @@
 octave> reallog(-1)
 error: reallog: produced complex result
 
+# Base-10 logarithm
 octave> log10(0)
 ans = -Inf
 
@@ -64,6 +71,7 @@
 octave> log10(2)
 ans = 0.3010
 
+# Base-2 logarithm
 octave> log2(0)
 ans = -Inf
 
@@ -76,31 +84,37 @@
 
 
Power, Square root and Cube root functions
+# Base-2 power
 octave> pow2(10)
 ans = 1024
 
+# Power function for real inputs
 octave:80> realpow(2,10)
 ans = 1024
 
+# Square root
 octave> sqrt(100)
 ans = 10
 
 octave> sqrt(-1)
 ans =  0 + 1i
 
+# Square root for non-negative real inputs
 octave> realsqrt(10)
 ans = 3.1623
 
 octave> realsqrt(-1)
 error: realsqrt: produced complex result
 
+# Cube root
 octave> cbrt(27)
 ans = 3.0000
 
+# Nth root of a number
 octave> nthroot(1,2)
 ans = 1
 
 octave> nthroot(4,2)
 ans = 2
 (4) ^ (1 / 2)
-
\ No newline at end of file +
diff --git a/pages/learn/octave/strings/gdawdqp.html b/pages/learn/octave/strings/gdawdqp.html index 9d40ac9..49542e6 100644 --- a/pages/learn/octave/strings/gdawdqp.html +++ b/pages/learn/octave/strings/gdawdqp.html @@ -7,33 +7,42 @@
 godarda@gd:~$ octave
 ...
+# Create a string variable
 octave> gd = "GoDarda"
 gd = GoDarda
 
+# Compare two strings for equality
 octave> strcmp(gd, "GoDarda")
 ans = 1
 
-octave> strcmp(gd, "KODINGWINDOW")
+# Compare strings case-sensitively
+octave> strcmp(gd, "GODARDA")
 ans = 0
 
-octave> strncmp(gd, "Koding", 6)
+# Compare the first n characters of strings
+octave> strncmp(gd, "Go", 2)
 ans = 1
 
+# Compare strings ignoring case
 octave> strcmpi("GD#12","gd#12")
 ans = 1
 
 octave> strcmpi("GD#12","gd#21")
 ans = 0
 
+# Compare the first n characters ignoring case
 octave> strncmpi("GD#12","gd",2)
 ans = 1
 
-octave> strrep(gd, "in", "#")
-ans = Kod#gw#dow
+# Replace occurrences of a substring
+octave> strrep(gd, "a", "#")
+ans = GoD#rd#
 
+# Check if the variable is a string
 octave> ischar(gd)
 ans = 1
 
+# Compare strings character by character
 octave> a="Hello"
 a = Hello
 
@@ -53,4 +62,4 @@
 
   1  1  1  1  1
 
-
\ No newline at end of file +
diff --git a/pages/learn/octave/strings/gdcvyzd.html b/pages/learn/octave/strings/gdcvyzd.html index 7534783..78a5832 100644 --- a/pages/learn/octave/strings/gdcvyzd.html +++ b/pages/learn/octave/strings/gdcvyzd.html @@ -7,46 +7,55 @@
 godarda@gd:~$ octave
 ...
+# Create a string variable
 octave> gd = "GoDarda#12"
 gd = GoDarda#12
+# Check if characters are alphabetic
 octave> isalpha(gd)
 ans =
 
   1  1  1  1  1  1  1  1  1  1  1  1  0  0  0
 
+# Check if characters are alphanumeric
 octave> isalnum(gd)
 ans =
 
   1  1  1  1  1  1  1  1  1  1  1  1  0  1  1
 
+# Check if characters are digits
 octave> isdigit(gd)
 ans =
 
   0  0  0  0  0  0  0  0  0  0  0  0  0  1  1
 
+# Check if characters are ASCII
 octave> isascii(gd)
 ans =
 
   1  1  1  1  1  1  1  1  1  1  1  1  1  1  1
 
+# Check if characters are letters
 octave> isletter(gd)
 ans =
 
   1  1  1  1  1  1  1  1  1  1  1  1  0  0  0
 
+# Check if characters are uppercase
 octave> isupper(gd)
 ans =
 
   1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
 
+# Check if characters are lowercase
 octave> islower(gd)
 ans =
 
   0  1  1  1  1  1  1  1  1  1  1  1  0  0  0
 
+# Check if characters are whitespace
 octave> isspace(gd)
 ans =
 
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
 
-
\ No newline at end of file +
diff --git a/pages/learn/octave/strings/gdeceiw.html b/pages/learn/octave/strings/gdeceiw.html index 223e6b9..644517f 100644 --- a/pages/learn/octave/strings/gdeceiw.html +++ b/pages/learn/octave/strings/gdeceiw.html @@ -7,35 +7,42 @@
 godarda@gd:~$ octave
 ...
+# Create a string variable
 octave> gd = "GoDarda"
 gd = GoDarda
 
-octave> startsWith(gd, "KODING")
+# Check if string starts with pattern
+octave> startsWith(gd, "GO")
 ans = 0
 
-octave> startsWith(gd, "Koding")
+octave> startsWith(gd, "Go")
 ans = 1
 
-octave> endsWith(gd, "ing")
+# Check if string ends with pattern
+octave> endsWith(gd, "ar")
 ans = 0
 
-octave> endsWith(gd, "dow")
+octave> endsWith(gd, "da")
 ans = 1
 
-octave> index(gd, "in")
+# Find index of first occurrence
+octave> index(gd, "a")
 ans = 4
 
-octave> rindex(gd, "in")
-ans = 8
+# Find index of last occurrence
+octave> rindex(gd, "a")
+ans = 7
 
+# Get character indices
 octave> unicode_idx(gd)
 ans =
 
-    1    2    3    4    5    6    7    8    9   10   11   12
+   1   2   3   4   5   6   7
 
-octave> strfind(gd, "WINDOW")
+# Find substring index
+octave> strfind(gd, "DARDA")
 ans = [](0x0)
 
-octave> strfind(gd, "window")
-ans = 7
-
\ No newline at end of file +octave> strfind(gd, "Darda") +ans = 3 +
diff --git a/pages/learn/octave/strings/gduaulz.html b/pages/learn/octave/strings/gduaulz.html index 22d2970..9d9513f 100644 --- a/pages/learn/octave/strings/gduaulz.html +++ b/pages/learn/octave/strings/gduaulz.html @@ -7,33 +7,43 @@
 godarda@gd:~$ octave
 ...
-octave> gd = "Koding"
-gd = Koding
+# Create a string variable
+octave> gd = "Go"
+gd = Go
 
-octave> gd = [gd, "window"]
+# Concatenate strings
+octave> gd = [gd, "Darda"]
 gd = GoDarda
 
+# Check variable type
 octave> typeinfo(gd)
 ans = string
 
-octave> gd(6)
-ans = g
+# Access character at specific index
+octave> gd(3)
+ans = D
 
-octave> gd(2:11)
-ans = odingwindo
+# Extract a substring
+octave> gd(2:6)
+ans = oDard
 
+# Get string length
 octave> length(gd)
-ans = 12
+ans = 7
 
+# Reverse the string
 octave> fliplr(gd)
-ans = wodniwgnidoK
+ans = adraDoG
 
+# Convert to uppercase
 octave> toupper(gd)
-ans = KODINGWINDOW
+ans = GODARDA
 
+# Convert to lowercase
 octave> tolower(gd)
 ans = godarda
 
+# Sort characters in the string
 octave> sort(gd)
-ans = Kddgiinnooww
-
\ No newline at end of file +ans = DGaador +
diff --git a/pages/learn/python/fundamentals/gddveuh.html b/pages/learn/python/fundamentals/gddveuh.html index c8077b4..5a5d68a 100644 --- a/pages/learn/python/fundamentals/gddveuh.html +++ b/pages/learn/python/fundamentals/gddveuh.html @@ -8,52 +8,69 @@ godarda@gd:~$ python3 ... >>> import math +# Get the value of pi >>> math.pi 3.141592653589793 +# Convert radians to degrees math.degrees(math.pi) 180.0 +# Convert degrees to radians >>> math.radians(180) 3.141592653589793 -
>>> math.sin(0) +
+# Sine of angle in radians +>>> math.sin(0) 0.0 +# Cosine of angle in radians >>> math.cos(30) 0.15425144988758405 +# Tangent of angle in radians >>> math.tan(45) 1.6197751905438615 -
>>> math.sin(math.radians(0)) +
+# Sine of angle in degrees +>>> math.sin(math.radians(0)) 0.0 +# Cosine of angle in degrees >>> math.cos(math.radians(30)) 0.8660254037844387 +# Tangent of angle in degrees >>> math.tan(math.radians(45)) 0.9999999999999999
Compute inverse trigonometric ratios
+# Inverse sine (arcsine)
 >>> math.asin(0)
 0.0
 
+# Inverse cosine (arccosine)
 >>> math.acos(0)
 1.5707963267948966
 
+# Inverse tangent (arctangent)
 >>> math.atan(1)
 0.7853981633974483
 
Compute hyperbolic trigonometric ratios
+# Hyperbolic sine
 >>> math.sinh(0)
 0.0
 
+# Hyperbolic cosine
 >>> math.cosh(0)
 1.0
 
+# Hyperbolic tangent
 >>> math.tanh(1)
 0.7615941559557649
-
\ No newline at end of file +
diff --git a/pages/learn/python/fundamentals/gdexazw.html b/pages/learn/python/fundamentals/gdexazw.html index e4442c0..7350012 100644 --- a/pages/learn/python/fundamentals/gdexazw.html +++ b/pages/learn/python/fundamentals/gdexazw.html @@ -7,7 +7,8 @@
 godarda@gd:~$ python3
 ...
->>> 1 and 1    #1 & 1
+# Logical AND with numbers
+>>> 1 and 1
 1
 
 >>> 1 and 0
@@ -18,7 +19,9 @@
 
 >>> 0 and 0
 0
-
>>> 1 or 1 #1 | 1 +
+# Logical OR with numbers +>>> 1 or 1 1 >>> 1 or 0 @@ -29,7 +32,9 @@ >>> 0 or 0 0 -
>>> True and True #True & True +
+# Logical AND with booleans +>>> True and True True >>> True and False @@ -40,7 +45,9 @@ >>> False and False False -
>>> True or True #True | True +
+# Logical OR with booleans +>>> True or True True >>> True or False @@ -51,12 +58,16 @@ >>> False or False False -
>>> not True +
+# Logical NOT +>>> not True False >>> not False True -
>>> print(True+True) +
+# Arithmetic operations with booleans +>>> print(True+True) 2 >>> print(True-False) @@ -64,7 +75,9 @@ >>> print(False-True) -1 -
>>> 1==1 +
+# Comparison operators +>>> 1==1 True >>> 1<1 @@ -81,7 +94,9 @@ >>> -0.0==0.0 True -
>>> a='Hello' +
+# String comparison +>>> a='Hello' >>> b='hello' >>> a==b False @@ -89,4 +104,4 @@ >>> b='Hello' >>> a==b True -
\ No newline at end of file +
diff --git a/pages/learn/python/fundamentals/gdvyafu.html b/pages/learn/python/fundamentals/gdvyafu.html index 35015b9..cdd091f 100644 --- a/pages/learn/python/fundamentals/gdvyafu.html +++ b/pages/learn/python/fundamentals/gdvyafu.html @@ -7,30 +7,39 @@
 godarda@gd:~$ python3
 ...
+# Addition
 >>> 10+20
 30
 
+# Subtraction
 >>> 10-20
 -10
 
+# Multiplication
 >>> 10*20
 200
 
+# Power
 >>> 2**10
 1024
 
+# Division
 >>> 10/20
 0.5
 
+# Floor Division
 >>> 10//20
 0
 
+# Modulus
 >>> 7%4
 3
 
+# Bitwise XOR
 >>> 7^4
 3
 
+# Bitwise XOR
 >>> -7^4
 -3
 
@@ -40,15 +49,19 @@ >>> c1=4+5j >>> c2=2+6j +# Addition >>> print(c1+c2) (6+11j) +# Subtraction >>> print(c1-c2) (2-1j) +# Multiplication >>> print(c1*c2) (-22+34j) +# Division >>> print(c1/c2) (0.95-0.35000000000000003j)
@@ -73,4 +86,4 @@ >>> b 10 -
\ No newline at end of file +
diff --git a/pages/learn/python/fundamentals/gdwwvga.html b/pages/learn/python/fundamentals/gdwwvga.html index 785cb93..ab6650b 100644 --- a/pages/learn/python/fundamentals/gdwwvga.html +++ b/pages/learn/python/fundamentals/gdwwvga.html @@ -8,36 +8,49 @@ godarda@gd:~$ python3 ... >>> import math +# Get the value of pi >>> math.pi 3.141592653589793 +# Get the value of Euler's number >>> math.e 2.718281828459045 +# Exponential function e^x >>> math.exp(1) 2.718281828459045 +# Positive infinity constant >>> math.inf inf +# Not a Number (NaN) constant >>> math.nan nan -
>>> math.factorial(10) +
+# Calculate factorial +>>> math.factorial(10) 3628800 +# Floating point remainder >>> math.fmod(7,3) 1.0 >>> math.fmod(10.5,3.5) 0.0 +# Accurate floating point sum >>> math.fsum([1,1.1,3.14]) 5.24 +# Split into fractional and integer parts >>> math.modf(10.5) (0.5, 10.0) -
>>> math.gcd(18,21) +
+# Greatest Common Divisor (GCD) +>>> math.gcd(18,21) 3 +# Least Common Multiple (LCM) >>> math.lcm(24,36) 72
@@ -45,15 +58,19 @@
Logarithm functions
 >>> import math
+# Natural logarithm (base e)
 >>> math.log(2)
 0.6931471805599453
 
+# Base-10 logarithm
 >>> math.log10(2)
 0.3010299956639812
 
+# Base-2 logarithm
 >>> math.log2(2)
 1.0
 
+# Logarithm with specific base
 >>> math.log(2,10)
 0.30102999566398114
 
@@ -64,24 +81,29 @@
 
sqrt(), cbrt() and pow() functions
 >>> import math
+# Square root
 >>> math.sqrt(25)
 5.0
 
 >>> math.sqrt(20)
 4.47213595499958
 
+# Cube root
 >>> math.cbrt(27)
 3.0000000000000004
 
+# Power function
 >>> math.pow(2,10)
 1024.0
 
+# Power operator
 >>> 2**10
 1024
 
round(), floor(), ceil() and trunc() functions
+# Round float to nearest integer
 >>> round(2.3)
 2
 
@@ -93,12 +115,16 @@
 
 >>> round(-2.8)
 -3
-
>>> abs(2.3) +
+# Absolute value +>>> abs(2.3) 2.3 >>> abs(-2.3) 2.3 -
>>> import math +
+# Floor: largest integer <= x +>>> import math >>> math.floor(2.3) 2 @@ -110,7 +136,9 @@ >>> math.floor(-2.8) -3 -
>>> math.ceil(2.3) +
+# Ceil: smallest integer >= x +>>> math.ceil(2.3) 3 >>> math.ceil(2.8) @@ -121,7 +149,9 @@ >>> math.ceil(-2.8) -2 -
>>> math.trunc(2.3) +
+# Truncate to integer +>>> math.trunc(2.3) 2 >>> math.trunc(2.8) @@ -132,7 +162,9 @@ >>> math.trunc(-2.8) -2 -
>>> math.fabs(2.3) +
+# Absolute value as float +>>> math.fabs(2.3) 2.3 >>> math.fabs(-2.3) @@ -141,30 +173,38 @@
Explicit type conversion using int() and float() functions
+# Convert float to int
 >>> int(7.99)
 7
 
+# Convert int to float
 >>> float(7)
 7.0
 
+# Convert string to integer
 >>> a=int('10')
 >>> b=int('20')
 >>> c=a+b
 >>> c
 30
-
>>> float('inf') +
+# Infinity constant +>>> float('inf') inf +# Not a Number (NaN) constant >>> float('nan') nan >>> import math +# Check for infinity >>> math.isinf(0) False >>> math.isinf(float('inf')) True +# Check for NaN >>> math.isnan(float('nan')) True
@@ -172,36 +212,50 @@
Number conversion using int(), bin(), oct(), and hex() functions
 >>> n=255
+# Convert to binary string
 >>> print("Binary",bin(n))
 Binary 0b11111111
 
+# Convert to octal string
 >>> print("Octal",oct(n))
 Octal 0o377
 
+# Convert to hexadecimal string
 >>> print("Hexadecimal",hex(n))
 Hexadecimal 0xff
-
>>> n="11111111" +
+# Convert binary string to decimal +>>> n="11111111" >>> print("Decimal",int(n,2)) Decimal 255 +# Convert binary string to octal >>> print("Octal",oct(int(n,2))) Octal 0o377 +# Convert binary string to hexadecimal >>> print("Hexadecimal",hex(int(n,2))) Hexadecimal 0xff -
>>> n=0o377 +
+# Convert octal string to decimal +>>> n=0o377 >>> print("Decimal",int(n)) Decimal 255 +# Convert octal string to hexadecimal >>> print("Hexadecimal",hex(n)) Hexadecimal 0xff -
>>> n=0Xff +
+# Convert hexadecimal string to decimal +>>> n=0Xff >>> print("Decimal",int(n)) Decimal 255 +# Convert hexadecimal string to octal >>> print("Octal",oct(n)) Octal 0o377 +# Convert hexadecimal string to binary >>> print("Binary",bin(n)) Binary 0b11111111 -
\ No newline at end of file +
diff --git a/pages/learn/python/fundamentals/gdzexcz.html b/pages/learn/python/fundamentals/gdzexcz.html index 46c9d1a..a2def14 100644 --- a/pages/learn/python/fundamentals/gdzexcz.html +++ b/pages/learn/python/fundamentals/gdzexcz.html @@ -7,29 +7,36 @@
 godarda@gd:~$ python3
 ...
+# Check type of string
 >>> type('Hello, World!')
 <class 'str'>
 
+# Check type of integer
 >>> type(7)
 <class 'int'>
 
+# Check type of float
 >>> type(7.23)
 <class 'float'>
 
+# Check type of boolean
 >>> type(True)
 <class 'bool'>
 
 >>> type(False)
 <class 'bool'>
 
+# Check type of list
 >>> a=[1, 2, 3, 4, 5]
 >>> type(a)
 <class 'list'>
 
+# Check type of integer (parentheses don't make a tuple)
 >>> a=(1)
 >>> type(a)
 <class 'int'>
 
+# Check type of tuple
 >>> a=(1, 1.1)
 >>> type(a)
 <class 'tuple'>
@@ -37,33 +44,41 @@
 
 
range() function
+# Create a range object
 >>> range(10)
 range(0, 10)
 
+# Convert range to list (0 to 9)
 >>> list(range(10))
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
+# Range with start and stop (5 to 9)
 >>> list(range(5,10))
 [5, 6, 7, 8, 9]
 
+# Range with step 1
 >>> list(range(0,10,1))
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
+# Range with step 2
 >>> list(range(0,10,2))
 [0, 2, 4, 6, 8]
- 
+
+# Range with step 3
 >>> list(range(0,10,3))
 [0, 3, 6, 9]
 
chr() and ord() functions
+# Get character from ASCII code
 >>> chr(42)
 '*'
 
 >>> chr(65)
 'A'
 
+# Get ASCII code of character
 >>> ord('A')
 65
 
@@ -74,42 +89,55 @@
 
bytes() and bytearray() functions
 >>> a=[1,2,3,4,5,6]
+# Access first element
 >>> a[0]
 1
 
+# Access last element
 >>> a[-1]
 6
 
+# Modify last element
 >>> a[-1]=-1000
 >>> a
 [1, 2, 3, 4, 5, -1000]
 
+# Try converting invalid list to bytes
 >>> exp=bytes(a)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ValueError: bytes must be in range(0, 256)
 
+# Modify last element to valid byte
 >>> a[-1]=255
 >>> a
 [1, 2, 3, 4, 5, 255]
 
+# Convert list to bytes
 >>> exp=bytes(a)
+# Bytes are immutable (error)
 >>> exp[-1]=6
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'bytes' object does not support item assignment
-
>>> a=[1,2,3,4,5,6] +
+>>> a=[1,2,3,4,5,6] +# Convert list to bytearray >>> exp=bytearray(a) +# Access first element >>> exp[0] 1 +# Access last element >>> exp[-1] 6 +# Bytearray is mutable >>> exp[-1]=255 >>> exp bytearray(b'\x01\x02\x03\x04\x05\xff') +# Iterate over bytearray >>> for i in exp: print(i) ... 1 @@ -118,5 +146,5 @@ 4 5 255 ->>> -
\ No newline at end of file +>>> +
diff --git a/pages/learn/python/networking/gdyslwy.html b/pages/learn/python/networking/gdyslwy.html index 11411bc..b4c50ed 100644 --- a/pages/learn/python/networking/gdyslwy.html +++ b/pages/learn/python/networking/gdyslwy.html @@ -13,8 +13,11 @@ Processing triggers for man-db (2.11.2-1) ... root@gd:/home/godarda# python3 ... +# Import the module >>> from netaddr import * +# Create an IP address object >>> ip=IPAddress('192.168.122.1') +# Check IP version >>> ip.version 4 @@ -24,31 +27,39 @@
Numerical Representation
+# Integer representation
 >>> int(ip)
 3232266753
 
+# Hexadecimal representation
 >>> hex(ip)
 '0xc0a87a01'
 
+# Binary string representation
 >>> ip.bin
 '0b11000000101010000111101000000001'
 
+# Bits representation
 >>> ip.bits()
 '11000000.10101000.01111010.00000001'
 
+# Tuple of octets
 >>> ip.words
 (192, 168, 122, 1)
 
IPAddress Function
+# Convert to IPv6
 >>> ip=IPAddress('192.168.122.1').ipv6()
 >>> ip
 IPAddress('::ffff:192.168.122.1')
 
+# Check IP version
 >>> ip.version
 6
 
+# Check if IPv4 mapped
 >>> ip.is_ipv4_mapped()
 True
 
@@ -67,28 +78,37 @@
 >>> ip.bits()
 '0000000000000000:0000000000000000:0000000000000000:0000000000000000
 :0000000000000000:1111111111111111:1100000010101000:0111101000000001'
-
>>> ip=IPAddress('::ffff:192.168.122.1').ipv4() +
+# Convert to IPv4 +>>> ip=IPAddress('::ffff:192.168.122.1').ipv4() >>> ip IPAddress('192.168.122.1') +# Check if multicast >>> ip.is_multicast() False +# Check if unicast >>> ip.is_unicast() True +# Check if private >>> ip.is_private() True +# Check if reserved >>> ip.is_reserved() False +# Check if netmask >>> ip.is_netmask() False +# Check if hostmask >>> ip.is_hostmask() False -
>>> IPAddress('255.255.255.255').is_netmask() +
+>>> IPAddress('255.255.255.255').is_netmask() True >>> IPAddress('255.255.255.255').is_hostmask() @@ -100,37 +120,46 @@ >>> IPAddress('224.0.0.0').is_multicast() True +# Check if loopback >>> IPAddress('127.1.1.0').is_loopback() True >>> IPAddress('::1').is_loopback() True +# Compare IP addresses >>> IPAddress('::1')==IPAddress('127.1.1.0') False +# Reverse DNS lookup >>> ip.reverse_dns '1.122.168.192.in-addr.arpa.'
IPNetwork Function
+# Create a network object
 >>> ip=IPNetwork('192.168.122.1/24')
 >>> ip
 IPNetwork('192.168.122.1/24')
 
+# Get network address
 >>> ip.network
 IPAddress('192.168.122.0')
 
+# Get broadcast address
 >>> ip.broadcast
 IPAddress('192.168.122.255')
 
+# Get netmask
 >>> ip.netmask
 IPAddress('255.255.255.0')
 
+# Get hostmask
 >>> ip.hostmask
 IPAddress('0.0.0.255')
 
+# Get number of IP addresses
 >>> ip.size
 256
 
@@ -141,10 +170,12 @@
 
 >>> ip.size
 4096
-
>>> ip=IPNetwork('192.168.122.1/24') +
+>>> ip=IPNetwork('192.168.122.1/24') >>> ip IPNetwork('192.168.122.1/24') +# Get CIDR representation >>> ip.cidr IPNetwork('192.168.122.0/24') @@ -160,16 +191,19 @@ >>> ip.broadcast.bits() '11000000.10101000.01111010.11111111' +# List all IP addresses >>> ip_list=list(ip) >>> ip_list ... ... +# Get length of network >>> len(ip) 256 >>> len(ip_list) 256 +# Access specific IP by index >>> ip[-1] IPAddress('192.168.122.255') @@ -178,7 +212,9 @@ >>> ip[255] IPAddress('192.168.122.255') -
>>> IPNetwork('192.168.122.1/24')==IPNetwork('192.168.122.255/24') +
+# Compare networks +>>> IPNetwork('192.168.122.1/24')==IPNetwork('192.168.122.255/24') True >>> IPNetwork('192.168.122.1/24')==IPNetwork('192.168.122.0/24') @@ -190,9 +226,11 @@
IPRange Function
+# Create an IP range
 >>> ip=IPRange('192.168.122.1','192.168.122.15')
+# Get CIDR blocks for the range
 >>> ip.cidrs()
-[IPNetwork('192.168.122.1/32'), IPNetwork('192.168.122.2/31'), 
+[IPNetwork('192.168.122.1/32'), IPNetwork('192.168.122.2/31'),
 IPNetwork('192.168.122.4/30'), IPNetwork('192.168.122.8/29')]
 
 >>> IPRange('192.168.122.0','192.168.122.255')==IPNetwork('192.168.122.1/24')
@@ -204,15 +242,18 @@
 
 
IPSet Function
+# Create an empty IP set
 >>> IPSet()
 IPSet([])
 
+# Create a set with initial CIDR
 >>> IPSet(['192.168.122.1/24'])
 IPSet(['192.168.122.1/24'])
 
+# Iterate over IPs in the set
 >>> for ip in IPSet(['192.168.122.1/24']):
 ...     print(ip)
-... 
+...
 192.168.122.0
 192.168.122.1
 192.168.122.2
@@ -223,15 +264,18 @@
 .
 .
 
+# Add to set
 >>> S1=IPSet()
 >>> S1.add('192.168.122.1/24')
 >>> S1
 IPSet(['192.168.122.1/24'])
 
+# Remove from set
 >>> S1.remove('192.168.122.1/24')
 >>> S1
 IPSet([])
 
+# Add range to set
 >>> S1.add(IPRange('192.168.122.0','192.168.122.255'))
 >>> S1
 IPSet(['192.168.122.0/24'])
@@ -239,49 +283,59 @@
 >>> S1.remove(IPRange('192.168.122.6','192.168.122.255'))
 >>> S1
 IPSet(['192.168.122.0/30', '192.168.122.4/31'])
-
>>> S1=IPSet(['192.168.122.1','192.168.122.255']) +
+>>> S1=IPSet(['192.168.122.1','192.168.122.255']) >>> S2=IPSet(['192.168.122.1/24','192.168.122.255/24']) >>> S1 IPSet(['192.168.122.1/32', '192.168.122.255/32']) >>> S2 IPSet(['192.168.122.0/24']) +# Check superset >>> S1.issuperset(S2) False >>> S2.issuperset(S1) True +# Check subset >>> S1.issubset(S2) True >>> S2.issubset(S1) False +# Union >>> S1 | S2 IPSet(['192.168.122.0/24']) +# Intersection >>> S1 & S2 IPSet(['192.168.122.1/32', '192.168.122.255/32']) +# Difference >>> S1 - S2 IPSet([]) +# Symmetric difference >>> S1 ^ S2 -IPSet(['192.168.122.0/32', '192.168.122.2/31', '192.168.122.4/30', '192.168.122.8/29', -'192.168.122.16/28', '192.168.122.32/27', '192.168.122.64/26', '192.168.122.128/26', -'192.168.122.192/27', '192.168.122.224/28', '192.168.122.240/29', '192.168.122.248/30', +IPSet(['192.168.122.0/32', '192.168.122.2/31', '192.168.122.4/30', '192.168.122.8/29', +'192.168.122.16/28', '192.168.122.32/27', '192.168.122.64/26', '192.168.122.128/26', +'192.168.122.192/27', '192.168.122.224/28', '192.168.122.240/29', '192.168.122.248/30', '192.168.122.252/31', '192.168.122.254/32']) +# Check if disjoint >>> S1.isdisjoint(S2) False +# Update set >>> S2.update(IPRange('192.168.123.1','192.168.123.255')) >>> S2 -IPSet(['192.168.122.0/24', '192.168.123.1/32', '192.168.123.2/31', -'192.168.123.4/30', '192.168.123.8/29', '192.168.123.16/28', +IPSet(['192.168.122.0/24', '192.168.123.1/32', '192.168.123.2/31', +'192.168.123.4/30', '192.168.123.8/29', '192.168.123.16/28', '192.168.123.32/27', '192.168.123.64/26', '192.168.123.128/25']) +# Clear set >>> S2.clear() >>> S2 IPSet([]) @@ -290,6 +344,7 @@ >>> S1 IPSet(['192.168.122.255/32']) +# Check if contiguous >>> S1.iscontiguous() True -
\ No newline at end of file +
diff --git a/pages/learn/python/strings/gddduzz.html b/pages/learn/python/strings/gddduzz.html index 59220db..8e18ae4 100644 --- a/pages/learn/python/strings/gddduzz.html +++ b/pages/learn/python/strings/gddduzz.html @@ -7,32 +7,41 @@
 godarda@gd:~$ python3
 ...
+# Create string with double quotes
 >>> "GoDarda"
 'GoDarda'
 
+# Create string with single quotes
 >>> 'GoDarda'
 'GoDarda'
 
+# Print a string
 >>> print("GoDarda")
 GoDarda
 
+# Print string with escaped single quotes
 >>> print("\'GoDarda\'")
 'GoDarda'
 
+# Print string with escaped double quotes
 >>> print('\"GoDarda\"')
 "GoDarda"
 
->>> print("Koding\nwindow")
-Koding
-window
+# Print string with newline character
+>>> print("Go\nDarda")
+Go
+Darda
 
+# Assign string to a variable
 >>> gd="GoDarda"
 >>> gd
 'GoDarda'
 
+# Get length of the string
 >>> len(gd)
-12
+7
 
+# Delete the variable
 >>> del gd
 >>> gd
 Traceback (most recent call last):
@@ -42,40 +51,49 @@
 
 
Strings Concatenation
->>> s1="Koding"
->>> s2="window"
+>>> s1="Go"
+>>> s2="Darda"
+# Concatenate string with itself
 >>> s1+s1
-'KodingKoding'
+'GoGo'
 
+# Concatenate two strings
 >>> s1+s2
 'GoDarda'
 
+# Repeat string n times
 >>> s1*5
-'KodingKodingKodingKodingKoding'
+'GoGoGoGoGo'
 
+# Create a tuple of strings
 >>> s1,s2
-('Koding', 'window')
+('Go', 'Darda')
 
Escape Characters
->>> gd="Koding\nwindow"
+# String with newline escape sequence
+>>> gd="Go\nDarda"
 >>> gd
-'Koding\nwindow'
+'Go\nDarda'
 
->>> gd="Koding\nwindow"
+# Print interpreting escape sequences
+>>> gd="Go\nDarda"
 >>> print(gd)
-Koding
-window
- 
->>> gd=r"Koding\nwindow"
+Go
+Darda
+
+# Raw string (ignores escape sequences)
+>>> gd=r"Go\nDarda"
 >>> print(gd)
-Koding\nwindow
- 
+Go\nDarda
+
+# Escape double quotes
 >>> print('\"GoDarda\"')
 "GoDarda"
 
->>> gd="Koding\twindow"
+# String with tab escape sequence
+>>> gd="Go\tDarda"
 >>> print(gd)
-Koding	window
-
\ No newline at end of file +Go Darda +
diff --git a/pages/learn/python/strings/gdkgyxy.html b/pages/learn/python/strings/gdkgyxy.html index e3d90ac..5bf574d 100644 --- a/pages/learn/python/strings/gdkgyxy.html +++ b/pages/learn/python/strings/gdkgyxy.html @@ -7,62 +7,79 @@
 godarda@gd:~$ python3
 ...
->>> s1="Koding"
->>> s2="window"
+# Assign string variables
+>>> s1="Go"
+>>> s2="Darda"
+# Concatenate strings
 >>> s3=s1+s2
 >>> s3
 'GoDarda'
 
+# Check for equality
 >>> s1==s2
 False
 
+# Check for inequality
 >>> s1!=s2
 True
 
+# Check if s1 is greater than s2
 >>> s1>s2
-False
+True
 
+# Check if s1 is less than s2
 >>> s1<s2
-True
+False
 
+# Check if greater than or equal
 >>> s3>=s3
 True
 
+# Check if less than or equal
 >>> s3<=s3
 True
 
+# Check for equality
 >>> s3==s3
 True
 
+# Check for inequality
 >>> s3!=s3
 False
 
+# Check if objects are identical
 >>> s3 is s3
 True
 
+# Check if objects are not identical
 >>> s3 is not s3
 False
 
Strings are immutable (one can't alter the contents of the object)
->>> s1="Koding"
->>> s2="window"
+# Assign string variables
+>>> s1="Go"
+>>> s2="Darda"
+# Get the unique identifier of the object
 >>> id(s1)
 140269279579312
 
 >>> id(s2)
 140269256679152
 
+# Reassign s1 to point to s2
 >>> s1=s2
+# Check IDs after reassignment
 >>> id(s1)
 140269256679152
 
 >>> id(s2)
 140269256679152
 
+# Try to modify a character (raises error)
 >>> s2[0]="W"
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'str' object does not support item assignment
-
\ No newline at end of file +
diff --git a/pages/learn/python/strings/gdozvev.html b/pages/learn/python/strings/gdozvev.html index 3b4733d..314aa23 100644 --- a/pages/learn/python/strings/gdozvev.html +++ b/pages/learn/python/strings/gdozvev.html @@ -7,6 +7,7 @@
 godarda@gd:~$ python3
 ...
+# Check if all characters are alphabetic
 >>> s="Hello World!"
 >>> s.isalpha()
 False
@@ -22,6 +23,7 @@
 
 
String isalnum() method
+# Check if all characters are alphanumeric
 >>> s="Hello World!"
 >>> s.isalnum()
 False
@@ -37,6 +39,7 @@
 
 
String isdigit() method
+# Check if all characters are digits
 >>> s="13HelloWorld13"
 >>> s.isdigit()
 False
@@ -49,6 +52,7 @@
 >>> s.isdigit()
 False
 
+# Check if unicode superscript is a digit
 >>> s="\u00B2"
 >>> s.isdigit()
 True
@@ -56,14 +60,17 @@
 
 
String isdecimal() method
+# Check if unicode superscript is a decimal
 >>> s="\u00B2"    # to the power 2
 >>> s.isdecimal()
 False
 
+# Check if characters are decimals
 >>> s="0123456789"
 >>> s.isdecimal()
 True
 
+# Check if unicode fraction is a decimal
 >>> s="\u00BD"    # 1/2
 >>> s.isdecimal()
 False
@@ -71,18 +78,22 @@
 
 
String isnumeric() method
+# Check if unicode superscript is numeric
 >>> s="\u00B2"
 >>> s.isnumeric()
 True
 
+# Check if digits are numeric
 >>> s="0123456789"
 >>> s.isnumeric()
 True
 
+# Check if string representation of fraction is numeric
 >>> s="1/2"
 >>> s.isnumeric()
 False
 
+# Check if unicode fraction is numeric
 >>> s="\u00BD"    # 1/2
 >>> s.isnumeric()
 True
@@ -90,6 +101,7 @@
 
 
String isspace() method
+# Check if string contains only whitespace
 >>> s="Hello World!"
 >>> s.isspace()
 False
@@ -101,6 +113,7 @@
 
 
String istitle() method
+# Check if string is title cased
 >>> s="Hello World!"
 >>> s.istitle()
 True
@@ -112,18 +125,21 @@
 
 
String islower() and isupper() methods
+# Check if string is lowercase
 >>> s="hello world!"
 >>> s.islower()
 True
 
+# Check if string is uppercase
 >>> s="HELLO, WORLD!"
 >>> s.isupper()
 True
 
+# Check mixed case
 >>> s="Hello, World!"
 >>> s.islower()
 False
 
 >>> s.isupper()
 False
-
\ No newline at end of file +
diff --git a/pages/learn/python/strings/gdyqzaz.html b/pages/learn/python/strings/gdyqzaz.html index 4c16638..d829e37 100644 --- a/pages/learn/python/strings/gdyqzaz.html +++ b/pages/learn/python/strings/gdyqzaz.html @@ -7,11 +7,12 @@
 godarda@gd:~$ python3
 ...
->>> gd="KoDiNgWiNdOw"
+# Casefold string (stronger lowercase)
+>>> gd="GoDaRdA"
 >>> gd.casefold()
 'godarda'
 
->>> gd="KODINGWINDOW"
+>>> gd="GODARDA"
 >>> gd.casefold()
 'godarda'
 
@@ -19,76 +20,90 @@
 >>> gd.casefold()
 'godarda'
 
->>> gd="koding window"
+# Capitalize first character
+>>> gd="go darda"
 >>> gd.capitalize()
-'Koding window'
+'Go darda'
 
+# Convert to title case
 >>> gd.title()
-'Koding Window'    
+'Go Darda'
 
String upper(), lower() and swapcase() methods
+# Convert to uppercase
 >>> gd="godarda"
 >>> gd.upper()
-'KODINGWINDOW'
+'GODARDA'
 
->>> gd="KODINGWINDOW"
+# Convert to lowercase
+>>> gd="GODARDA"
 >>> gd.lower()
 'godarda'
 
+# Swap case
 >>> gd="GoDarda"
 >>> gd.swapcase()
-'kODINGwINDOW'    
+'gOdARDA'
 
String rjust() and ljust() methods
+# Right justify string
 >>> gd="GoDarda"
 >>> gd.rjust(20)
-'        GoDarda'
+'             GoDarda'
 
+# Left justify string
 >>> gd.ljust(20)
-'GoDarda        '
+'GoDarda             '
 
String strip(), rstrip(), and lstrip() methods
+# Remove leading and trailing whitespace
 >>> gd="    GoDarda           "
 >>> gd.strip()
-'GoDarda' 
+'GoDarda'
 
+# Remove trailing whitespace
 >>> gd.rstrip()
 '    GoDarda'
 
+# Remove leading whitespace
 >>> gd.lstrip()
 'GoDarda           '
 
String find() and count() methods
+# Find substring index
 >>> gd="GoDarda"
->>> gd.find("W",0,len(gd))
-6
+>>> gd.find("D",0,len(gd))
+2
 
->>> gd.find("in",0,len(gd))
+>>> gd.find("ar",0,len(gd))
 3
 
->>> gd.count("in",1,len(gd))
+# Count occurrences of substring
+>>> gd.count("a",1,len(gd))
 2
 
->>> gd.count("o",1,len(gd))
-2  
+>>> gd.count("d",1,len(gd))
+1
 
Strings sort() method
->>> gd=["K","O","D","I","N","G","W","I","N","D","O","W"]
+# Sort list in place
+>>> gd=["G","o","D","a","r","d","a"]
 >>> gd.sort()
 >>> gd
-['D', 'D', 'G', 'I', 'I', 'K', 'N', 'N', 'O', 'O', 'W', 'W']
+['D', 'G', 'a', 'a', 'd', 'o', 'r']
 
->>> gd=("K","O","D","I","N","G","W","I","N","D","O","W")
+# Tuples are immutable and cannot be sorted in place
+>>> gd=("G","o","D","a","r","d","a")
 >>> gd.sort()
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
@@ -97,81 +112,94 @@
 
 
String startswith() and endswith() methods
+# Check if string starts with pattern
 >>> gd="GoDarda"
->>> gd.startswith("k")
+>>> gd.startswith("g")
 False
 
->>> gd.startswith("K")
+>>> gd.startswith("G")
 True
 
 >>> gd.startswith("GoDarda")
 True
 
+# Check if string ends with pattern
 >>> gd.endswith("GoDarda")
 True
 
->>> gd.endswith("ow")
+>>> gd.endswith("da")
 True
 
->>> gd.endswith("W")
-False  
+>>> gd.endswith("A")
+False
 
String zfill() and replace() method
+# Pad string with zeros
 >>> gd="GoDarda"
 >>> len(gd)
-12
+7
 
->>> gd.zfill(12)
+>>> gd.zfill(7)
 'GoDarda'
 
->>> gd.zfill(15)
-'000KodingWindow'
+>>> gd.zfill(10)
+'000GoDarda'
 
 >>> gd.zfill(0)
-'GoDarda'    
+'GoDarda'
 
->>> gd.replace("i","###")
-'Kod###ngW###ndow'
+# Replace substring
+>>> gd.replace("a","###")
+'GoD###rd###'
 
->>> gd.replace("W","###",1)
-'Koding###indow'
+# Replace first occurrence
+>>> gd.replace("D","###",1)
+'Go###arda'
 
->>> gd.replace("d","###",2)
-'Ko###ingWin###ow'
+>>> gd.replace("a","###",1)
+'GoD###rda'
 
String split() and splitlines() methods
->>> gd="Koding\nWindow"
+# Split string at line breaks
+>>> gd="Go\nDarda"
 >>> gd.splitlines()
-['Koding', 'Window']
+['Go', 'Darda']
 
+# Split string by separator
 >>> gd.split("\n")
-['Koding', 'Window']    
+['Go', 'Darda']
 
String functions and operations
+# Split string by whitespace
 >>> 'Hello, World!'.split()
-['hello,', 'world!']
+['Hello,', 'World!']
 
+# Sort characters in string
 >>> s1=("Hello, World!")
 >>> ''.join(sorted(s1))
 ' !,HWdellloor'
 
+# Sort and strip whitespace
 >>> ''.join(sorted(s1)).strip()
 '!,HWdellloor'
 
+# Print sorted characters list
 >>> print(sorted(s1))
 [' ', '!', ',', 'H', 'W', 'd', 'e', 'l', 'l', 'l', 'o', 'o', 'r']
 
+# Sort unique characters
 >>> ''.join(sorted(set(s1)))
 ' !,HWdelor'
 
+# Remove duplicates preserving order
 >>> strings="Kiwi Apple Orange Banana Kiwi Apple Kiwi"
 >>> words=strings.split()
 >>> print(' '.join(sorted(set(words),key=words.index)))
 Kiwi Apple Orange Banana
-
\ No newline at end of file +
diff --git a/pages/learn/python/strings/gdzdngz.html b/pages/learn/python/strings/gdzdngz.html index 395f53d..fc956a0 100644 --- a/pages/learn/python/strings/gdzdngz.html +++ b/pages/learn/python/strings/gdzdngz.html @@ -7,43 +7,54 @@
 godarda@gd:~$ python3
 ...
+# Create a string variable
 >>> gd="GoDarda"
 >>> gd
 'GoDarda'
 
+# Get string length
 >>> len(gd)
-12
+7
 
+# Access character at index 0
 >>> gd[0]
-'K'
-
->>> gd[11]
-'w'
-
>>> gd[0:12:1] +'G' + +# Access character at index 6 +>>> gd[6] +'a' +
+# Slice with start, stop, step +>>> gd[0:7:1] 'GoDarda' ->> gd[0:12:2] -'KdnWno' +>> gd[0:7:2] +'GDra' ->>> gd[0:12:3] -'KiWd' +>>> gd[0:7:3] +'Gaa' ->>> gd[::-1] reverse the given string -'wodniWgnidoK' -
>>> gd[::1] +# Reverse the string +>>> gd[::-1] +'adraDoG' +
+# Slice with step only +>>> gd[::1] 'GoDarda' >>> gd[::2] -'KdnWno' +'GDra' >>> gd[::3] -'KiWd' -
>>> gd[1::] -'odingWindow' +'Gaa' +
+# Slice from index to end +>>> gd[1::] +'oDarda' >>> gd[2::] -'dingWindow' +'Darda' >>> gd[3::] -'ingWindow' -
\ No newline at end of file +'arda' +
diff --git a/pages/learn/r/cli/gdadmvw.html b/pages/learn/r/cli/gdadmvw.html index b42cc38..b00e1b1 100644 --- a/pages/learn/r/cli/gdadmvw.html +++ b/pages/learn/r/cli/gdadmvw.html @@ -7,103 +7,132 @@
 godarda@gd:~$ R
 ...
+# check class of object
 > class(1)
 [1] "numeric"
 
+# check class of object
 > class(TRUE)
 [1] "logical"
 
+# check class of object
 > class(F)
 [1] "logical"
 
+# check class of object
 > class(matrix())
 [1] "matrix"
 
+# check class of object
 > class("GoDarda")
 [1] "character"
 
+# check class of object
 > class(Sys.time())
-[1] "POSIXct" "POSIXt" 
+[1] "POSIXct" "POSIXt"
 
+# check class of object
 > class(15L)
 [1] "integer"
 
+# check class of object
 > class(15+9i)
 [1] "complex"
 
+# check class of object
 > class(charToRaw("Hello World"))
 [1] "raw"
 
R typeof() function
+# check type of object
 > typeof(1)
 [1] "double"
 
+# check type of object
 > typeof(1.1)
 [1] "double"
 
+# check type of object
 > typeof("GoDarda")
 [1] "character"
 
+# check type of object
 > typeof(1L)
 [1] "integer"
 
+# check type of object
 > typeof(TRUE)
 [1] "logical"
 
+# check type of object
 > typeof(F)
 [1] "logical"
 
+# check type of object
 > typeof(-3+4i)
 [1] "complex"
 
+# check type of object
 > typeof(raw())
 [1] "raw"
 
+# check type of object
 > typeof(NULL)
 [1] "NULL"
 
R round() function
+# round to nearest integer
 > round(3.14)
 [1] 3
 
+# round to nearest integer
 > round(9.87)
 [1] 10
 
+# round to 3 decimal places
 > round(3.141492,digits=3)
 [1] 3.141
 
+# create raw vector
 > raw(10)
 [1] 00 00 00 00 00 00 00 00 00 00
 
R sample() function
+# sample from sequence
 > sample(1:36)
  [1]  9 15 20 16  3 30 26  4  5 10 33 36 24 32 12 19 22  8 13 34  2 35 23 18 29
 [26]  1 14 17  6  7 28 31 11 27 25 21
 
+# sample 1 element
 > sample(1:36,size=1)
 [1] 2
 
+# sample 1 element
 > sample(1:36,size=1)
 [1] 16
 
+# sample 1 element
 > sample(1:36,size=1)
 [1] 5
 
+# sample 5 elements
 > sample(1:36,size=5)
 [1]  7 13 33  6 22
 
R replicate() function
+# replicate string
 > replicate(3,'GoDarda')
 [1] "GoDarda" "GoDarda" "GoDarda"
 
+# replicate sequence
 > replicate(3,1:6)
      [,1] [,2] [,3]
 [1,]    1    1    1
@@ -116,25 +145,32 @@
 
 
R format() function
+# format number
 > format(3.141492,digits=3)
 [1] "3.14"
 
+# format string with width
 > format("GoDarda",width=20)
 [1] "GoDarda        "
 
+# format string with justify
 > format("GoDarda",width=20,justify="")
-Error in match.arg(justify) : 
+Error in match.arg(justify) :
   'arg' should be one of β€œleft”, β€œright”, β€œcentre”, β€œnone”
 
+# format string with justify left
 > format("GoDarda",width=20,justify="l")
 [1] "GoDarda        "
 
+# format string with justify center
 > format("GoDarda",width=20,justify="c")
 [1] "    GoDarda    "
 
+# format string with justify right
 > format("GoDarda",width=20,justify="r")
 [1] "        GoDarda"
 
+# format string with justify none
 > format("GoDarda",width=20,justify="n")
 [1] "GoDarda"
-
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdarfve.html b/pages/learn/r/cli/gdarfve.html index 72ce8e6..361605f 100644 --- a/pages/learn/r/cli/gdarfve.html +++ b/pages/learn/r/cli/gdarfve.html @@ -7,22 +7,27 @@
 godarda@gd:~$ R
 ...
+# create a list
 > flist <- list("Apple","Orange","Grapes","Apple")
 > flist
-[1] "Apple"  "Orange" "Grapes" "Apple" 
+[1] "Apple"  "Orange" "Grapes" "Apple"
 
+# length of list
 > length(flist)
 [1] 4
 
+# create a list of numbers
 > nlist <- list(1,2,3,4,5)
 > length(nlist)
 [1] 5
 
+# create a list of vector
 > nlist <- list(1:10)
 > nlist
 [[1]]
  [1]  1  2  3  4  5  6  7  8  9 10
 
+# length of list
 > length(nlist)
 [1] 1
-
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdazeek.html b/pages/learn/r/cli/gdazeek.html index 21c6b1f..c26cc4a 100644 --- a/pages/learn/r/cli/gdazeek.html +++ b/pages/learn/r/cli/gdazeek.html @@ -8,12 +8,14 @@
 godarda@gd:~$ R
 ...
+# create vectors
 > f <- c("Apple","Orange","Mango")
 > c <- c("Red","Orange","Yellow")
 > r <- c(200,100,500)
 > q <- c(12,12,12)
 > a <- c(FALSE,FALSE,TRUE)
 
+# create a data frame
 > df <- data.frame(f,c,r,q,a)
 > df
        f      c   r  q     a
@@ -21,6 +23,7 @@
 2 Orange Orange 100 12 FALSE
 3  Mango Yellow 500 12  TRUE
 
+# rename columns
 > names(df) <- c("Fruits","Colors","Rates","Quantity","Availability")
 > df
   Fruits Colors Rates Quantity Availability
@@ -28,6 +31,7 @@
 2 Orange Orange   100       12        FALSE
 3  Mango Yellow   500       12         TRUE
 
+# display structure of data frame
 > str(df)
 'data.frame':	3 obs. of  5 variables:
  $ Fruits      : Factor w/ 3 levels "Apple","Mango",..: 1 3 2
@@ -36,7 +40,7 @@
  $ Quantity    : num  12 12 12
  $ Availability: logi  FALSE FALSE TRUE
 
-Append a column to Data Frame
+# Append a column to Data Frame
 > t <- c("Sour","Bitter","Sweet")
 > df$Taste <- t
 > df
diff --git a/pages/learn/r/cli/gddlyle.html b/pages/learn/r/cli/gddlyle.html
index d5e10bc..b475c5a 100644
--- a/pages/learn/r/cli/gddlyle.html
+++ b/pages/learn/r/cli/gddlyle.html
@@ -7,37 +7,46 @@
 
 godarda@gd:~$ R
 ...
+# create a vector
 > c(1,2,3)
 [1] 1 2 3
 
+# add 10 to each element
 > c(1,2,3) + 10
 [1] 11 12 13
 
+# subtract 10 from each element
 > c(1,2,3) - 10
 [1] -9 -8 -7
 
+# add two vectors
 > c(1,2,3) + c(3,2,1)
 [1] 4 4 4
 
+# create a vector with different numbers
 > vector = c(1,2,4,5,9,-1.1)
 > vector
 [1]  1.0  2.0  4.0  5.0  9.0 -1.1
 
+# create a sequence of numbers
 > vector = 1:10
 > vector1 = 1:10
 > vector2 = 10:9
 > vector1 + vector2
  [1] 11 11 13 13 15 15 17 17 19 19
 
+# create a logical vector
 > print(c(T,T,F,F,T))
 [1]  TRUE  TRUE FALSE FALSE  TRUE
-
Comparing integers +
# Comparing integers > c(1:5) == 5 [1] FALSE FALSE FALSE FALSE TRUE +# square of each element > c(1:5) ^ 2 [1] 1 4 9 16 25 +# compare square of each element > c(1:5) ^ 2 >= 5 [1] FALSE FALSE TRUE TRUE TRUE -
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdegdgz.html b/pages/learn/r/cli/gdegdgz.html index 688540b..5ec42f1 100644 --- a/pages/learn/r/cli/gdegdgz.html +++ b/pages/learn/r/cli/gdegdgz.html @@ -8,36 +8,36 @@ godarda@gd:~$ R ... -Addition +# Addition > 1 + 1 [1] 2 -Subtraction +# Subtraction > 1 - 1 [1] 0 -Multiplication +# Multiplication > 10 * 10 [1] 100 -Division +# Division > 1 / 0 [1] Inf -Power or exponent +# Power or exponent > 0 ** 0 [1] 1 > 0 ^ 0 [1] 1 -Remainder +# Remainder > 10 %% 3 [1] 1
R sqrt() function
-Square root of a number
+# Square root of a number
 > sqrt(25)
 [1] 5
 
@@ -47,53 +47,63 @@
 
 
R sum() function
+# sum of two sequences
 > 1:10 + 11:20
 [1] 12 14 16 18 20 22 24 26 28 30
 
-Sum of sequence 1 to 10
+# Sum of sequence 1 to 10
 > sum(1:10)
 [1] 55
 
R mean() and median() functions
+# mean of sequence 1 to 10
 > mean(1:10)
 [1] 5.5
 
+# median of sequence 1 to 10
 > median(1:10)
 [1] 5.5
 
R identical() function
+# check if two objects are identical
 > identical(1,1)
 [1] TRUE
 
+# check if two objects are identical
 > identical(1,1.0)
 [1] TRUE
 
+# check if two objects are identical
 > identical(0 ^ 0,0 ** 0)
 [1] TRUE
 
R factorial() function
-Factorial of a number
+# Factorial of a number
 > factorial(0)
 [1] 1
 
+# Factorial of a number
 > factorial(100)
 [1] 9.332622e+157
 
R trigonometric function
+# value of pi
 > pi
 [1] 3.141593
 
+# sine of 30 radians
 > sin(30)
 [1] -0.9880316
 
+# tangent of 90 radians
 > tan(90)
 [1] -1.9952
-
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdexavz.html b/pages/learn/r/cli/gdexavz.html index 1e19478..dac48e8 100644 --- a/pages/learn/r/cli/gdexavz.html +++ b/pages/learn/r/cli/gdexavz.html @@ -7,11 +7,11 @@
 godarda@gd:~$ R
 ...
-Matrix creation
+# Matrix creation
 > matrix1 = matrix(1:9,nrow = 3,ncol = 3)
 > matrix2 = matrix(1:9,nrow = 3,ncol = 3)
 
-Addition
+# Addition
 > matrix3 = matrix1 + matrix2
 > matrix3
      [,1] [,2] [,3]
@@ -19,7 +19,7 @@
 [2,]    4   10   16
 [3,]    6   12   18
 
-Subtraction
+# Subtraction
 > matrix3 = matrix1 - matrix2
 > matrix3
      [,1] [,2] [,3]
@@ -27,7 +27,7 @@
 [2,]    0    0    0
 [3,]    0    0    0
 
-Division
+# Division
 > matrix3 = matrix1 / matrix2
 > matrix3
      [,1] [,2] [,3]
@@ -35,7 +35,7 @@
 [2,]    1    1    1
 [3,]    1    1    1
 
-Multiplication
+# Multiplication
 > matrix3 = matrix1 %*% matrix2
 > matrix3
      [,1] [,2] [,3]
@@ -43,7 +43,7 @@
 [2,]   36   81  126
 [3,]   42   96  150
 
-Transpose of a matrix
+# Transpose of a matrix
 > matrix2
      [,1] [,2] [,3]
 [1,]    1    4    7
@@ -57,13 +57,15 @@
 [2,]    4    5    6
 [3,]    7    8    9
 
+# Access element at row 3, column 3
 > matrix3[3,3]
 [1] 9
 
+# Access element at row 1, column 2
 > matrix3[1,2]
 [1] 2
 
-Substitution of a number
+# Substitution of a number
 > matrix3[1,1] = 100
 > matrix3
      [,1] [,2] [,3]
@@ -71,6 +73,7 @@
 [2,]    4    5    6
 [3,]    7    8    9
 
+# Substitution of a column
 > matrix3[,2] = 100
 > matrix3
      [,1] [,2] [,3]
@@ -78,6 +81,7 @@
 [2,]    4  100    6
 [3,]    7  100    9
 
+# Substitution of multiple columns
 > matrix3[,2:3] = 24
 > matrix3
      [,1] [,2] [,3]
@@ -85,7 +89,7 @@
 [2,]    4   24   24
 [3,]    7   24   24
 
-Matrix with four rows
+# Matrix with four rows
 > matrix(c(1,2,3,4,5,6,7,8,9,10,11,12),nrow = 4)
      [,1] [,2] [,3]
 [1,]    1    5    9
@@ -93,13 +97,14 @@
 [3,]    3    7   11
 [4,]    4    8   12
 
-Matrix with three rows and four columns
+# Matrix with three rows and four columns
 > matrix(c(1,2,3,4,5,6,7,8,9,10,11,12),nrow = 3,ncol = 4)
      [,1] [,2] [,3] [,4]
 [1,]    1    4    7   10
 [2,]    2    5    8   11
 [3,]    3    6    9   12
 
+# Matrix with 10 columns
 > matrix(1:50,ncol = 10)
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    6   11   16   21   26   31   36   41    46
@@ -108,6 +113,7 @@
 [4,]    4    9   14   19   24   29   34   39   44    49
 [5,]    5   10   15   20   25   30   35   40   45    50
 
+# Add 100 to each element
 > matrix(1:50,ncol = 10) + 100
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]  101  106  111  116  121  126  131  136  141   146
@@ -115,4 +121,4 @@
 [3,]  103  108  113  118  123  128  133  138  143   148
 [4,]  104  109  114  119  124  129  134  139  144   149
 [5,]  105  110  115  120  125  130  135  140  145   150
-
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdexdvy.html b/pages/learn/r/cli/gdexdvy.html index 70bfa9d..61f6abe 100644 --- a/pages/learn/r/cli/gdexdvy.html +++ b/pages/learn/r/cli/gdexdvy.html @@ -7,57 +7,72 @@
 godarda@gd:~$ R
 ...
+# current date
 > Sys.Date()
 [1] "2020-06-18"
 
+# current date and time
 > Sys.time()
 [1] "2020-06-18 17:41:48 IST"
 
+# convert to date
 > as.Date(Sys.Date())
 [1] "2020-06-18"
 
+# convert string to date
 > as.Date('2020/06/18')
 [1] "2020-06-18"
 
+# convert date with format
 > as.Date(Sys.Date(),format='%Y-%m-%d')
 [1] "2020-06-18"
 
+# convert string to date with format
 > as.Date('June 18, 2020',format='%B %d, %Y')
 [1] "2020-06-18"
 
+# convert string to date with format
 > as.Date('18JUN20',format='%d%b%y')
 [1] "2020-06-18"
 
+# get day of the week
 > weekdays(Sys.Date())
 [1] "Thursday"
-
> date1 <- Sys.Date() +
# date difference +> date1 <- Sys.Date() > date2 <- as.Date("2020-06-30") > date1-date2 Time difference of -12 days - + > date1 [1] "2020-06-18" > date2 [1] "2020-06-30" +# date difference > date2-date1 Time difference of 12 days +# date difference in weeks > difftime(date2,date1,units="weeks") Time difference of 1.714286 weeks +# add days to date > date2 + 20 [1] "2020-07-20" +# date difference in weeks > difftime(date2+20,date1,units="weeks") Time difference of 4.571429 weeks -
> seq(Sys.Date(),by='days',length=12) +
# sequence of dates +> seq(Sys.Date(),by='days',length=12) [1] "2020-06-18" "2020-06-19" "2020-06-20" "2020-06-21" "2020-06-22" [6] "2020-06-23" "2020-06-24" "2020-06-25" "2020-06-26" "2020-06-27" [11] "2020-06-28" "2020-06-29" +# sequence of dates > seq(Sys.Date(),to=as.Date("2020-12-31"),by='4 weeks') [1] "2020-06-18" "2020-07-16" "2020-08-13" "2020-09-10" "2020-10-08" [6] "2020-11-05" "2020-12-03" "2020-12-31" -
\ No newline at end of file +
diff --git a/pages/learn/r/cli/gdgebwv.html b/pages/learn/r/cli/gdgebwv.html index 5c60017..b5dd6c3 100644 --- a/pages/learn/r/cli/gdgebwv.html +++ b/pages/learn/r/cli/gdgebwv.html @@ -20,42 +20,42 @@ [1] 1 > nchar("GoDarda") -[1] 12 +[1] 7 > toupper("GoDarda") -[1] "KODINGWINDOW" +[1] "GODARDA" -> tolower("KODINGWINDOW") +> tolower("GODARDA") [1] "godarda" -> substring("GoDarda",7,12) -[1] "Window" +> substring("GoDarda",3,7) +[1] "Darda" -> paste("Koding","Window") -[1] "Koding Window" +> paste("Go","Darda") +[1] "Go Darda" -> paste("Koding","Window",sep="") +> paste("Go","Darda",sep="") [1] "GoDarda" -> paste("Koding","Window",sep="@@@") -[1] "Koding@@@Window" +> paste("Go","Darda",sep="@@@") +[1] "Go@@@Darda"
> format("GoDarda",width=20) -[1] "GoDarda " +[1] "GoDarda " > format("GoDarda",width=20,justify="") -Error in match.arg(justify) : +Error in match.arg(justify) : 'arg' should be one of β€œleft”, β€œright”, β€œcentre”, β€œnone” > format("GoDarda",width=20,justify="l") -[1] "GoDarda " +[1] "GoDarda " > format("GoDarda",width=20,justify="c") -[1] " GoDarda " +[1] " GoDarda " > format("GoDarda",width=20,justify="r") -[1] " GoDarda" +[1] " GoDarda" > format("GoDarda",width=20,justify="n") [1] "GoDarda" -
\ No newline at end of file +
diff --git a/pages/learn/selenium/xpath/gdzctqk.html b/pages/learn/selenium/xpath/gdzctqk.html index 22345fa..aab6394 100644 --- a/pages/learn/selenium/xpath/gdzctqk.html +++ b/pages/learn/selenium/xpath/gdzctqk.html @@ -12,20 +12,20 @@ class GD { - public static void main(String[] args) throws InterruptedException - { + public static void main(String[] args) throws InterruptedException + { System.setProperty("webdriver.chrome.driver", "/home/godarda/drivers/chromedriver"); WebDriver driver = new ChromeDriver(); driver.manage().window().maximize(); driver.navigate().to("https://godarda.in/testapp/"); - driver.findElement(By.name("username")).sendKeys("kodignwindow"); + driver.findElement(By.name("username")).sendKeys("godarda"); Thread.sleep(1000); - driver.findElement(By.name("password")).sendKeys("kodignwindow"); + driver.findElement(By.name("password")).sendKeys("godarda"); int count = driver.findElements(By.xpath("//input[@name='usertype']")).size(); - for(int i=0; i \ No newline at end of file +{%- endhighlight -%}
From edc4834d782b65aac0085f962a8f565fc79831d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 17:19:49 +0530 Subject: [PATCH 02/36] v26.2.2 --- .github/workflows/gdid_tracker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gdid_tracker.yml b/.github/workflows/gdid_tracker.yml index ecd12a6..0570b4a 100644 --- a/.github/workflows/gdid_tracker.yml +++ b/.github/workflows/gdid_tracker.yml @@ -64,7 +64,7 @@ jobs: # Create a Pull Request with updated GDID sets - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v7 + uses: peter-evans/create-pull-request@v8 with: commit-message: Auto-update GDID sets title: Auto-update GDID sets From cba088933358e8dc29c53885297bbfd4474c389d Mon Sep 17 00:00:00 2001 From: Shubham Darda Date: Sun, 1 Feb 2026 22:24:54 +0530 Subject: [PATCH 03/36] v26.2.3 - Added comments for clarity in Python array, tuple, dictionary, set, and list examples. - Included new examples for array operations such as sorting, appending, and inserting in Python. - Expanded R documentation with improved comments for functions related to class checking, type checking, date manipulation, and string formatting. - Improved consistency in comment formatting across all examples for better readability. --- _data/gd.yml | 18 +- _data/learn/asm.yml | 55 ------ _data/learn/cluster.yml | 164 +++++++++++++++--- _data/learn/fsharp.yml | 29 ---- _data/learn/learn.yml | 24 +-- _data/learn/lisp.yml | 67 ------- _data/learn/octave.yml | 35 ---- assets/css/color.css | 16 +- assets/css/gd.css | 2 +- pages/learn/asm/32-bit/index.html | 4 - pages/learn/asm/64-bit/index.html | 4 - .../{asm/32-bit => cluster/asm}/gdaeavq.html | 6 +- .../{asm/64-bit => cluster/asm}/gdatnak.html | 6 +- .../{asm/32-bit => cluster/asm}/gdbhdky.html | 2 +- .../{asm/32-bit => cluster/asm}/gdbqeza.html | 6 +- .../{asm/64-bit => cluster/asm}/gdcgame.html | 2 +- .../{asm/32-bit => cluster/asm}/gddmaee.html | 66 +++---- .../{asm/64-bit => cluster/asm}/gdgywzg.html | 26 +-- .../{asm/32-bit => cluster/asm}/gdqnwvz.html | 12 +- .../{asm/64-bit => cluster/asm}/gdsgpyl.html | 6 +- .../{asm/32-bit => cluster/asm}/gdvakeg.html | 8 +- .../{asm/64-bit => cluster/asm}/gdvnyvi.html | 6 +- .../{asm/64-bit => cluster/asm}/gdvthab.html | 34 ++-- .../{asm/32-bit => cluster/asm}/gdvvdud.html | 2 +- .../{asm/32-bit => cluster/asm}/gdvxqaz.html | 6 +- .../{asm/64-bit => cluster/asm}/gdvyzpn.html | 46 ++--- .../{asm/64-bit => cluster/asm}/gdwagtz.html | 2 +- .../{asm/64-bit => cluster/asm}/gdwdwaz.html | 2 +- .../{asm/64-bit => cluster/asm}/gdwzqyk.html | 8 +- .../{asm/32-bit => cluster/asm}/gdzkizy.html | 6 +- pages/learn/{ => cluster}/asm/index.html | 6 +- .../fsharp}/gdegsem.html | 6 +- .../fsharp}/gdewzhw.html | 18 +- .../controls => cluster/fsharp}/gdhadwu.html | 6 +- .../fsharp}/gdwpkzv.html | 20 +-- .../fsharp}/gdxmvyy.html | 10 +- .../controls => cluster/fsharp}/gdzegce.html | 10 +- pages/learn/{ => cluster}/fsharp/index.html | 4 +- .../lisp}/gdddysa.html | 6 +- .../lisp}/gdggadz.html | 2 +- .../lisp}/gdggdyw.html | 2 +- .../lisp}/gdgoauk.html | 6 +- .../lisp}/gdiewcv.html | 28 +-- .../controls => cluster/lisp}/gdkdena.html | 10 +- .../lisp}/gdmalgp.html | 6 +- .../strings => cluster/lisp}/gdtrkke.html | 12 +- .../controls => cluster/lisp}/gduepzv.html | 8 +- .../functions => cluster/lisp}/gduzcrz.html | 6 +- .../lisp}/gdvagvz.html | 6 +- .../lisp}/gdvwwue.html | 6 +- .../lisp}/gdydkmw.html | 6 +- .../lisp}/gdzedbg.html | 6 +- .../strings => cluster/lisp}/gdzygzo.html | 6 +- .../{lisp/loops => cluster/lisp}/gdzzzay.html | 6 +- pages/learn/{ => cluster}/lisp/index.html | 8 +- .../strings => cluster/octave}/gdawdqp.html | 2 +- .../octave}/gdazzam.html | 2 +- .../strings => cluster/octave}/gdcvyzd.html | 2 +- .../octave}/gddggad.html | 2 +- .../strings => cluster/octave}/gdeceiw.html | 2 +- .../octave}/gdeezgn.html | 2 +- .../octave}/gdfxzpq.html | 2 +- .../octave}/gdgeiev.html | 2 +- .../strings => cluster/octave}/gduaulz.html | 2 +- pages/learn/{ => cluster}/octave/index.html | 6 +- pages/learn/fsharp/controls/index.html | 4 - pages/learn/fsharp/fundamentals/index.html | 4 - pages/learn/julia/fundamentals/gdadvew.html | 32 ++-- pages/learn/lisp/controls/index.html | 4 - pages/learn/lisp/functions/index.html | 4 - pages/learn/lisp/fundamentals/index.html | 4 - pages/learn/lisp/loops/index.html | 4 - pages/learn/lisp/strings/index.html | 4 - pages/learn/octave/fundamentals/index.html | 4 - pages/learn/octave/strings/index.html | 4 - pages/learn/python/arrays/gddeqlk.html | 6 +- pages/learn/python/arrays/gddkizz.html | 8 +- pages/learn/python/arrays/gddrehr.html | 10 +- pages/learn/python/arrays/gdeazqm.html | 15 +- pages/learn/python/arrays/gdeghdz.html | 5 +- pages/learn/python/arrays/gdevyzz.html | 11 +- pages/learn/python/arrays/gdomegf.html | 7 +- pages/learn/python/arrays/gdskedg.html | 9 +- pages/learn/python/arrays/gdvalhi.html | 9 +- pages/learn/python/arrays/gdwzddw.html | 33 +++- pages/learn/python/arrays/gdykhed.html | 10 +- pages/learn/python/arrays/gdzxhny.html | 19 +- pages/learn/python/arrays/gdzyigz.html | 27 ++- pages/learn/python/ds/gdcgaye.html | 13 +- pages/learn/python/ds/gdwkwvz.html | 19 +- pages/learn/python/ds/gdxpzmp.html | 27 ++- pages/learn/python/ds/gdzyzav.html | 19 +- pages/learn/r/cli/gdadmvw.html | 72 ++++---- pages/learn/r/cli/gdarfve.html | 10 +- pages/learn/r/cli/gdazeek.html | 8 +- pages/learn/r/cli/gddlyle.html | 18 +- pages/learn/r/cli/gdegdgz.html | 18 +- pages/learn/r/cli/gdexdvy.html | 30 ++-- pages/learn/r/cli/gdgebwv.html | 17 ++ 99 files changed, 721 insertions(+), 671 deletions(-) delete mode 100644 _data/learn/asm.yml delete mode 100644 _data/learn/fsharp.yml delete mode 100644 _data/learn/lisp.yml delete mode 100644 _data/learn/octave.yml delete mode 100644 pages/learn/asm/32-bit/index.html delete mode 100644 pages/learn/asm/64-bit/index.html rename pages/learn/{asm/32-bit => cluster/asm}/gdaeavq.html (95%) rename pages/learn/{asm/64-bit => cluster/asm}/gdatnak.html (90%) rename pages/learn/{asm/32-bit => cluster/asm}/gdbhdky.html (95%) rename pages/learn/{asm/32-bit => cluster/asm}/gdbqeza.html (95%) rename pages/learn/{asm/64-bit => cluster/asm}/gdcgame.html (98%) rename pages/learn/{asm/32-bit => cluster/asm}/gddmaee.html (79%) rename pages/learn/{asm/64-bit => cluster/asm}/gdgywzg.html (95%) rename pages/learn/{asm/32-bit => cluster/asm}/gdqnwvz.html (97%) rename pages/learn/{asm/64-bit => cluster/asm}/gdsgpyl.html (89%) rename pages/learn/{asm/32-bit => cluster/asm}/gdvakeg.html (95%) rename pages/learn/{asm/64-bit => cluster/asm}/gdvnyvi.html (97%) rename pages/learn/{asm/64-bit => cluster/asm}/gdvthab.html (84%) rename pages/learn/{asm/32-bit => cluster/asm}/gdvvdud.html (98%) rename pages/learn/{asm/32-bit => cluster/asm}/gdvxqaz.html (89%) rename pages/learn/{asm/64-bit => cluster/asm}/gdvyzpn.html (93%) rename pages/learn/{asm/64-bit => cluster/asm}/gdwagtz.html (98%) rename pages/learn/{asm/64-bit => cluster/asm}/gdwdwaz.html (98%) rename pages/learn/{asm/64-bit => cluster/asm}/gdwzqyk.html (98%) rename pages/learn/{asm/32-bit => cluster/asm}/gdzkizy.html (96%) rename pages/learn/{ => cluster}/asm/index.html (92%) rename pages/learn/{fsharp/fundamentals => cluster/fsharp}/gdegsem.html (81%) rename pages/learn/{fsharp/fundamentals => cluster/fsharp}/gdewzhw.html (87%) rename pages/learn/{fsharp/controls => cluster/fsharp}/gdhadwu.html (90%) rename pages/learn/{fsharp/fundamentals => cluster/fsharp}/gdwpkzv.html (85%) rename pages/learn/{fsharp/fundamentals => cluster/fsharp}/gdxmvyy.html (91%) rename pages/learn/{fsharp/controls => cluster/fsharp}/gdzegce.html (85%) rename pages/learn/{ => cluster}/fsharp/index.html (86%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdddysa.html (95%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdggadz.html (99%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdggdyw.html (99%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdgoauk.html (95%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdiewcv.html (61%) rename pages/learn/{lisp/controls => cluster/lisp}/gdkdena.html (94%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdmalgp.html (96%) rename pages/learn/{lisp/strings => cluster/lisp}/gdtrkke.html (93%) rename pages/learn/{lisp/controls => cluster/lisp}/gduepzv.html (94%) rename pages/learn/{lisp/functions => cluster/lisp}/gduzcrz.html (96%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdvagvz.html (96%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdvwwue.html (96%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdydkmw.html (89%) rename pages/learn/{lisp/fundamentals => cluster/lisp}/gdzedbg.html (96%) rename pages/learn/{lisp/strings => cluster/lisp}/gdzygzo.html (97%) rename pages/learn/{lisp/loops => cluster/lisp}/gdzzzay.html (96%) rename pages/learn/{ => cluster}/lisp/index.html (90%) rename pages/learn/{octave/strings => cluster/octave}/gdawdqp.html (97%) rename pages/learn/{octave/fundamentals => cluster/octave}/gdazzam.html (98%) rename pages/learn/{octave/strings => cluster/octave}/gdcvyzd.html (97%) rename pages/learn/{octave/fundamentals => cluster/octave}/gddggad.html (97%) rename pages/learn/{octave/strings => cluster/octave}/gdeceiw.html (96%) rename pages/learn/{octave/fundamentals => cluster/octave}/gdeezgn.html (97%) rename pages/learn/{octave/fundamentals => cluster/octave}/gdfxzpq.html (98%) rename pages/learn/{octave/fundamentals => cluster/octave}/gdgeiev.html (98%) rename pages/learn/{octave/strings => cluster/octave}/gduaulz.html (96%) rename pages/learn/{ => cluster}/octave/index.html (95%) delete mode 100644 pages/learn/fsharp/controls/index.html delete mode 100644 pages/learn/fsharp/fundamentals/index.html delete mode 100644 pages/learn/lisp/controls/index.html delete mode 100644 pages/learn/lisp/functions/index.html delete mode 100644 pages/learn/lisp/fundamentals/index.html delete mode 100644 pages/learn/lisp/loops/index.html delete mode 100644 pages/learn/lisp/strings/index.html delete mode 100644 pages/learn/octave/fundamentals/index.html delete mode 100644 pages/learn/octave/strings/index.html diff --git a/_data/gd.yml b/_data/gd.yml index f56d231..adad888 100644 --- a/_data/gd.yml +++ b/_data/gd.yml @@ -27,26 +27,14 @@ segments: url: julia parent: " Julia " - - title: GNU Octave - url: octave - parent: " Octave " - - title: C# Programming url: csharp parent: " CSharp " - - title: F# Programming - url: fsharp - parent: " FSharp " - - title: Rust Programming url: rust parent: " Rust " - - title: LISP Programming - url: lisp - parent: " LISP " - - title: Data Structures and Algorithms url: dsa parent: " DSA " @@ -71,11 +59,7 @@ segments: url: cg parent: " CG " - - title: Assembly Programming - url: asm - parent: " ASM " - - - title: Cluster + - title: Explore Cluster url: cluster parent: " Cluster " diff --git a/_data/learn/asm.yml b/_data/learn/asm.yml deleted file mode 100644 index b2b8ccf..0000000 --- a/_data/learn/asm.yml +++ /dev/null @@ -1,55 +0,0 @@ -grandparent: -- parent: 32-bit Assembly Programming - subtree: 32-bit - url: asm/32-bit - children: - - url: asm/32-bit/gdvxqaz - title: ALP to print Hello World (32-bit) - - url: asm/32-bit/gdbhdky - title: ALP to print Hello World using times directive (32-bit) - - url: asm/32-bit/gdaeavq - title: ALP to print the stars using macro (32-bit) - - url: asm/32-bit/gdbqeza - title: ALP to print the stars using times directive (32-bit) - - url: asm/32-bit/gdzkizy - title: ALP to print the ASCII hex to hexadecimal number (32-bit) - - url: asm/32-bit/gdqnwvz - title: ALP to print the given alphanumeric characters (32-bit) - - url: asm/32-bit/gdvvdud - title: ALP to print the length of a given string (32-bit) - - url: asm/32-bit/gdvakeg - title: ALP to identify the Central Processing Unit (CPU) type (32-bit) - - url: asm/32-bit/gddmaee - title: ALP to print the values of registers in protected mode (32-bit) -- parent: 64-bit Assembly Programming - subtree: 64-bit - url: asm/64-bit - children: - - url: asm/64-bit/gdatnak - title: ALP to print Hello World without using macro (64-bit) - - url: asm/64-bit/gdsgpyl - title: ALP to print Hello World using macro (64-bit) - - url: asm/64-bit/gdwagtz - title: ALP to print the given string using macro (64-bit) - - url: asm/64-bit/gdcgame - title: ALP to print the length of a given string (64-bit) - - url: asm/64-bit/gdwdwaz - title: ALP to reverse a given string (64-bit) - - url: asm/64-bit/gdwzqyk - title: ALP to check whether a given string is palindrome (64-bit) - - url: asm/64-bit/gdvyzpn - title: ALP menu-driven program to perform the string operations (64-bit) - - url: asm/64-bit/gdvnyvi - title: ALP to convert the hexadecimal to BCD number (64-bit) - - url: asm/64-bit/gdvthab - title: ALP to convert the Binary Coded Decimal (BCD) to hexadecimal number (64-bit) - - url: asm/64-bit/gdgywzg - title: ALP to print the addition of N hexadecimal number (64-bit) -sidenav: -- parent: Assembly Programming - url: asm - children: - - title: 32-bit Assembly Programming - url: asm/32-bit - - title: 64-bit Assembly Programming - url: asm/64-bit diff --git a/_data/learn/cluster.yml b/_data/learn/cluster.yml index 4f46dec..85d8722 100644 --- a/_data/learn/cluster.yml +++ b/_data/learn/cluster.yml @@ -1,4 +1,138 @@ grandparent: +- parent: Assembly Programming + subtree: ASM + url: cluster/asm + children: + - url: cluster/asm/gdvxqaz + title: ALP to print Hello World (32-bit) + - url: cluster/asm/gdbhdky + title: ALP to print Hello World using times directive (32-bit) + - url: cluster/asm/gdaeavq + title: ALP to print the stars using macro (32-bit) + - url: cluster/asm/gdbqeza + title: ALP to print the stars using times directive (32-bit) + - url: cluster/asm/gdzkizy + title: ALP to print the ASCII hex to hexadecimal number (32-bit) + - url: cluster/asm/gdqnwvz + title: ALP to print the given alphanumeric characters (32-bit) + - url: cluster/asm/gdvvdud + title: ALP to print the length of a given string (32-bit) + - url: cluster/asm/gdvakeg + title: ALP to identify the Central Processing Unit (CPU) type (32-bit) + - url: cluster/asm/gddmaee + title: ALP to print the values of registers in protected mode (32-bit) + - url: cluster/asm/gdatnak + title: ALP to print Hello World without using macro (64-bit) + - url: cluster/asm/gdsgpyl + title: ALP to print Hello World using macro (64-bit) + - url: cluster/asm/gdwagtz + title: ALP to print the given string using macro (64-bit) + - url: cluster/asm/gdcgame + title: ALP to print the length of a given string (64-bit) + - url: cluster/asm/gdwdwaz + title: ALP to reverse a given string (64-bit) + - url: cluster/asm/gdwzqyk + title: ALP to check whether a given string is palindrome (64-bit) + - url: cluster/asm/gdvyzpn + title: ALP menu-driven program to perform the string operations (64-bit) + - url: cluster/asm/gdvnyvi + title: ALP to convert the hexadecimal to BCD number (64-bit) + - url: cluster/asm/gdvthab + title: ALP to convert the Binary Coded Decimal (BCD) to hexadecimal number (64-bit) + - url: cluster/asm/gdgywzg + title: ALP to print the addition of N hexadecimal number (64-bit) +- parent: F# Programming + subtree: FSharp + url: cluster/fsharp + children: + - url: cluster/fsharp/gdegsem + title: F# Hello World program + - url: cluster/fsharp/gdwpkzv + title: F# program to perform the arithmetic operations + - url: cluster/fsharp/gdewzhw + title: F# program to perform the boolean operations + - url: cluster/fsharp/gdxmvyy + title: F# program to calculate the area and circumference of a circle + - url: cluster/fsharp/gdzegce + title: F# program to check the given number is even or odd + - url: cluster/fsharp/gdhadwu + title: F# program to check the given number is positive or negative +- parent: LISP Programming + subtree: LISP + url: cluster/lisp + children: + - url: cluster/lisp/gdggdyw + title: CLISP Command Line Interface (CLI) + - url: cluster/lisp/gdggadz + title: Maxima Command Line Interface (CLI) + - url: cluster/lisp/gdydkmw + title: LISP Hello World program + - url: cluster/lisp/gdvwwue + title: LISP program to perform the arithmetic operations + - url: cluster/lisp/gdmalgp + title: LISP program to perform the bitwise operations + - url: cluster/lisp/gdzedbg + title: LISP program to demonstrate the use of trigonometric functions + - url: cluster/lisp/gdvagvz + title: LISP program to demonstrate the use of numeric conversion functions + - url: cluster/lisp/gdiewcv + title: LISP program to calculate the square and cube of numbers + - url: cluster/lisp/gdddysa + title: LISP program to find the min and max of two numbers + - url: cluster/lisp/gdgoauk + title: LISP program to swap the given numbers + - url: cluster/lisp/gdkdena + title: LISP program for the positive-negative test of a given number + - url: cluster/lisp/gduepzv + title: LISP program for the arithmetic operations using the case statements + - url: cluster/lisp/gdzzzay + title: LISP program to print the even and odd numbers + - url: cluster/lisp/gdtrkke + title: LISP program to perform the string operations + - url: cluster/lisp/gdzygzo + title: LISP program to check whether a given string is a palindrome + - url: cluster/lisp/gduzcrz + title: LISP program to find the area of a circle using a function +- parent: GNU Octave + subtree: Octave + url: cluster/octave + children: + - url: cluster/octave/gdfxzpq + title: Octave Arithmetic Operations + - url: cluster/octave/gdeezgn + title: Octave Logical Operations + - url: cluster/octave/gddggad + title: How to generate random numbers in Octave + - url: cluster/octave/gdgeiev + title: Octave Exponents and Logarithms + - url: cluster/octave/gdazzam + title: Octave Trigonometric Functions + - url: cluster/octave/gduaulz + title: Octave basic string operations + - url: cluster/octave/gdeceiw + title: Octave string indexing + - url: cluster/octave/gdawdqp + title: Octave strings comparison + - url: cluster/octave/gdcvyzd + title: Octave to check the given string is alphanumeric +- parent: Ranorex + subtree: Ranorex + url: cluster/ranorex + children: + - url: cluster/ranorex/gdwryqa + title: How to open and close a browser using the Process class in Ranorex + - url: cluster/ranorex/gdgvzyw + title: How to get a browser details using the WebDocument class in Ranorex + - url: cluster/ranorex/gdewwzv + title: How to select the Chrome context menu option in Ranorex + - url: cluster/ranorex/gdfzznc + title: How to compare the Excel sheets using Interop objects in Ranorex + - url: cluster/ranorex/gdcewwv + title: How to create, insert and save the Excel in Ranorex + - url: cluster/ranorex/gdgyvzz + title: How to read the Excel specific row and column data in Ranorex + - url: cluster/ranorex/gdwwilz + title: How to format the Excel sheet in Ranorex - parent: VBScript subtree: VBScript url: cluster/vbscript @@ -51,29 +185,19 @@ grandparent: title: VBScript to create an Excel in one folder and paste into another folder - url: cluster/vbscript/gdyueyg title: VBScript to read the data from an Excel sheet using ADODB object -- parent: Ranorex - subtree: Ranorex - url: cluster/ranorex - children: - - url: cluster/ranorex/gdwryqa - title: How to open and close a browser using the Process class in Ranorex - - url: cluster/ranorex/gdgvzyw - title: How to get a browser details using the WebDocument class in Ranorex - - url: cluster/ranorex/gdewwzv - title: How to select the Chrome context menu option in Ranorex - - url: cluster/ranorex/gdfzznc - title: How to compare the Excel sheets using Interop objects in Ranorex - - url: cluster/ranorex/gdcewwv - title: How to create, insert and save the Excel in Ranorex - - url: cluster/ranorex/gdgyvzz - title: How to read the Excel specific row and column data in Ranorex - - url: cluster/ranorex/gdwwilz - title: How to format the Excel sheet in Ranorex sidenav: - parent: Cluster url: cluster children: - - title: VBScript - url: cluster/vbscript + - title: Assembly Programming + url: cluster/asm + - title: F# Programming + url: cluster/fsharp + - title: LISP Programming + url: cluster/lisp + - title: GNU Octave + url: cluster/octave - title: Ranorex url: cluster/ranorex + - title: VBScript + url: cluster/vbscript diff --git a/_data/learn/fsharp.yml b/_data/learn/fsharp.yml deleted file mode 100644 index b7aad8f..0000000 --- a/_data/learn/fsharp.yml +++ /dev/null @@ -1,29 +0,0 @@ -grandparent: -- parent: F# Fundamentals - subtree: Fundamentals - url: fsharp/fundamentals - children: - - url: fsharp/fundamentals/gdegsem - title: F# Hello World program - - url: fsharp/fundamentals/gdwpkzv - title: F# program to perform the arithmetic operations - - url: fsharp/fundamentals/gdewzhw - title: F# program to perform the boolean operations - - url: fsharp/fundamentals/gdxmvyy - title: F# program to calculate the area and circumference of a circle -- parent: F# Control Statements - subtree: Controls - url: fsharp/controls - children: - - url: fsharp/controls/gdzegce - title: F# program to check the given number is even or odd - - url: fsharp/controls/gdhadwu - title: F# program to check the given number is positive or negative -sidenav: -- parent: F# Programming - url: fsharp - children: - - title: F# Fundamentals - url: fsharp/fundamentals - - title: F# Control Statements - url: fsharp/controls diff --git a/_data/learn/learn.yml b/_data/learn/learn.yml index 8ca6e2b..fdfd145 100644 --- a/_data/learn/learn.yml +++ b/_data/learn/learn.yml @@ -27,26 +27,14 @@ segments: url: julia parent: "Julia" - - title: GNU Octave - url: octave - parent: "Octave" - - title: C# Programming url: csharp parent: "CSharp" - - title: F# Programming - url: fsharp - parent: "FSharp" - - title: Rust Programming url: rust parent: "Rust" - - title: LISP Programming - url: lisp - parent: "LISP" - - title: Data Structures and Algorithms url: dsa parent: "DSA" @@ -58,11 +46,11 @@ segments: - title: MySQL (Relational Database) url: mysql parent: "MySQL" - + - title: MongoDB (NoSQL Database) url: mongodb parent: "MongoDB" - + - title: Selenium WebDriver url: selenium parent: "Selenium" @@ -71,10 +59,6 @@ segments: url: cg parent: "CG" - - title: Assembly Programming - url: asm - parent: "ASM" - - - title: Cluster + - title: Explore Cluster url: cluster - parent: "Cluster" \ No newline at end of file + parent: "Cluster" diff --git a/_data/learn/lisp.yml b/_data/learn/lisp.yml deleted file mode 100644 index 7889ce2..0000000 --- a/_data/learn/lisp.yml +++ /dev/null @@ -1,67 +0,0 @@ -grandparent: -- parent: LISP (List Processing) Fundamentals - subtree: Fundamentals - url: lisp/fundamentals - children: - - url: lisp/fundamentals/gdggdyw - title: CLISP Command Line Interface (CLI) - - url: lisp/fundamentals/gdggadz - title: Maxima Command Line Interface (CLI) - - url: lisp/fundamentals/gdydkmw - title: LISP Hello World program - - url: lisp/fundamentals/gdvwwue - title: LISP program to perform the arithmetic operations - - url: lisp/fundamentals/gdmalgp - title: LISP program to perform the bitwise operations - - url: lisp/fundamentals/gdzedbg - title: LISP program to demonstrate the use of trigonometric functions - - url: lisp/fundamentals/gdvagvz - title: LISP program to demonstrate the use of numeric conversion functions - - url: lisp/fundamentals/gdiewcv - title: LISP program to calculate the square and cube of numbers - - url: lisp/fundamentals/gdddysa - title: LISP program to find the min and max of two numbers - - url: lisp/fundamentals/gdgoauk - title: LISP program to swap the given numbers -- parent: LISP Control Statements - subtree: Controls - url: lisp/controls - children: - - url: lisp/controls/gdkdena - title: LISP program for the positive-negative test of a given number - - url: lisp/controls/gduepzv - title: LISP program for the arithmetic operations using the case statements -- parent: LISP Loops - subtree: Loops - url: lisp/loops - children: - - url: lisp/loops/gdzzzay - title: LISP program to print the even and odd numbers -- parent: LISP Strings - subtree: Strings - url: lisp/strings - children: - - url: lisp/strings/gdtrkke - title: LISP program to perform the string operations - - url: lisp/strings/gdzygzo - title: LISP program to check whether a given string is a palindrome -- parent: LISP Functions - subtree: Functions - url: lisp/functions - children: - - url: lisp/functions/gduzcrz - title: LISP program to find the area of a circle using a function -sidenav: -- parent: LISP Programming - url: lisp - children: - - title: LISP Fundamentals - url: lisp/fundamentals - - title: LISP Control Statements - url: lisp/controls - - title: LISP Loops - url: lisp/loops - - title: LISP Strings - url: lisp/strings - - title: LISP Functions - url: lisp/functions diff --git a/_data/learn/octave.yml b/_data/learn/octave.yml deleted file mode 100644 index 74a6911..0000000 --- a/_data/learn/octave.yml +++ /dev/null @@ -1,35 +0,0 @@ -grandparent: -- parent: Octave Fundamentals - subtree: Fundamentals - url: octave/fundamentals - children: - - url: octave/fundamentals/gdfxzpq - title: Octave Arithmetic Operations - - url: octave/fundamentals/gdeezgn - title: Octave Logical Operations - - url: octave/fundamentals/gddggad - title: How to generate random numbers in Octave - - url: octave/fundamentals/gdgeiev - title: Octave Exponents and Logarithms - - url: octave/fundamentals/gdazzam - title: Octave Trigonometric Functions -- parent: Octave Strings - subtree: Strings - url: octave/strings - children: - - url: octave/strings/gduaulz - title: Octave basic string operations - - url: octave/strings/gdeceiw - title: Octave string indexing - - url: octave/strings/gdawdqp - title: Octave strings comparison - - url: octave/strings/gdcvyzd - title: Octave to check the given string is alphanumeric -sidenav: -- parent: GNU Octave - url: octave - children: - - title: Octave Fundamentals - url: octave/fundamentals - - title: Octave Strings - url: octave/strings diff --git a/assets/css/color.css b/assets/css/color.css index 91efc71..5d5ad22 100644 --- a/assets/css/color.css +++ b/assets/css/color.css @@ -6,27 +6,23 @@ layout: none [data-bs-theme="dark"] { - --asm: #b37700; /* Brown for assembly language */ --c: #0080ff; /* Blue for C programming language */ --calculators: #66b3ff; /* Light blue for calculators */ --cg: #ff6699; /* Pink for computer graphics */ - --cluster: #99994d; /* Olive for clustering systems */ + --cluster: #00bfff; /* Cyan for F# programming language */ --converters: #ff99cc; /* Light pink for converters */ --cpp: #99e600; /* Bright green for C++ programming language */ --csharp: #b366ff; /* Purple for C# programming language */ --ds: #cc6666; /* Muted red for data science */ --dsa: #e6b800; /* Amber for data structures and algorithms */ - --fsharp: #00bfff; /* Cyan for F# programming language */ --generators: #79d2a6; /* Soft green for generators */ --java: #ff8533; /* Warm orange for Java programming language */ --julia: #cc3399; /* Magenta for Julia programming language */ --linux: #ff9966; /* Coral for Linux systems */ - --lisp: #8080ff; /* Indigo for Lisp programming language */ --mongodb: #29a329; /* Green for MongoDB database */ --mysql: #4080bf; /* Blue for MySQL database */ - --octave: #ff6600; /* Bright orange for Octave programming language */ --python: #e6e600; /* Vibrant yellow for Python programming language */ - --r: #9999ff; /* Light purple for R programming language */ + --r: #8080ff; /* Indigo for Lisp programming language */ --rust: #996633; /* Rustic brown for Rust programming language */ --selenium: #00cc66; /* Green for Selenium testing framework */ --utilities: #00ced1; /* Dark Turquoise for utilities */ @@ -78,27 +74,23 @@ layout: none [data-bs-theme="light"] { - --asm: #b37400; /* Brown for assembly language */ --c: #007acc; /* Blue for C programming language */ --calculators: #0073e6; /* Strong blue for calculators */ --cg: #e65c7d; /* Pink for computer graphics */ - --cluster: #99994d; /* Olive for clustering systems */ + --cluster: #1aa3cc; /* Cyan for F# programming language */ --converters: #ff3399; /* Strong pink for converters */ --cpp: #66cc00; /* Green for C++ programming language */ --csharp: #b34dff; /* Purple for C# programming language */ --ds: #e65c5c; /* Red for data science */ --dsa: #e69900; /* Amber for data structures and algorithms */ - --fsharp: #1aa3cc; /* Cyan for F# programming language */ --generators: #2db373; /* Green for generators */ --java: #e67300; /* Orange for Java programming language */ --julia: #e62e8c; /* Magenta for Julia programming language */ --linux: #e6854d; /* Coral for Linux systems */ - --lisp: #7979d4; /* Indigo for Lisp programming language */ --mongodb: #29a329; /* Green for MongoDB database */ --mysql: #337ab7; /* Blue for MySQL database */ - --octave: #e65c00; /* Orange for Octave programming language */ --python: #e6b800; /* Yellow for Python programming language */ - --r: #9999e6; /* Purple for R programming language */ + --r: #7979d4; /* Indigo for Lisp programming language */ --rust: #b3591a; /* Brown for Rust programming language */ --selenium: #00b359; /* Green for Selenium testing framework */ --utilities: #008b8b; /* Dark Cyan for utilities */ diff --git a/assets/css/gd.css b/assets/css/gd.css index 51f11ff..a78256c 100644 --- a/assets/css/gd.css +++ b/assets/css/gd.css @@ -88,7 +88,7 @@ h6 { hr { margin: 12px 0px 12px 0px; - color: var(--color1); + color: var(--board-tc); } p { diff --git a/pages/learn/asm/32-bit/index.html b/pages/learn/asm/32-bit/index.html deleted file mode 100644 index 38ca1eb..0000000 --- a/pages/learn/asm/32-bit/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -permalink: asm/32-bit/ -title: 32-bit Assembly Programming ---- \ No newline at end of file diff --git a/pages/learn/asm/64-bit/index.html b/pages/learn/asm/64-bit/index.html deleted file mode 100644 index 66f1b1b..0000000 --- a/pages/learn/asm/64-bit/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -permalink: asm/64-bit/ -title: 64-bit Assembly Programming ---- \ No newline at end of file diff --git a/pages/learn/asm/32-bit/gdaeavq.html b/pages/learn/cluster/asm/gdaeavq.html similarity index 95% rename from pages/learn/asm/32-bit/gdaeavq.html rename to pages/learn/cluster/asm/gdaeavq.html index d4de522..97cd5ba 100644 --- a/pages/learn/asm/32-bit/gdaeavq.html +++ b/pages/learn/cluster/asm/gdaeavq.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdaeavq +permalink: cluster/asm/gdaeavq title: ALP to print the stars using macro (32-bit) --- @@ -50,5 +50,5 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ********** β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdatnak.html b/pages/learn/cluster/asm/gdatnak.html similarity index 90% rename from pages/learn/asm/64-bit/gdatnak.html rename to pages/learn/cluster/asm/gdatnak.html index 17702eb..a9374cf 100644 --- a/pages/learn/asm/64-bit/gdatnak.html +++ b/pages/learn/cluster/asm/gdatnak.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdatnak +permalink: cluster/asm/gdatnak title: ALP to print Hello World without using macro (64-bit) --- @@ -28,5 +28,5 @@
 {{ site.runasm }}
 Hello, World!
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/32-bit/gdbhdky.html b/pages/learn/cluster/asm/gdbhdky.html similarity index 95% rename from pages/learn/asm/32-bit/gdbhdky.html rename to pages/learn/cluster/asm/gdbhdky.html index 42768c6..bcad344 100644 --- a/pages/learn/asm/32-bit/gdbhdky.html +++ b/pages/learn/cluster/asm/gdbhdky.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdbhdky +permalink: cluster/asm/gdbhdky title: ALP to print Hello World using times directive (32-bit) --- diff --git a/pages/learn/asm/32-bit/gdbqeza.html b/pages/learn/cluster/asm/gdbqeza.html similarity index 95% rename from pages/learn/asm/32-bit/gdbqeza.html rename to pages/learn/cluster/asm/gdbqeza.html index 44e0439..70ad18f 100644 --- a/pages/learn/asm/32-bit/gdbqeza.html +++ b/pages/learn/cluster/asm/gdbqeza.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdbqeza +permalink: cluster/asm/gdbqeza title: ALP to print the stars using times directive (32-bit) --- @@ -45,5 +45,5 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ********** β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdcgame.html b/pages/learn/cluster/asm/gdcgame.html similarity index 98% rename from pages/learn/asm/64-bit/gdcgame.html rename to pages/learn/cluster/asm/gdcgame.html index e5ab844..3962cc1 100644 --- a/pages/learn/asm/64-bit/gdcgame.html +++ b/pages/learn/cluster/asm/gdcgame.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdcgame +permalink: cluster/asm/gdcgame title: ALP to print the length of a given string (64-bit) --- diff --git a/pages/learn/asm/32-bit/gddmaee.html b/pages/learn/cluster/asm/gddmaee.html similarity index 79% rename from pages/learn/asm/32-bit/gddmaee.html rename to pages/learn/cluster/asm/gddmaee.html index 20df0c1..710996a 100644 --- a/pages/learn/asm/32-bit/gddmaee.html +++ b/pages/learn/cluster/asm/gddmaee.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gddmaee +permalink: cluster/asm/gddmaee title: ALP to print the values of registers in protected mode (32-bit) --- @@ -44,7 +44,7 @@ idt resd 1 resw 1 tr resw 1 - msw resw 1 + msw resw 1 dnum_buff resb 04 cr0_data resd 1 @@ -55,27 +55,27 @@ mov edx,%2 int 80h %endmacro - + section .text global _start -_start: +_start: display title,title_len - smsw eax + smsw eax mov [cr0_data],eax - ror eax,1 + ror eax,1 jc prmode display rmodemsg,rmsg_len jmp nxt1 - -prmode: + +prmode: display pmodemsg,pmsg_len -nxt1: +nxt1: sgdt [gdt] sldt [ldt] sidt [idt] str [tr] - smsw [msw] + smsw [msw] display gdtmsg,gmsg_len mov bx,[gdt+4] @@ -88,12 +88,12 @@ mov bx,[gdt] call display_num - + display ldtmsg,lmsg_len mov bx,[ldt] call display_num display idtmsg,imsg_len - + mov bx,[idt+4] call display_num display colmsg,1 @@ -101,10 +101,10 @@ mov bx,[idt+2] call display_num display colmsg,1 - + mov bx,[idt] call display_num - + display trmsg,trmsg_len mov bx,[tr] call display_num @@ -114,32 +114,32 @@ call display_num display end,end_len -exit: +exit: mov eax,01 mov ebx,00 int 80h display_num: - mov esi,dnum_buff - mov ch,04 - mov cl,04 + mov esi,dnum_buff + mov ch,04 + mov cl,04 up1: - rol bx,cl - mov dl,bl - and dl,0fh - add dl,30h - cmp dl,39h - jbe skip1 - add dl,07h + rol bx,cl + mov dl,bl + and dl,0fh + add dl,30h + cmp dl,39h + jbe skip1 + add dl,07h skip1: - mov [esi],dl - inc esi - dec ch - jnz up1 - - mov eax,4 + mov [esi],dl + inc esi + dec ch + jnz up1 + + mov eax,4 mov ebx,1 mov ecx,dnum_buff mov edx,4 @@ -159,5 +159,5 @@ TR Contents | 0040 MSW Contents | 0033 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdgywzg.html b/pages/learn/cluster/asm/gdgywzg.html similarity index 95% rename from pages/learn/asm/64-bit/gdgywzg.html rename to pages/learn/cluster/asm/gdgywzg.html index 17b6513..28b4ae4 100644 --- a/pages/learn/asm/64-bit/gdgywzg.html +++ b/pages/learn/cluster/asm/gdgywzg.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdgywzg +permalink: cluster/asm/gdgywzg title: ALP to print the addition of N hexadecimal number (64-bit) --- @@ -29,7 +29,7 @@ wrong db 10, "Wrong choice entered... Please try again" wrong_len equ $-wrong -section .bss +section .bss numascii resb 03 resl resb 01 resh resb 01 @@ -143,9 +143,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the addition of N hexadecimal number β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -1.Enter the data -2.Display the result -3.Exit +1.Enter the data +2.Display the result +3.Exit β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your choice 1 @@ -158,9 +158,9 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the addition of N hexadecimal number β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -1.Enter the data -2.Display the result -3.Exit +1.Enter the data +2.Display the result +3.Exit β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your choice 2 @@ -168,10 +168,10 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP to print the addition of N hexadecimal number β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -1.Enter the data -2.Display the result -3.Exit +1.Enter the data +2.Display the result +3.Exit β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your choice 3 -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/32-bit/gdqnwvz.html b/pages/learn/cluster/asm/gdqnwvz.html similarity index 97% rename from pages/learn/asm/32-bit/gdqnwvz.html rename to pages/learn/cluster/asm/gdqnwvz.html index a5c6751..877097a 100644 --- a/pages/learn/asm/32-bit/gdqnwvz.html +++ b/pages/learn/cluster/asm/gdqnwvz.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdqnwvz +permalink: cluster/asm/gdqnwvz title: ALP to print the given alphanumeric characters (32-bit) --- @@ -50,7 +50,7 @@ mov ecx,output mov edx,output_len int 80h - + mov eax,4 mov ebx,1 mov ecx,num @@ -79,7 +79,7 @@ Given characters are HELLO @WORLD β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ +godarda@gd:~$
ALP to print the given alphanumeric characters using macro (32-bit)
{{ site.asmfile }}
{%- highlight nasm -%}
@@ -133,9 +133,9 @@
 ALP to print the given alphanumeric characters
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 
-Enter characters HELLO, @WORLD!  
+Enter characters HELLO, @WORLD!
 
 Given characters are HELLO, @WORLD!
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdsgpyl.html b/pages/learn/cluster/asm/gdsgpyl.html similarity index 89% rename from pages/learn/asm/64-bit/gdsgpyl.html rename to pages/learn/cluster/asm/gdsgpyl.html index 7c80fe8..5ba8571 100644 --- a/pages/learn/asm/64-bit/gdsgpyl.html +++ b/pages/learn/cluster/asm/gdsgpyl.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdsgpyl +permalink: cluster/asm/gdsgpyl title: ALP to print Hello World using macro (64-bit) --- @@ -32,5 +32,5 @@
 {{ site.runasm }}
 Hello, World!
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/32-bit/gdvakeg.html b/pages/learn/cluster/asm/gdvakeg.html similarity index 95% rename from pages/learn/asm/32-bit/gdvakeg.html rename to pages/learn/cluster/asm/gdvakeg.html index 3809177..f5e406e 100644 --- a/pages/learn/asm/32-bit/gdvakeg.html +++ b/pages/learn/cluster/asm/gdvakeg.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdvakeg +permalink: cluster/asm/gdvakeg title: ALP to identify the Central Processing Unit (CPU) type (32-bit) --- @@ -84,9 +84,9 @@ ALP to identify the Central Processing Unit type β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -The CPU type is GenuineIntel +The CPU type is GenuineIntel Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdvnyvi.html b/pages/learn/cluster/asm/gdvnyvi.html similarity index 97% rename from pages/learn/asm/64-bit/gdvnyvi.html rename to pages/learn/cluster/asm/gdvnyvi.html index 8f4aa74..d513d4b 100644 --- a/pages/learn/asm/64-bit/gdvnyvi.html +++ b/pages/learn/cluster/asm/gdvnyvi.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdvnyvi +permalink: cluster/asm/gdvnyvi title: ALP to convert the hexadecimal to BCD number (64-bit) --- @@ -92,5 +92,5 @@ Binary Coded Decimal equivalent is 65535 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdvthab.html b/pages/learn/cluster/asm/gdvthab.html similarity index 84% rename from pages/learn/asm/64-bit/gdvthab.html rename to pages/learn/cluster/asm/gdvthab.html index b020e34..31d01ff 100644 --- a/pages/learn/asm/64-bit/gdvthab.html +++ b/pages/learn/cluster/asm/gdvthab.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdvthab +permalink: cluster/asm/gdvthab title: ALP to convert the Binary Coded Decimal (BCD) to hexadecimal number (64-bit) --- @@ -20,7 +20,7 @@ end_len equ $-end section .bss - numascii resb 06 + numascii resb 06 opbuff resb 05 dnumbuff resb 08 @@ -44,7 +44,7 @@ mov rax,0 mov rbx,0ah -b2hup1: +b2hup1: mov rdx,0 mul rbx mov dl,[rsi] @@ -58,22 +58,22 @@ ret disp32_num: - mov rdi,dnumbuff - mov rcx,08 + mov rdi,dnumbuff + mov rcx,08 dispup1: - rol ebx,4 - mov dl,bl - and dl,0fh - add dl,30h - cmp dl,39h - jbe dispskip1 - add dl,07h + rol ebx,4 + mov dl,bl + and dl,0fh + add dl,30h + cmp dl,39h + jbe dispskip1 + add dl,07h dispskip1: - mov [rdi],dl - inc rdi - loop dispup1 + mov [rdi],dl + inc rdi + loop dispup1 display 1,1,dnumbuff+3,5 ret @@ -93,5 +93,5 @@ Hexadecimal equivalent is 0FFFF β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/32-bit/gdvvdud.html b/pages/learn/cluster/asm/gdvvdud.html similarity index 98% rename from pages/learn/asm/32-bit/gdvvdud.html rename to pages/learn/cluster/asm/gdvvdud.html index b7dd765..b795884 100644 --- a/pages/learn/asm/32-bit/gdvvdud.html +++ b/pages/learn/cluster/asm/gdvvdud.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdvvdud +permalink: cluster/asm/gdvvdud title: ALP to print the length of a given string (32-bit) --- diff --git a/pages/learn/asm/32-bit/gdvxqaz.html b/pages/learn/cluster/asm/gdvxqaz.html similarity index 89% rename from pages/learn/asm/32-bit/gdvxqaz.html rename to pages/learn/cluster/asm/gdvxqaz.html index 9484dc6..4a00558 100644 --- a/pages/learn/asm/32-bit/gdvxqaz.html +++ b/pages/learn/cluster/asm/gdvxqaz.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdvxqaz +permalink: cluster/asm/gdvxqaz title: ALP to print Hello World (32-bit) --- @@ -28,5 +28,5 @@
 {{ site.runasm }}
 Hello, World!
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdvyzpn.html b/pages/learn/cluster/asm/gdvyzpn.html similarity index 93% rename from pages/learn/asm/64-bit/gdvyzpn.html rename to pages/learn/cluster/asm/gdvyzpn.html index eefcb7d..5514871 100644 --- a/pages/learn/asm/64-bit/gdvyzpn.html +++ b/pages/learn/cluster/asm/gdvyzpn.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdvyzpn +permalink: cluster/asm/gdvyzpn title: ALP menu-driven program to perform the string operations (64-bit) --- @@ -58,7 +58,7 @@ section .text global _start _start: -menu: +menu: display 1,1,menumsg,menumsg_len display 0,0,optionbuff,02 cmp byte [optionbuff],"1" @@ -66,24 +66,24 @@ call entstr_proc jmp exit1 -case2: +case2: cmp byte [optionbuff],"2" jne case3 call length_proc jmp exit1 -case3: +case3: cmp byte [optionbuff],"3" jne case4 call reverse_proc jmp exit1 -case4: +case4: cmp byte [optionbuff],"4" jne case5 call pal_proc jmp exit1 - case5: + case5: cmp byte [optionbuff],"5" je exit display 1,1,wrchmsg,wrchmsg_len @@ -93,8 +93,8 @@ jmp menu jne exit -exit: - mov rax,60 +exit: + mov rax,60 mov rdi,0 syscall @@ -102,13 +102,13 @@ display 1,1,entmsg,entmsg_len display 0,0,srcstr,10 dec al - mov [cnt],al + mov [cnt],al ret -length_proc: - display 1,1,lmsg,lmsg_len +length_proc: + display 1,1,lmsg,lmsg_len mov bl,[cnt] - call disp8_proc + call disp8_proc ret reverse_proc: @@ -119,14 +119,14 @@ add rsi,rcx sub rsi,1 -up2: +up2: mov al,[rsi] mov [rdi],al inc rdi dec rsi loop up2 display 1,1,revmsg,revmsg_len - display 1,1,revstr,cnt + display 1,1,revstr,cnt ret pal_proc: @@ -135,7 +135,7 @@ mov rdi,revstr mov cl,[cnt] -up3: +up3: mov al,[rsi] mov bl,[rdi] cmp al,bl @@ -146,10 +146,10 @@ display 1,1,palmsg,palmsg_len jmp return -exit2: - display 1,1,npalmsg,npalmsg_len +exit2: + display 1,1,npalmsg,npalmsg_len -return: +return: ret disp8_proc: @@ -164,7 +164,7 @@ jbe dskip add al,07h -dskip: +dskip: add al,30h mov [rdi],al inc rdi @@ -187,7 +187,7 @@ 5.Exit β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your Choice 1 -Enter the string LOL +Enter the string LOL β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP for the string operations @@ -224,7 +224,7 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your Choice 4 -String is palindrome +String is palindrome β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ALP for the string operations β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” @@ -235,5 +235,5 @@ 5.Exit β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter your Choice 5 -godarda@gd:~$ -
\ No newline at end of file +godarda@gd:~$ +
diff --git a/pages/learn/asm/64-bit/gdwagtz.html b/pages/learn/cluster/asm/gdwagtz.html similarity index 98% rename from pages/learn/asm/64-bit/gdwagtz.html rename to pages/learn/cluster/asm/gdwagtz.html index f7d4873..ff38280 100644 --- a/pages/learn/asm/64-bit/gdwagtz.html +++ b/pages/learn/cluster/asm/gdwagtz.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdwagtz +permalink: cluster/asm/gdwagtz title: ALP to print the given string using macro (64-bit) --- diff --git a/pages/learn/asm/64-bit/gdwdwaz.html b/pages/learn/cluster/asm/gdwdwaz.html similarity index 98% rename from pages/learn/asm/64-bit/gdwdwaz.html rename to pages/learn/cluster/asm/gdwdwaz.html index 8862c14..37716bd 100644 --- a/pages/learn/asm/64-bit/gdwdwaz.html +++ b/pages/learn/cluster/asm/gdwdwaz.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdwdwaz +permalink: cluster/asm/gdwdwaz title: ALP to reverse a given string (64-bit) --- diff --git a/pages/learn/asm/64-bit/gdwzqyk.html b/pages/learn/cluster/asm/gdwzqyk.html similarity index 98% rename from pages/learn/asm/64-bit/gdwzqyk.html rename to pages/learn/cluster/asm/gdwzqyk.html index 23dac5d..41d58ce 100644 --- a/pages/learn/asm/64-bit/gdwzqyk.html +++ b/pages/learn/cluster/asm/gdwzqyk.html @@ -1,5 +1,5 @@ --- -permalink: asm/64-bit/gdwzqyk +permalink: cluster/asm/gdwzqyk title: ALP to check whether a given string is palindrome (64-bit) --- @@ -84,7 +84,7 @@ exit: display 1,1,output2,output2_len display 1,1,end,end_len - + mov rax,60 mov rbx,0 syscall @@ -108,5 +108,5 @@ Entered string is not palindrome β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/asm/32-bit/gdzkizy.html b/pages/learn/cluster/asm/gdzkizy.html similarity index 96% rename from pages/learn/asm/32-bit/gdzkizy.html rename to pages/learn/cluster/asm/gdzkizy.html index 1c7a435..2dcaa7b 100644 --- a/pages/learn/asm/32-bit/gdzkizy.html +++ b/pages/learn/cluster/asm/gdzkizy.html @@ -1,5 +1,5 @@ --- -permalink: asm/32-bit/gdzkizy +permalink: cluster/asm/gdzkizy title: ALP to print the ASCII hex to hexadecimal number (32-bit) --- @@ -51,5 +51,5 @@ 0123456789ABCDEF β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/asm/index.html b/pages/learn/cluster/asm/index.html similarity index 92% rename from pages/learn/asm/index.html rename to pages/learn/cluster/asm/index.html index 1212794..64c0a22 100644 --- a/pages/learn/asm/index.html +++ b/pages/learn/cluster/asm/index.html @@ -1,5 +1,5 @@ --- -permalink: asm/ +permalink: cluster/asm/ title: Assembly Programming description: Dive into Assembly programming, the low-level language that gives you direct control over hardware. Learn the basics of machine code, registers, and memory management. --- @@ -7,7 +7,7 @@
How to install NASM on Ubuntu
 godarda@gd:~$ su
-Password: 
+Password:
 root@gd:/home/godarda# apt install nasm
 ...
 Preparing to unpack .../nasm_2.16.01-1_amd64.deb ...
@@ -17,4 +17,4 @@
 
 root@gd:/home/godarda# nasm --version
 NASM version 2.16.01
-
\ No newline at end of file + diff --git a/pages/learn/fsharp/fundamentals/gdegsem.html b/pages/learn/cluster/fsharp/gdegsem.html similarity index 81% rename from pages/learn/fsharp/fundamentals/gdegsem.html rename to pages/learn/cluster/fsharp/gdegsem.html index fb2f26d..f24aa4a 100644 --- a/pages/learn/fsharp/fundamentals/gdegsem.html +++ b/pages/learn/cluster/fsharp/gdegsem.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/fundamentals/gdegsem +permalink: cluster/fsharp/gdegsem title: F# Hello World program --- @@ -12,5 +12,5 @@
 {{ site.runfs }}
 Hello, World!
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/fundamentals/gdewzhw.html b/pages/learn/cluster/fsharp/gdewzhw.html similarity index 87% rename from pages/learn/fsharp/fundamentals/gdewzhw.html rename to pages/learn/cluster/fsharp/gdewzhw.html index 7df52c1..26f8974 100644 --- a/pages/learn/fsharp/fundamentals/gdewzhw.html +++ b/pages/learn/cluster/fsharp/gdewzhw.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/fundamentals/gdewzhw +permalink: cluster/fsharp/gdewzhw title: F# program to perform the boolean operations --- @@ -26,12 +26,12 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to perform boolean operations β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Value of a | true -Value of b | false -Value of not a | false -Value of not b | true -Value of a && b | false -Value of a || b | true +Value of a | true +Value of b | false +Value of not a | false +Value of not b | true +Value of a && b | false +Value of a || b | true β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/controls/gdhadwu.html b/pages/learn/cluster/fsharp/gdhadwu.html similarity index 90% rename from pages/learn/fsharp/controls/gdhadwu.html rename to pages/learn/cluster/fsharp/gdhadwu.html index 23006f2..ba02f80 100644 --- a/pages/learn/fsharp/controls/gdhadwu.html +++ b/pages/learn/cluster/fsharp/gdhadwu.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/controls/gdhadwu +permalink: cluster/fsharp/gdhadwu title: F# program to check the given number is positive or negative --- @@ -24,5 +24,5 @@ {{ site.runfs }} Enter the number -5 -5 is a negative number -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/fundamentals/gdwpkzv.html b/pages/learn/cluster/fsharp/gdwpkzv.html similarity index 85% rename from pages/learn/fsharp/fundamentals/gdwpkzv.html rename to pages/learn/cluster/fsharp/gdwpkzv.html index 1d7b4d5..664e6f8 100644 --- a/pages/learn/fsharp/fundamentals/gdwpkzv.html +++ b/pages/learn/cluster/fsharp/gdwpkzv.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/fundamentals/gdwpkzv +permalink: cluster/fsharp/gdwpkzv title: F# program to perform the arithmetic operations --- @@ -27,13 +27,13 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Program to perform arithmetic operations β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -Value of a | 15.000000 -Value of b | 0.000000 -Value of a+b | 15.000000 -Value of a-b | 15.000000 -Value of a*b | 0.000000 -Value of a/b | Infinity -Value of a^b | 1.000000 +Value of a | 15.000000 +Value of b | 0.000000 +Value of a+b | 15.000000 +Value of a-b | 15.000000 +Value of a*b | 0.000000 +Value of a/b | Infinity +Value of a^b | 1.000000 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/fundamentals/gdxmvyy.html b/pages/learn/cluster/fsharp/gdxmvyy.html similarity index 91% rename from pages/learn/fsharp/fundamentals/gdxmvyy.html rename to pages/learn/cluster/fsharp/gdxmvyy.html index 33e01fc..b5417cd 100644 --- a/pages/learn/fsharp/fundamentals/gdxmvyy.html +++ b/pages/learn/cluster/fsharp/gdxmvyy.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/fundamentals/gdxmvyy +permalink: cluster/fsharp/gdxmvyy title: F# program to calculate the area and circumference of a circle --- @@ -24,8 +24,8 @@ Program to calculate the area and circumference of a circle β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter the radius of a circle 10 -The area of a circle is 314.159265 -The circumference of a circle is 62.831853 +The area of a circle is 314.159265 +The circumference of a circle is 62.831853 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/controls/gdzegce.html b/pages/learn/cluster/fsharp/gdzegce.html similarity index 85% rename from pages/learn/fsharp/controls/gdzegce.html rename to pages/learn/cluster/fsharp/gdzegce.html index 34bb2e0..f217c62 100644 --- a/pages/learn/fsharp/controls/gdzegce.html +++ b/pages/learn/cluster/fsharp/gdzegce.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/controls/gdzegce +permalink: cluster/fsharp/gdzegce title: F# program to check the given number is even or odd --- @@ -10,9 +10,9 @@ Console.Write("Enter the number ") let n = int32(Console.ReadLine()) -if(n >= 0) then +if(n >= 0) then printfn "%i is an EVEN number" n -else +else printfn "%i is an ODD number" n {%- endhighlight -%}
{{ site.output }}
@@ -20,5 +20,5 @@ {{ site.runfs }} Enter the number 5 5 is an ODD number -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/fsharp/index.html b/pages/learn/cluster/fsharp/index.html similarity index 86% rename from pages/learn/fsharp/index.html rename to pages/learn/cluster/fsharp/index.html index 6054a47..a995efd 100644 --- a/pages/learn/fsharp/index.html +++ b/pages/learn/cluster/fsharp/index.html @@ -1,5 +1,5 @@ --- -permalink: fsharp/ +permalink: cluster/fsharp/ title: F# Programming description: Explore F# programming, a functional-first language for .NET. Learn the essentials of functional programming, type inference, and powerful data manipulation. ---- \ No newline at end of file +--- diff --git a/pages/learn/lisp/fundamentals/gdddysa.html b/pages/learn/cluster/lisp/gdddysa.html similarity index 95% rename from pages/learn/lisp/fundamentals/gdddysa.html rename to pages/learn/cluster/lisp/gdddysa.html index 85e0307..98c8d7d 100644 --- a/pages/learn/lisp/fundamentals/gdddysa.html +++ b/pages/learn/cluster/lisp/gdddysa.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdddysa +permalink: cluster/lisp/gdddysa title: LISP program to find the min and max of two numbers --- @@ -29,5 +29,5 @@ Minimum of -50 OR 10 = -50 Maximum of -50 OR 10 = 10 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdggadz.html b/pages/learn/cluster/lisp/gdggadz.html similarity index 99% rename from pages/learn/lisp/fundamentals/gdggadz.html rename to pages/learn/cluster/lisp/gdggadz.html index b0218ba..a2191cb 100644 --- a/pages/learn/lisp/fundamentals/gdggadz.html +++ b/pages/learn/cluster/lisp/gdggadz.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdggadz +permalink: cluster/lisp/gdggadz title: Maxima Command Line Interface (CLI) --- diff --git a/pages/learn/lisp/fundamentals/gdggdyw.html b/pages/learn/cluster/lisp/gdggdyw.html similarity index 99% rename from pages/learn/lisp/fundamentals/gdggdyw.html rename to pages/learn/cluster/lisp/gdggdyw.html index 61def74..7072be6 100644 --- a/pages/learn/lisp/fundamentals/gdggdyw.html +++ b/pages/learn/cluster/lisp/gdggdyw.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdggdyw +permalink: cluster/lisp/gdggdyw title: CLISP Command Line Interface (CLI) --- diff --git a/pages/learn/lisp/fundamentals/gdgoauk.html b/pages/learn/cluster/lisp/gdgoauk.html similarity index 95% rename from pages/learn/lisp/fundamentals/gdgoauk.html rename to pages/learn/cluster/lisp/gdgoauk.html index ebeec31..817a12d 100644 --- a/pages/learn/lisp/fundamentals/gdgoauk.html +++ b/pages/learn/cluster/lisp/gdgoauk.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdgoauk +permalink: cluster/lisp/gdgoauk title: LISP program to swap the given numbers --- @@ -34,5 +34,5 @@ a=20 b=10 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdiewcv.html b/pages/learn/cluster/lisp/gdiewcv.html similarity index 61% rename from pages/learn/lisp/fundamentals/gdiewcv.html rename to pages/learn/cluster/lisp/gdiewcv.html index bd162e5..ea97a2d 100644 --- a/pages/learn/lisp/fundamentals/gdiewcv.html +++ b/pages/learn/cluster/lisp/gdiewcv.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdiewcv +permalink: cluster/lisp/gdiewcv title: LISP program to calculate the square and cube of numbers --- @@ -19,17 +19,17 @@ +--------+---------+------------+ |Numbers | Squares | Cubes | +--------+---------+------------+ - 0 0 0 - 1 1 1 - 2 4 8 - 3 9 27 - 4 16 64 - 5 25 125 - 6 36 216 - 7 49 343 - 8 64 512 - 9 81 729 - 10 100 1000 + 0 0 0 + 1 1 1 + 2 4 8 + 3 9 27 + 4 16 64 + 5 25 125 + 6 36 216 + 7 49 343 + 8 64 512 + 9 81 729 + 10 100 1000 +--------+---------+------------+ -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/controls/gdkdena.html b/pages/learn/cluster/lisp/gdkdena.html similarity index 94% rename from pages/learn/lisp/controls/gdkdena.html rename to pages/learn/cluster/lisp/gdkdena.html index 3feb050..c4b501f 100644 --- a/pages/learn/lisp/controls/gdkdena.html +++ b/pages/learn/cluster/lisp/gdkdena.html @@ -1,5 +1,5 @@ --- -permalink: lisp/controls/gdkdena +permalink: cluster/lisp/gdkdena title: LISP program for the positive-negative test of a given number --- @@ -27,7 +27,7 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter the number -1 --1 is -ve number +-1 is -ve number β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” {{ site.runlisp }} @@ -36,7 +36,7 @@ β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Enter the number 0 -0 is neither +ve nor -ve +0 is neither +ve nor -ve β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdmalgp.html b/pages/learn/cluster/lisp/gdmalgp.html similarity index 96% rename from pages/learn/lisp/fundamentals/gdmalgp.html rename to pages/learn/cluster/lisp/gdmalgp.html index f57314a..1e16b65 100644 --- a/pages/learn/lisp/fundamentals/gdmalgp.html +++ b/pages/learn/cluster/lisp/gdmalgp.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdmalgp +permalink: cluster/lisp/gdmalgp title: LISP program to perform the bitwise operations --- @@ -37,5 +37,5 @@ 1 NOT 0 | -2 1 EQUIVALANCE 0 | -2 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/strings/gdtrkke.html b/pages/learn/cluster/lisp/gdtrkke.html similarity index 93% rename from pages/learn/lisp/strings/gdtrkke.html rename to pages/learn/cluster/lisp/gdtrkke.html index 50bf92c..f31b5a3 100644 --- a/pages/learn/lisp/strings/gdtrkke.html +++ b/pages/learn/cluster/lisp/gdtrkke.html @@ -1,5 +1,5 @@ --- -permalink: lisp/strings/gdtrkke +permalink: cluster/lisp/gdtrkke title: LISP program to perform the string operations --- @@ -29,7 +29,7 @@
 {{ site.runlisp }}
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
-Program to perform the string operations 
+Program to perform the string operations
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 Enter the 1st string HELLO
 Enter the 2nd string WORLD
@@ -40,10 +40,10 @@
 Uppercase S1   | HELLO WORLD
 Lowercase S1   | hello world
 Togalcase S1   | Hello World
-Concatination  | HELLOWORLD 
-Comparision    | NIL 
+Concatination  | HELLOWORLD
+Comparision    | NIL
 Subsequence 0  | HELLO WORLD
 Character at 0 | H W
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
-godarda@gd:~$  
-
\ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/controls/gduepzv.html b/pages/learn/cluster/lisp/gduepzv.html similarity index 94% rename from pages/learn/lisp/controls/gduepzv.html rename to pages/learn/cluster/lisp/gduepzv.html index a7a4dee..817b346 100644 --- a/pages/learn/lisp/controls/gduepzv.html +++ b/pages/learn/cluster/lisp/gduepzv.html @@ -1,5 +1,5 @@ --- -permalink: lisp/controls/gduepzv +permalink: cluster/lisp/gduepzv title: LISP program for the arithmetic operations using the case statements --- @@ -31,7 +31,7 @@
 {{ site.runlisp }}
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
-Program to perform the arithmetic operations 
+Program to perform the arithmetic operations
 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 1.Addition
 2.Subtraction
@@ -46,5 +46,5 @@
 
 *** - /: division by zero
 
-godarda@gd:~$ 
-
\ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/functions/gduzcrz.html b/pages/learn/cluster/lisp/gduzcrz.html similarity index 96% rename from pages/learn/lisp/functions/gduzcrz.html rename to pages/learn/cluster/lisp/gduzcrz.html index 1188256..e4b99fc 100644 --- a/pages/learn/lisp/functions/gduzcrz.html +++ b/pages/learn/cluster/lisp/gduzcrz.html @@ -1,5 +1,5 @@ --- -permalink: lisp/functions/gduzcrz +permalink: cluster/lisp/gduzcrz title: LISP program to find the area of a circle using a function --- @@ -33,5 +33,5 @@ The area of a circle is 314.15997 The circumference of a circle is 62.831 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdvagvz.html b/pages/learn/cluster/lisp/gdvagvz.html similarity index 96% rename from pages/learn/lisp/fundamentals/gdvagvz.html rename to pages/learn/cluster/lisp/gdvagvz.html index 28d2d9d..7c38ec0 100644 --- a/pages/learn/lisp/fundamentals/gdvagvz.html +++ b/pages/learn/cluster/lisp/gdvagvz.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdvagvz +permalink: cluster/lisp/gdvagvz title: LISP program to demonstrate the use of numeric conversion functions --- @@ -46,5 +46,5 @@ 15 2 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdvwwue.html b/pages/learn/cluster/lisp/gdvwwue.html similarity index 96% rename from pages/learn/lisp/fundamentals/gdvwwue.html rename to pages/learn/cluster/lisp/gdvwwue.html index 139b822..c9cfc9e 100644 --- a/pages/learn/lisp/fundamentals/gdvwwue.html +++ b/pages/learn/cluster/lisp/gdvwwue.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdvwwue +permalink: cluster/lisp/gdvwwue title: LISP program to perform the arithmetic operations --- @@ -34,5 +34,5 @@ Multiplication | -500 Division | -5 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdydkmw.html b/pages/learn/cluster/lisp/gdydkmw.html similarity index 89% rename from pages/learn/lisp/fundamentals/gdydkmw.html rename to pages/learn/cluster/lisp/gdydkmw.html index 4a1d57c..d64ed2b 100644 --- a/pages/learn/lisp/fundamentals/gdydkmw.html +++ b/pages/learn/cluster/lisp/gdydkmw.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdydkmw +permalink: cluster/lisp/gdydkmw title: LISP Hello World program --- @@ -21,5 +21,5 @@ Hello, World! Hello, World!Hello, World!"Hello, World!" "Hello, World!" 'Hello, World!' -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/fundamentals/gdzedbg.html b/pages/learn/cluster/lisp/gdzedbg.html similarity index 96% rename from pages/learn/lisp/fundamentals/gdzedbg.html rename to pages/learn/cluster/lisp/gdzedbg.html index 4f82ead..69bcf82 100644 --- a/pages/learn/lisp/fundamentals/gdzedbg.html +++ b/pages/learn/cluster/lisp/gdzedbg.html @@ -1,5 +1,5 @@ --- -permalink: lisp/fundamentals/gdzedbg +permalink: cluster/lisp/gdzedbg title: LISP program to demonstrate the use of trigonometric functions --- @@ -34,5 +34,5 @@ sec(60) | 1.9035945 cosec(60) | 1.1752213 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/strings/gdzygzo.html b/pages/learn/cluster/lisp/gdzygzo.html similarity index 97% rename from pages/learn/lisp/strings/gdzygzo.html rename to pages/learn/cluster/lisp/gdzygzo.html index c6b72f4..be0870d 100644 --- a/pages/learn/lisp/strings/gdzygzo.html +++ b/pages/learn/cluster/lisp/gdzygzo.html @@ -1,5 +1,5 @@ --- -permalink: lisp/strings/gdzygzo +permalink: cluster/lisp/gdzygzo title: LISP program to check whether a given string is a palindrome --- @@ -38,5 +38,5 @@ LOL is palindrome β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/loops/gdzzzay.html b/pages/learn/cluster/lisp/gdzzzay.html similarity index 96% rename from pages/learn/lisp/loops/gdzzzay.html rename to pages/learn/cluster/lisp/gdzzzay.html index aa4294c..00c5cfe 100644 --- a/pages/learn/lisp/loops/gdzzzay.html +++ b/pages/learn/cluster/lisp/gdzzzay.html @@ -1,5 +1,5 @@ --- -permalink: lisp/loops/gdzzzay +permalink: cluster/lisp/gdzzzay title: LISP program to print the even and odd numbers --- @@ -44,5 +44,5 @@ 7 9 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -godarda@gd:~$ - \ No newline at end of file +godarda@gd:~$ + diff --git a/pages/learn/lisp/index.html b/pages/learn/cluster/lisp/index.html similarity index 90% rename from pages/learn/lisp/index.html rename to pages/learn/cluster/lisp/index.html index d737d7e..e207399 100644 --- a/pages/learn/lisp/index.html +++ b/pages/learn/cluster/lisp/index.html @@ -1,5 +1,5 @@ --- -permalink: lisp/ +permalink: cluster/lisp/ title: LISP Programming description: Delve into LISP programming, a pioneering language known for its unique syntax and powerful features. Learn the fundamentals of symbolic computation, recursion, and functional programming. --- @@ -7,15 +7,15 @@
How to install CLISP and Maxima on Ubuntu
 godarda@gd:~$ su
-Password: 
+Password:
 root@gd:/home/godarda# apt install clisp
 ...
 root@gd:/home/godarda# clisp --version
 GNU CLISP 2.49.93+ (2018-02-18) (built on lcy02-amd64-009.buildd [127.0.1.1])
-Software: GNU C 13.2.0 
+Software: GNU C 13.2.0
 
 root@gd:/home/godarda# apt install maxima
 ...
 root@gd:/home/godarda# maxima --version
 Maxima 5.46.0
-
\ No newline at end of file + diff --git a/pages/learn/octave/strings/gdawdqp.html b/pages/learn/cluster/octave/gdawdqp.html similarity index 97% rename from pages/learn/octave/strings/gdawdqp.html rename to pages/learn/cluster/octave/gdawdqp.html index 49542e6..d6da248 100644 --- a/pages/learn/octave/strings/gdawdqp.html +++ b/pages/learn/cluster/octave/gdawdqp.html @@ -1,5 +1,5 @@ --- -permalink: octave/strings/gdawdqp +permalink: cluster/octave/gdawdqp title: Octave strings comparison --- diff --git a/pages/learn/octave/fundamentals/gdazzam.html b/pages/learn/cluster/octave/gdazzam.html similarity index 98% rename from pages/learn/octave/fundamentals/gdazzam.html rename to pages/learn/cluster/octave/gdazzam.html index 8fd9f68..6d5a04a 100644 --- a/pages/learn/octave/fundamentals/gdazzam.html +++ b/pages/learn/cluster/octave/gdazzam.html @@ -1,5 +1,5 @@ --- -permalink: octave/fundamentals/gdazzam +permalink: cluster/octave/gdazzam title: Octave Trigonometric Functions --- diff --git a/pages/learn/octave/strings/gdcvyzd.html b/pages/learn/cluster/octave/gdcvyzd.html similarity index 97% rename from pages/learn/octave/strings/gdcvyzd.html rename to pages/learn/cluster/octave/gdcvyzd.html index 78a5832..a9e4e9f 100644 --- a/pages/learn/octave/strings/gdcvyzd.html +++ b/pages/learn/cluster/octave/gdcvyzd.html @@ -1,5 +1,5 @@ --- -permalink: octave/strings/gdcvyzd +permalink: cluster/octave/gdcvyzd title: Octave to check the given string is alphanumeric --- diff --git a/pages/learn/octave/fundamentals/gddggad.html b/pages/learn/cluster/octave/gddggad.html similarity index 97% rename from pages/learn/octave/fundamentals/gddggad.html rename to pages/learn/cluster/octave/gddggad.html index 9aeaf67..ed57193 100644 --- a/pages/learn/octave/fundamentals/gddggad.html +++ b/pages/learn/cluster/octave/gddggad.html @@ -1,5 +1,5 @@ --- -permalink: octave/fundamentals/gddggad +permalink: cluster/octave/gddggad title: How to generate random numbers in Octave --- diff --git a/pages/learn/octave/strings/gdeceiw.html b/pages/learn/cluster/octave/gdeceiw.html similarity index 96% rename from pages/learn/octave/strings/gdeceiw.html rename to pages/learn/cluster/octave/gdeceiw.html index 644517f..458e566 100644 --- a/pages/learn/octave/strings/gdeceiw.html +++ b/pages/learn/cluster/octave/gdeceiw.html @@ -1,5 +1,5 @@ --- -permalink: octave/strings/gdeceiw +permalink: cluster/octave/gdeceiw title: Octave string indexing --- diff --git a/pages/learn/octave/fundamentals/gdeezgn.html b/pages/learn/cluster/octave/gdeezgn.html similarity index 97% rename from pages/learn/octave/fundamentals/gdeezgn.html rename to pages/learn/cluster/octave/gdeezgn.html index db86c35..e5c9f32 100644 --- a/pages/learn/octave/fundamentals/gdeezgn.html +++ b/pages/learn/cluster/octave/gdeezgn.html @@ -1,5 +1,5 @@ --- -permalink: octave/fundamentals/gdeezgn +permalink: cluster/octave/gdeezgn title: Octave Logical Operations --- diff --git a/pages/learn/octave/fundamentals/gdfxzpq.html b/pages/learn/cluster/octave/gdfxzpq.html similarity index 98% rename from pages/learn/octave/fundamentals/gdfxzpq.html rename to pages/learn/cluster/octave/gdfxzpq.html index 9da52a8..81b47e0 100644 --- a/pages/learn/octave/fundamentals/gdfxzpq.html +++ b/pages/learn/cluster/octave/gdfxzpq.html @@ -1,5 +1,5 @@ --- -permalink: octave/fundamentals/gdfxzpq +permalink: cluster/octave/gdfxzpq title: Octave Arithmetic Operations --- diff --git a/pages/learn/octave/fundamentals/gdgeiev.html b/pages/learn/cluster/octave/gdgeiev.html similarity index 98% rename from pages/learn/octave/fundamentals/gdgeiev.html rename to pages/learn/cluster/octave/gdgeiev.html index 1eb134a..dd05495 100644 --- a/pages/learn/octave/fundamentals/gdgeiev.html +++ b/pages/learn/cluster/octave/gdgeiev.html @@ -1,5 +1,5 @@ --- -permalink: octave/fundamentals/gdgeiev +permalink: cluster/octave/gdgeiev title: Octave Exponents and Logarithms --- diff --git a/pages/learn/octave/strings/gduaulz.html b/pages/learn/cluster/octave/gduaulz.html similarity index 96% rename from pages/learn/octave/strings/gduaulz.html rename to pages/learn/cluster/octave/gduaulz.html index 9d9513f..d9aa98f 100644 --- a/pages/learn/octave/strings/gduaulz.html +++ b/pages/learn/cluster/octave/gduaulz.html @@ -1,5 +1,5 @@ --- -permalink: octave/strings/gduaulz +permalink: cluster/octave/gduaulz title: Octave basic string operations --- diff --git a/pages/learn/octave/index.html b/pages/learn/cluster/octave/index.html similarity index 95% rename from pages/learn/octave/index.html rename to pages/learn/cluster/octave/index.html index c93376d..bc71110 100644 --- a/pages/learn/octave/index.html +++ b/pages/learn/cluster/octave/index.html @@ -1,5 +1,5 @@ --- -permalink: octave/ +permalink: cluster/octave/ title: GNU Octave description: Discover GNU Octave, an open-source programming language primarily intended for numerical computations. Learn the essentials of matrix operations, data visualization, and algorithm development. --- @@ -7,7 +7,7 @@
How to install Octave on Ubuntu
 godarda@gd:~$ su
-Password: 
+Password:
 root@gd:/home/godarda# apt install octave
 ...
 
@@ -26,4 +26,4 @@
 For more information, visit https://www.octave.org/get-involved.html
 
 Read https://www.octave.org/bugs.html to learn how to submit bug reports.
-
\ No newline at end of file + diff --git a/pages/learn/fsharp/controls/index.html b/pages/learn/fsharp/controls/index.html deleted file mode 100644 index 08aa53e..0000000 --- a/pages/learn/fsharp/controls/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -permalink: fsharp/controls/ -title: F# Control Statements ---- \ No newline at end of file diff --git a/pages/learn/fsharp/fundamentals/index.html b/pages/learn/fsharp/fundamentals/index.html deleted file mode 100644 index 710f37c..0000000 --- a/pages/learn/fsharp/fundamentals/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -permalink: fsharp/fundamentals/ -title: F# Fundamentals ---- \ No newline at end of file diff --git a/pages/learn/julia/fundamentals/gdadvew.html b/pages/learn/julia/fundamentals/gdadvew.html index bb39ccb..cd511f7 100644 --- a/pages/learn/julia/fundamentals/gdadvew.html +++ b/pages/learn/julia/fundamentals/gdadvew.html @@ -9,15 +9,15 @@ julia> exp(0) 1.0 -# exp(0) - 1 +# e raised to the power of 0 minus 1 julia> expm1(0) 0.0 -# e raised to the power of 1 +# Exponential function e^x julia> exp(1) 2.718281828459045 -# exp(1) - 1 +# e raised to the power of 1 minus 1 julia> expm1(1) 1.7182818284590453 @@ -25,48 +25,56 @@ julia> exp(2) 7.38905609893065 -# exp(2) - 1 +# e raised to the power of 2 minus 1 julia> expm1(2) 6.38905609893065
Logarithms
-# natural logarithm (base e)
+# Natural logarithm (base e)
 julia> log(0)
 -Inf
 
-# natural logarithm (base e)
+# Natural logarithm (base e)
 julia> log(2)
 0.6931471805599453
 
-# base-10 logarithm
+# Base-10 logarithm
 julia> log10(0)
 -Inf
 
-# base-10 logarithm
+# Base-10 logarithm
 julia> log10(2)
 0.3010299956639812
 
-# base-2 logarithm
+# Base-2 logarithm
 julia> log2(0)
 -Inf
 
-# base-2 logarithm
+# Base-2 logarithm
 julia> log2(2)
 1.0
+
+# Natural logarithm of 1 plus x
+julia> log1p(0)
+0.0
 
Square root and Cube root functions
-# square root
+# Square root
 julia> sqrt(100)
 10.0
 
-# cube root
+# Cube root
 julia> cbrt(27)
 3.0
 
+# Hypotenuse of a right-angled triangle
+julia> hypot(3, 4)
+5.0
+
 # 2 raised to the power of 10
 julia> 2^10
 1024
diff --git a/pages/learn/lisp/controls/index.html b/pages/learn/lisp/controls/index.html
deleted file mode 100644
index 6879ac0..0000000
--- a/pages/learn/lisp/controls/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: lisp/controls/
-title: LISP Control Statements
----
\ No newline at end of file
diff --git a/pages/learn/lisp/functions/index.html b/pages/learn/lisp/functions/index.html
deleted file mode 100644
index 4ed30e3..0000000
--- a/pages/learn/lisp/functions/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: lisp/functions/
-title: LISP Functions
----
\ No newline at end of file
diff --git a/pages/learn/lisp/fundamentals/index.html b/pages/learn/lisp/fundamentals/index.html
deleted file mode 100644
index 682a4e9..0000000
--- a/pages/learn/lisp/fundamentals/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: lisp/fundamentals/
-title: LISP Fundamentals
----
\ No newline at end of file
diff --git a/pages/learn/lisp/loops/index.html b/pages/learn/lisp/loops/index.html
deleted file mode 100644
index f2feba0..0000000
--- a/pages/learn/lisp/loops/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: lisp/loops/
-title: LISP Loops
----
\ No newline at end of file
diff --git a/pages/learn/lisp/strings/index.html b/pages/learn/lisp/strings/index.html
deleted file mode 100644
index 9b6f24b..0000000
--- a/pages/learn/lisp/strings/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: lisp/strings/
-title: LISP Strings
----
\ No newline at end of file
diff --git a/pages/learn/octave/fundamentals/index.html b/pages/learn/octave/fundamentals/index.html
deleted file mode 100644
index 1b2ef70..0000000
--- a/pages/learn/octave/fundamentals/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: octave/fundamentals/
-title: Octave Fundamentals
----
\ No newline at end of file
diff --git a/pages/learn/octave/strings/index.html b/pages/learn/octave/strings/index.html
deleted file mode 100644
index 9cdb7e0..0000000
--- a/pages/learn/octave/strings/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-permalink: octave/strings/
-title: Octave Strings
----
\ No newline at end of file
diff --git a/pages/learn/python/arrays/gddeqlk.html b/pages/learn/python/arrays/gddeqlk.html
index f475230..4c71921 100644
--- a/pages/learn/python/arrays/gddeqlk.html
+++ b/pages/learn/python/arrays/gddeqlk.html
@@ -9,6 +9,8 @@
 ...
 >>> from numpy import *
 >>> arr1 = array([1, 2, 3, 4, 5])
+
+# Create a view of the array
 >>> arr2 = arr1.view()
 >>> arr1
 array([1, 2, 3, 4, 5])
@@ -23,6 +25,8 @@
 >>> arr1
 array([100,   2,   3,   4,   5])
 
>>> arr1 = array([1, 2, 3, 4, 5]) + +# Create a copy of the array >>> arr2 = arr1.copy() >>> arr1 array([1, 2, 3, 4, 5]) @@ -36,4 +40,4 @@ >>> arr1 array([1, 2, 3, 4, 5]) -
\ No newline at end of file + diff --git a/pages/learn/python/arrays/gddkizz.html b/pages/learn/python/arrays/gddkizz.html index c96d9f9..5e951b2 100644 --- a/pages/learn/python/arrays/gddkizz.html +++ b/pages/learn/python/arrays/gddkizz.html @@ -18,15 +18,18 @@ [ 7, 9, 11], [13, 15, 17]]) +# Create a matrix from an array >>> m = matrix(arr) >>> m matrix([[ 1, 3, 5], [ 7, 9, 11], [13, 15, 17]]) +# Get diagonal elements >>> diagonal(m) array([ 1, 9, 17]) +# Aggregate functions >>> m.max() 17 @@ -39,18 +42,21 @@ >>> m.mean() 9.0 +# Modifying matrix elements >>> m[0,0] = 99 >>> m matrix([[99, 3, 5], [ 7, 9, 11], [13, 15, 17]]) +# Sorting the matrix >>> m = sort(m) >>> m matrix([[ 3, 5, 99], [ 7, 9, 11], [13, 15, 17]]) +# Transpose of the matrix >>> m.transpose() matrix([[ 3, 7, 13], [ 5, 9, 15], @@ -72,4 +78,4 @@ matrix([[ 6], [120], [504]]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gddrehr.html b/pages/learn/python/arrays/gddrehr.html index 15fe496..3e09c2e 100644 --- a/pages/learn/python/arrays/gddrehr.html +++ b/pages/learn/python/arrays/gddrehr.html @@ -12,9 +12,10 @@ >>> arr array('i', [40, 96, 24, 55, 78, -111]) +# Accessing elements using index >>> for i in range(len(arr)): ... print(arr[i]) -... +... 40 96 24 @@ -22,6 +23,7 @@ 78 -111 +# Slicing the array >>> arr[3:] array('i', [55, 78, -111]) @@ -33,7 +35,9 @@ >>> arr[:] array('i', [40, 96, 24, 55, 78, -111]) -
>>> arr[0:6:1] +
+# Slicing with step +>>> arr[0:6:1] array('i', [40, 96, 24, 55, 78, -111]) >>> arr[0:6:2] @@ -53,4 +57,4 @@ >>> arr[::-1] array('i', [-111, 78, 55, 24, 96, 40]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdeazqm.html b/pages/learn/python/arrays/gdeazqm.html index 9286e62..fa851bb 100644 --- a/pages/learn/python/arrays/gdeazqm.html +++ b/pages/learn/python/arrays/gdeazqm.html @@ -10,6 +10,7 @@ >>> arr array([ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23]) +# Reshaping the array >>> arr.reshape(3, 3) Traceback (most recent call last): File "<stdin>", line 1, in <module> @@ -25,7 +26,7 @@ [ 7, 9, 11], [13, 15, 17], [19, 21, 23]]) - + >>> arr = arr.reshape(4, 3) >>> arr array([[ 1, 3, 5], @@ -33,12 +34,14 @@ [13, 15, 17], [19, 21, 23]]) +# Accessing elements >>> arr[1] array([ 7, 9, 11]) >>> arr[1, 1] 9 +# Array dimensions and shape >>> arr.ndim 2 @@ -56,6 +59,7 @@ [13, 15, 17], [19, 21, 23]]) +# Slicing multi-dimensional arrays >>> arr[0,:] array([1, 3, 5]) @@ -77,14 +81,17 @@ [13, 15, 17], [ 7, 9, 11], [ 1, 3, 5]]) - + +# Flattening the array >>> arr = arr.flatten() >>> arr array([ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23]) >>> arr.ndim 1 -
>>> zeros((4, 3), int) +
+# Creating matrices +>>> zeros((4, 3), int) array([[0, 0, 0], [0, 0, 0], [0, 0, 0], @@ -100,4 +107,4 @@ array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdeghdz.html b/pages/learn/python/arrays/gdeghdz.html index b20c164..77cbe5c 100644 --- a/pages/learn/python/arrays/gdeghdz.html +++ b/pages/learn/python/arrays/gdeghdz.html @@ -8,19 +8,22 @@ godarda@gd:~$ python3 ... >>> from numpy import * +# Create a matrix >>> m = matrix("1 2 3; 4 5 6; 7 8 9") >>> m matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) +# Transpose using getT() >>> m.getT() matrix([[1, 4, 7], [2, 5, 8], [3, 6, 9]]) +# Transpose using transpose() >>> m.transpose() matrix([[1, 4, 7], [2, 5, 8], [3, 6, 9]]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdevyzz.html b/pages/learn/python/arrays/gdevyzz.html index 87aa29b..321f02e 100644 --- a/pages/learn/python/arrays/gdevyzz.html +++ b/pages/learn/python/arrays/gdevyzz.html @@ -12,8 +12,10 @@ >>> arr2 = array([0, 0, -1, 3.14, 'K', 'W']) >>> arr1.size, arr2.size (5, 6) + +# Comparing arrays of different sizes >>> arr1 == arr2 -<stdin>:1: FutureWarning: elementwise comparison failed; +<stdin>:1: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison False @@ -21,10 +23,13 @@ >>> arr1.size, arr2.size (5, 5) +# Comparing arrays of same size >>> arr1 == arr2 array([False, True, True, True, False])
>>> arr1 = array([1, 2, 3, 4, 5]) >>> arr2 = array([5, 4, 3, 2, 1]) + +# Comparison operators >>> arr1 == arr2 array([False, False, True, False, False]) @@ -37,6 +42,7 @@ >>> arr1 <= arr2 array([ True, True, True, False, False]) +# any() and all() functions >>> any(arr1 > 2) True @@ -49,9 +55,10 @@ >>> all(arr1 > 1) False +# Logical operators >>> logical_and(arr1 >= 3, arr1 <= 3) array([False, False, True, False, False]) >>> logical_or(arr1 >= 3, arr1 <= 3) array([ True, True, True, True, True]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdomegf.html b/pages/learn/python/arrays/gdomegf.html index 6ba71e9..0e8ae89 100644 --- a/pages/learn/python/arrays/gdomegf.html +++ b/pages/learn/python/arrays/gdomegf.html @@ -8,6 +8,7 @@ godarda@gd:~$ python3 ... >>> from numpy import * +# Create matrices >>> m1 = matrix("1 2 3; 4 5 6; 7 8 9") >>> m2 = matrix("9 8 7; 6 5 4; 3 2 1") >>> m1 @@ -19,23 +20,27 @@ [6, 5, 4], [3, 2, 1]]) +# Matrix addition >>> m1 + m2 matrix([[10, 10, 10], [10, 10, 10], [10, 10, 10]]) +# Matrix subtraction >>> m1 - m2 matrix([[-8, -6, -4], [-2, 0, 2], [ 4, 6, 8]]) +# Matrix multiplication >>> m1 * m2 matrix([[ 30, 24, 18], [ 84, 69, 54], [138, 114, 90]]) +# Matrix division >>> m1 / m2 matrix([[0.11111111, 0.25 , 0.42857143], [0.66666667, 1. , 1.5 ], [2.33333333, 4. , 9. ]]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdskedg.html b/pages/learn/python/arrays/gdskedg.html index 32f9fdf..96563c9 100644 --- a/pages/learn/python/arrays/gdskedg.html +++ b/pages/learn/python/arrays/gdskedg.html @@ -8,6 +8,7 @@ godarda@gd:~$ python3 ... >>> from numpy import * +# Create arrays with specific number of elements >>> linspace(0, 24, 3) array([ 0., 12., 24.]) @@ -23,6 +24,8 @@ >>> arr = linspace(0, 24, 5) >>> arr array([ 0., 6., 12., 18., 24.]) + +# Array properties >>> len(arr) 5 @@ -35,6 +38,7 @@ >>> sort(arr) array([ 0., 6., 12., 18., 24.]) +# Modifying elements >>> arr=append(arr, 30) >>> arr array([ 0., 6., 12., 18., 24., 30.]) @@ -48,9 +52,11 @@ >>> arr array([ 6., 12., 18., 24., 30.]) +# Convert to list >>> arr.tolist() [6.0, 12.0, 18.0, 24.0, 30.0] +# Reverse array >>> arr[::-1] array([30., 24., 18., 12., 6.]) @@ -58,6 +64,7 @@
Create arrays using the logspace() function
 >>> from numpy import *
+# Logarithmic spacing
 >>> arr = logspace(0, 20, 5)
 >>> arr
 array([1.e+00, 1.e+05, 1.e+10, 1.e+15, 1.e+20])
@@ -70,4 +77,4 @@
 
 >>> max(arr)
 1e+20
-
\ No newline at end of file + diff --git a/pages/learn/python/arrays/gdvalhi.html b/pages/learn/python/arrays/gdvalhi.html index aaa1669..ffd686a 100644 --- a/pages/learn/python/arrays/gdvalhi.html +++ b/pages/learn/python/arrays/gdvalhi.html @@ -8,6 +8,7 @@ godarda@gd:~$ python3 ... >>> from numpy import * +# Create array with range and step >>> arr = arange(0, 50, 2) >>> arr array([ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, @@ -21,13 +22,16 @@
Create an array using zeros() function
 >>> from numpy import *
+# Create integer array of zeros
 >>> arr = zeros(5, int)
 >>> arr
 array([0, 0, 0, 0, 0])
 
+# Adding scalar to array
 >>> arr + 3
 array([3, 3, 3, 3, 3])
 
+# Create float array of zeros
 >>> arr = zeros(5, float)
 >>> arr
 array([0., 0., 0., 0., 0.])
@@ -36,14 +40,17 @@
 
Create an array using ones() function
 >>> from numpy import *
+# Create integer array of ones
 >>> arr = ones(5, int)
 >>> arr
 array([1, 1, 1, 1, 1])
 
+# Adding scalar to array
 >>> arr + 3
 array([4, 4, 4, 4, 4])
 
+# Create float array of ones
 >>> arr = ones(5, float)
 >>> arr
 array([1., 1., 1., 1., 1.])
-
\ No newline at end of file +
diff --git a/pages/learn/python/arrays/gdwzddw.html b/pages/learn/python/arrays/gdwzddw.html index 3e70d07..5f7e96a 100644 --- a/pages/learn/python/arrays/gdwzddw.html +++ b/pages/learn/python/arrays/gdwzddw.html @@ -13,18 +13,24 @@ File "<stdin>", line 1, in <module> ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)
+# Create integer array >>> arr = array("i", [40, 96, 24, 55, 78, -111]) >>> arr array('i', [40, 96, 24, 55, 78, -111]) + +# Access element >>> arr[0] 40 +# Length of array >>> len(arr) 6 +# Maximum value >>> max(arr) 96 +# Minimum value >>> min(arr) -111 @@ -33,16 +39,20 @@ >>> arr.typecode 'i' -
>>> for i in arr: +
+# Iterate over array +>>> for i in arr: ... print(i) -... +... 40 96 24 55 78 -111 -
>>> arr = array("u", ['x', 'y', 'z']) +
+# Create unicode character array +>>> arr = array("u", ['x', 'y', 'z']) >>> arr array('u', 'xyz') @@ -51,7 +61,7 @@ >>> for ch in arr: ... print(ch) -... +... x y z @@ -64,13 +74,16 @@ >>> arr1 array('i', [40, 96, 24, 55, 78, -111]) +# Append element >>> arr1.append(-111) >>> arr1 array('i', [40, 96, 24, 55, 78, -111, -111]) +# Count occurrences >>> arr1.count(-111) 2 +# Extend array >>> arr1.extend(arr2) Traceback (most recent call last): File "<stdin>", line 1, in <module> @@ -81,17 +94,21 @@ >>> arr1 array('i', [40, 96, 24, 55, 78, -111, -111, 314, 984]) +# Index of element >>> arr1.index(-111) 5 +# Insert element >>> arr2.insert(0, 169) >>> arr2 array('i', [169, 314, 984]) +# Reverse array >>> arr2.reverse() >>> arr2 array('i', [984, 314, 169]) +# Pop element >>> arr2.pop() 169 @@ -104,10 +121,16 @@ >>> arr1 array('i', [40, 96, 24, 55, 78, -111, -111, 314, 984]) +# Remove element >>> arr1.remove(-111) >>> arr1 array('i', [40, 96, 24, 55, 78, -111, 314, 984]) +# Convert to list >>> arr1.tolist() [40, 96, 24, 55, 78, -111, 314, 984] - \ No newline at end of file + +# Buffer info (address, length) +>>> arr1.buffer_info() +(140543086364528, 8) + diff --git a/pages/learn/python/arrays/gdykhed.html b/pages/learn/python/arrays/gdykhed.html index 01e85c7..c7d264d 100644 --- a/pages/learn/python/arrays/gdykhed.html +++ b/pages/learn/python/arrays/gdykhed.html @@ -10,6 +10,7 @@ >>> from numpy import * >>> arr = array([25, 27, 25, 1, 0, -1, 3.14]) +# Basic aggregate functions >>> sum(arr) 80.14 @@ -22,18 +23,21 @@ >>> max(arr) 27.0 +# Index of min and max values >>> argmin(arr) 5 >>> argmax(arr) 1 +# Unique elements and sorting >>> unique(arr) array([-1. , 0. , 1. , 3.14, 25. , 27. ]) >>> sort(arr) array([-1. , 0. , 1. , 3.14, 25. , 25. , 27. ]) +# Mathematical operations >>> log(arr) <stdin>:1: RuntimeWarning: divide by zero encountered in log <stdin>:1: RuntimeWarning: invalid value encountered in log @@ -55,6 +59,7 @@ array([7.20048993e+10, 5.32048241e+11, 7.20048993e+10, 2.71828183e+00, 1.00000000e+00, 3.67879441e-01, 2.31038669e+01]) +# Statistical functions >>> mean(arr) 11.448571428571428 @@ -72,6 +77,7 @@
>>> arr1 = array([1, -1, 3.14, "GoDarda", 'K']) >>> arr2 = array([0, 'W']) +# Concatenation >>> concatenate([arr1, arr2]) array(['1', '-1', '3.14', 'GoDarda', 'K', '0', 'W'], dtype='<U32') @@ -81,6 +87,7 @@ >>> from numpy import * >>> arr = array([25, 27, 25, 1, 0, -1, 3.14]) +# Trigonometric functions >>> sin(arr) array([-0.13235175, 0.95637593, -0.13235175, 0.84147098, 0. , -0.84147098, 0.00159265]) @@ -93,6 +100,7 @@ array([-1.33526407e-01, -3.27370380e+00, -1.33526407e-01, 1.55740772e+00, 0.00000000e+00, -1.55740772e+00, -1.59265494e-03]) +# Inverse trigonometric functions >>> arcsin(arr) array([ nan, nan, nan, 1.57079633, 0. , -1.57079633, nan]) @@ -104,4 +112,4 @@ >>> arctan(arr) array([ 1.53081764, 1.53377621, 1.53081764, 0.78539816, 0. , -0.78539816, 1.26248066]) - \ No newline at end of file + diff --git a/pages/learn/python/arrays/gdzxhny.html b/pages/learn/python/arrays/gdzxhny.html index c931825..4f11005 100644 --- a/pages/learn/python/arrays/gdzxhny.html +++ b/pages/learn/python/arrays/gdzxhny.html @@ -12,9 +12,10 @@ >>> arr2 = array(['x', 'y', 'z']) >>> arr3 = array(["Orange", "Pineapple", "Banana", "Blueberry", "Grapes", "Fig"]) +# Accessing elements using index >>> for i in range(len(arr1)): ... print(arr[i]) -... +... 40 96 24 @@ -24,14 +25,16 @@ >>> for s in range(len(arr3)): ... print(arr3[s]) -... +... Orange Pineapple Banana Blueberry Grapes Fig -
>>> arr1[3:] +
+# Slicing the array +>>> arr1[3:] array([ 55, 78, -111]) >>> arr1[-3:] @@ -42,7 +45,9 @@ >>> arr1[:] array([ 40, 96, 24, 55, 78, -111]) -
>>> arr1[0:6:1] +
+# Slicing with step +>>> arr1[0:6:1] array([ 40, 96, 24, 55, 78, -111]) >>> arr1[0:6:2] @@ -65,4 +70,8 @@ >>> arr2[::-1] array(['z', 'y', 'x'], dtype='<U1') - \ No newline at end of file + +# Accessing elements using take() +>>> take(arr1, [0, 2, 4]) +array([40, 24, 78]) + diff --git a/pages/learn/python/arrays/gdzyigz.html b/pages/learn/python/arrays/gdzyigz.html index f18fe0e..f039e76 100644 --- a/pages/learn/python/arrays/gdzyigz.html +++ b/pages/learn/python/arrays/gdzyigz.html @@ -12,9 +12,11 @@ >>> arr2 = array(['x','y','z']) >>> arr3 = array(["Orange", "Pineapple", "Banana", "Blueberry", "Grapes", "Fig"]) +# Size of the array >>> arr1.size, arr2.size, arr3.size (6, 3, 6) +# Data type of elements >>> arr1.dtype, arr2.dtype, arr3.dtype (dtype('int64'), dtype('<U1'), dtype('<U9')) @@ -30,12 +32,14 @@ >>> arr1.ndim, arr2.ndim, arr3.ndim (1, 1, 1) +# Accessing elements >>> arr1[0], arr2[0], arr3[0] (40, 'x', 'Orange') +# Iterating over arrays >>> for i in arr1: ... print(i) -... +... 40 96 24 @@ -45,7 +49,7 @@ >>> for s in arr3: ... print(s) -... +... Orange Pineapple Banana @@ -61,15 +65,18 @@ >>> arr2 = array(['x','y','z']) >>> arr3 = array(["Orange", "Pineapple", "Banana", "Blueberry", "Grapes", "Fig"]) +# Length of the array >>> len(arr1), len(arr2), len(arr3) (6, 3, 6) +# Minimum and Maximum values >>> min(arr1), min(arr2), min(arr3) (-111, 'x', 'Banana') >>> max(arr1), max(arr2), max(arr3) (96, 'z', 'Pineapple') +# Sorting the array >>> sort(arr1) array([-111, 24, 40, 55, 78, 96]) @@ -79,14 +86,17 @@ >>> sort(arr3) array(['Banana', 'Blueberry', 'Fig', 'Grapes', 'Orange', 'Pineapple'], dtype='<U9') +# Appending elements >>> arr2 = append(arr2, 'w') >>> arr2 array(['x', 'y', 'z', 'w'], dtype='<U1') +# Deleting elements >>> arr2 = delete(arr2, 3) >>> arr2 array(['x', 'y', 'z'], dtype='<U1') +# Inserting elements >>> arr3 = insert(arr3, 0, "Cherry") >>> arr3 array(['Cherry', 'Orange', 'Pineapple', 'Banana', 'Blueberry', 'Grapes', 'Fig'], dtype='<U9') @@ -95,6 +105,17 @@ >>> arr3 array(['Orange', 'Pineapple', 'Banana', 'Blueberry', 'Grapes', 'Fig'], dtype='<U9') +# Convert to list >>> arr1.tolist() [40, 96, 24, 55, 78, -111] - \ No newline at end of file + +# Create array filled with specific value +>>> full((2, 2), 7) +array([[7, 7], + [7, 7]]) + +# Repeat elements of an array +>>> repeat(arr1, 2) +array([ 40, 40, 96, 96, 24, 24, 55, 55, 78, 78, -111, + -111]) + diff --git a/pages/learn/python/ds/gdcgaye.html b/pages/learn/python/ds/gdcgaye.html index 890e33d..12c15ea 100644 --- a/pages/learn/python/ds/gdcgaye.html +++ b/pages/learn/python/ds/gdcgaye.html @@ -8,30 +8,38 @@ godarda@gd:~$ python3 ... >>> days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Sunday','Friday','Saturday') +# Accessing elements using index >>> days[0] 'Sunday' +# Slicing the tuple >>> days[0:3] ('Sunday', 'Monday', 'Tuesday', 'Wednesday') +# Negative indexing >>> days[-1] 'Saturday' +# Sorting the tuple >>> sorted(days) ['Friday', 'Monday', 'Saturday', 'Sunday', 'Sunday', 'Thursday', 'Tuesday', 'Wednesday'] +# Min and Max values >>> max(days) 'Wednesday' >>> min(days) 'Friday' +# Length of the tuple >>> len(days) 8 +# Count occurrences >>> days.count('Sunday') 2 +# Index of element >>> days.index('Sunday') 0 @@ -41,6 +49,7 @@ >>> days.index('Sunday',1,) 5 +# Deleting the tuple >>> del days >>> days @@ -103,11 +112,13 @@ >>> KV['s1'] 'Linus' +# Convert dictionary keys to tuple >>> KVtuple = tuple(KV) >>> KVtuple ('s1', 's2', 's3') +# Convert dictionary items to tuple >>> KVtuple = tuple(KV.items()) >>> KVtuple (('s1', 'Linus'), ('s2', 'Thomson'), ('s3', 'Edison')) - \ No newline at end of file + diff --git a/pages/learn/python/ds/gdwkwvz.html b/pages/learn/python/ds/gdwkwvz.html index a950d38..e040e76 100644 --- a/pages/learn/python/ds/gdwkwvz.html +++ b/pages/learn/python/ds/gdwkwvz.html @@ -11,60 +11,73 @@ >>> KV {'s3': 'Edison', 's2': 'Thomson', 's1': 'Linus'} +# Accessing value using key >>> KV['s2'] 'Thomson' +# Length of dictionary >>> len(KV) 3 +# Max and Min keys >>> max(KV) 's3' >>> min(KV) 's1' +# Copying dictionary >>> Dict=KV.copy() >>> Dict {'s1': 'Linus', 's2': 'Thomson', 's3': 'Edison'} +# Adding/Modifying elements >>> KV['s4']='Neil' >>> KV {'s3': 'Edison', 's2': 'Thomson', 's1': 'Linus', 's4': 'Neil'} +# Updating dictionary >>> KV.update(s5='John') >>> KV {'s1': 'Linus', 's2': 'Thomson', 's3': 'Edison', 's4': 'Neil', 's5': 'John'} +# Deleting element >>> del KV['s5'] >>> KV {'s1': 'Linus', 's2': 'Thomson', 's3': 'Edison', 's4': 'Neil'} +# Get keys >>> KV.keys() dict_keys(['s1', 's2', 's3', 's4']) +# Get values >>> KV.values() dict_values(['Linus', 'Thomson', 'Edison', 'Neil']) +# Get items (key-value pairs) >>> KV.items() dict_items([('s1', 'Linus'), ('s2', 'Thomson'), ('s3', 'Edison'), ('s4', 'Neil')]) +# Iterating over items >>> for(a,b) in KV.items(): ... print(b,a) -... +... Linus s1 Thomson s2 Edison s3 Neil s4 +# Iterating over values >>> for(a) in KV.values(): ... print(a) -... +... Linus Thomson Edison Neil +# Clearing dictionary >>> KV.clear() >>> KV {} - \ No newline at end of file + diff --git a/pages/learn/python/ds/gdxpzmp.html b/pages/learn/python/ds/gdxpzmp.html index d87afce..ab17544 100644 --- a/pages/learn/python/ds/gdxpzmp.html +++ b/pages/learn/python/ds/gdxpzmp.html @@ -10,16 +10,19 @@ >>> set1 = {'Sunday','Monday','Tuesday','Sunday'} >>> set2 = {'Wednesday','Thursday','Friday','Friday','Saturday'} +# Display sets (duplicates removed) >>> set1 {'Monday', 'Sunday', 'Tuesday'} >>> set2 {'Wednesday', 'Friday', 'Thursday', 'Saturday'} +# Length of set >>> len(set1) 3 >>> len(set2) 4 +# Max and Min values >>> max(set1) 'Tuesday' >>> min(set1) @@ -96,6 +99,7 @@ >>> set2 {'Wednesday', 'Thursday', 'Saturday'} +# Clear set >>> set2.clear() >>> set2 set() @@ -111,10 +115,11 @@ >>> set2 = {'Wednesday','Thursday','Friday','Friday','Saturday'} >>> set1 -{'Monday', 'Friday', 'Sunday'} +{'Monday', 'Friday', 'Sunday'} >>> set2 {'Wednesday', 'Friday', 'Thursday', 'Saturday'} - + +# Union of sets >>> set1.union(set2) {'Wednesday', 'Monday', 'Friday', 'Sunday', 'Thursday', 'Saturday'} @@ -123,8 +128,14 @@ >>> set2 {'Wednesday', 'Friday', 'Thursday', 'Saturday'} +# Intersection of sets >>> set1.intersection(set2) {'Friday'} + +# Intersection update +>>> set1.intersection_update(set2) +>>> set1 +{'Friday'}
difference() and symmetric_difference() methods
@@ -132,16 +143,19 @@ >>> set1 = {'Sunday','Monday','Friday','Sunday'} >>> set2 = {'Wednesday','Thursday','Friday','Friday','Saturday'} +# Difference of sets >>> set1.difference(set2) {'Monday', 'Sunday'} >>> set2.difference(set1) {'Thursday', 'Saturday', 'Wednesday'} +# Symmetric difference >>> set1.symmetric_difference(set2) {'Sunday', 'Monday', 'Saturday', 'Thursday', 'Wednesday'} >>> set1 {'Monday', 'Sunday', 'Friday'} +# Symmetric difference update >>> set1.symmetric_difference_update(set2) >>> set1 {'Sunday', 'Monday', 'Saturday', 'Thursday', 'Wednesday'} @@ -149,19 +163,23 @@
Built-in set() function and operations
+# Create set with duplicates
 >>> s={1, 1, 2, 2, 1, 4, 3, 3, 6, 6, 5, 6}
 >>> s
 {1, 2, 3, 4, 5, 6}
 
+# Indexing not supported
 >>> s[1:3]
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'set' object is not subscriptable
 
+# Update set
 >>> s.update([7, 4, 0, 2])
 >>> s
 {0, 1, 2, 3, 4, 5, 6, 7}
 
+# Remove element
 >>> s.remove(10)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
@@ -171,7 +189,8 @@
 >>> s
 {0, 2, 3, 4, 5, 6, 7}
 
+# Create set from string
 >>> s=set("Hello, World!")
 >>> s
-{'l', 'o', ' ', 'd', ',', '!', 'e', 'W', 'H', 'r'} 
-
\ No newline at end of file +{'l', 'o', ' ', 'd', ',', '!', 'e', 'W', 'H', 'r'} + diff --git a/pages/learn/python/ds/gdzyzav.html b/pages/learn/python/ds/gdzyzav.html index 7c020fc..39a644c 100644 --- a/pages/learn/python/ds/gdzyzav.html +++ b/pages/learn/python/ds/gdzyzav.html @@ -8,6 +8,7 @@ godarda@gd:~$ python3 ... >>> a=[1, 2, 3, 4, 5, 6] +# Slicing the list >>> a[2:5] [3, 4, 5] @@ -20,21 +21,26 @@ >>> a [1, 2, 3, 4, 5, 6]
>>> strings=['Thomson','1010011','999.99','A1D3T6Z'] + +# Accessing elements using index >>> strings[0] 'Thomson' >>> strings[3] 'A1D3T6Z' +# Negative indexing >>> strings[-1] 'A1D3T6Z' >>> strings[-4] 'Thomson' +# Length of the list >>> len(strings) 4 +# Modifying elements >>> strings[0]='Neil' >>> strings[0] 'Neil' @@ -45,42 +51,51 @@ >>> strings ['Neil', '1010011', '999.99', 'A1D3T6Z'] +# Deleting element >>> del strings[3] >>> strings ['Neil', '1010011', '999.99'] +# Appending element >>> strings.append('Edison') >>> strings ['Neil', '1010011', '999.99', 'Edison'] +# Reversing the list >>> strings.reverse() >>> strings ['Edison', '999.99', '1010011', 'Neil'] +# Sorting the list >>> strings.sort() >>> strings ['1010011', '999.99', 'Edison', 'Neil'] +# Inserting element >>> strings.insert(2,'Linus') >>> strings ['1010011', '999.99', 'Linus', 'Edison', 'Neil'] +# Removing element >>> strings.remove('999.99') >>> strings ['1010011', 'Linus', 'Edison', 'Neil'] +# Concatenation >>> strings+[1,2,3,4] ['1010011', 'Linus', 'Edison', 'Neil', 1, 2, 3, 4] >>> strings ['1010011', 'Linus', 'Edison', 'Neil'] +# Convert to list >>> list(strings) ['1010011', 'Linus', 'Edison', 'Neil'] >>> list('strings') ['s', 't', 'r', 'i', 'n', 'g', 's'] +# Membership testing >>> 'neil' in strings False @@ -90,13 +105,15 @@ >>> 'Thomson' not in strings True +# Pop element >>> strings.pop(0) '1010011' >>> strings ['Linus', 'Edison', 'Neil'] +# Delete element by index >>> del strings[2] >>> strings ['Linus', 'Edison'] - \ No newline at end of file + diff --git a/pages/learn/r/cli/gdadmvw.html b/pages/learn/r/cli/gdadmvw.html index b00e1b1..b2d1b24 100644 --- a/pages/learn/r/cli/gdadmvw.html +++ b/pages/learn/r/cli/gdadmvw.html @@ -7,132 +7,132 @@
 godarda@gd:~$ R
 ...
-# check class of object
+# Check class of object
 > class(1)
 [1] "numeric"
 
-# check class of object
+# Check class of object
 > class(TRUE)
 [1] "logical"
 
-# check class of object
+# Check class of object
 > class(F)
 [1] "logical"
 
-# check class of object
+# Check class of object
 > class(matrix())
 [1] "matrix"
 
-# check class of object
+# Check class of object
 > class("GoDarda")
 [1] "character"
 
-# check class of object
+# Check class of object
 > class(Sys.time())
 [1] "POSIXct" "POSIXt"
 
-# check class of object
+# Check class of object
 > class(15L)
 [1] "integer"
 
-# check class of object
+# Check class of object
 > class(15+9i)
 [1] "complex"
 
-# check class of object
+# Check class of object
 > class(charToRaw("Hello World"))
 [1] "raw"
 
R typeof() function
-# check type of object
+# Check type of object
 > typeof(1)
 [1] "double"
 
-# check type of object
+# Check type of object
 > typeof(1.1)
 [1] "double"
 
-# check type of object
+# Check type of object
 > typeof("GoDarda")
 [1] "character"
 
-# check type of object
+# Check type of object
 > typeof(1L)
 [1] "integer"
 
-# check type of object
+# Check type of object
 > typeof(TRUE)
 [1] "logical"
 
-# check type of object
+# Check type of object
 > typeof(F)
 [1] "logical"
 
-# check type of object
+# Check type of object
 > typeof(-3+4i)
 [1] "complex"
 
-# check type of object
+# Check type of object
 > typeof(raw())
 [1] "raw"
 
-# check type of object
+# Check type of object
 > typeof(NULL)
 [1] "NULL"
 
R round() function
-# round to nearest integer
+# Round to nearest integer
 > round(3.14)
 [1] 3
 
-# round to nearest integer
+# Round to nearest integer
 > round(9.87)
 [1] 10
 
-# round to 3 decimal places
+# Round to 3 decimal places
 > round(3.141492,digits=3)
 [1] 3.141
 
-# create raw vector
+# Create raw vector
 > raw(10)
 [1] 00 00 00 00 00 00 00 00 00 00
 
R sample() function
-# sample from sequence
+# Sample from sequence
 > sample(1:36)
  [1]  9 15 20 16  3 30 26  4  5 10 33 36 24 32 12 19 22  8 13 34  2 35 23 18 29
 [26]  1 14 17  6  7 28 31 11 27 25 21
 
-# sample 1 element
+# Sample 1 element
 > sample(1:36,size=1)
 [1] 2
 
-# sample 1 element
+# Sample 1 element
 > sample(1:36,size=1)
 [1] 16
 
-# sample 1 element
+# Sample 1 element
 > sample(1:36,size=1)
 [1] 5
 
-# sample 5 elements
+# Sample 5 elements
 > sample(1:36,size=5)
 [1]  7 13 33  6 22
 
R replicate() function
-# replicate string
+# Replicate string
 > replicate(3,'GoDarda')
 [1] "GoDarda" "GoDarda" "GoDarda"
 
-# replicate sequence
+# Replicate sequence
 > replicate(3,1:6)
      [,1] [,2] [,3]
 [1,]    1    1    1
@@ -145,32 +145,32 @@
 
 
R format() function
-# format number
+# Format number
 > format(3.141492,digits=3)
 [1] "3.14"
 
-# format string with width
+# Format string with width
 > format("GoDarda",width=20)
 [1] "GoDarda        "
 
-# format string with justify
+# Format string with justify
 > format("GoDarda",width=20,justify="")
 Error in match.arg(justify) :
   'arg' should be one of β€œleft”, β€œright”, β€œcentre”, β€œnone”
 
-# format string with justify left
+# Format string with justify left
 > format("GoDarda",width=20,justify="l")
 [1] "GoDarda        "
 
-# format string with justify center
+# Format string with justify center
 > format("GoDarda",width=20,justify="c")
 [1] "    GoDarda    "
 
-# format string with justify right
+# Format string with justify right
 > format("GoDarda",width=20,justify="r")
 [1] "        GoDarda"
 
-# format string with justify none
+# Format string with justify none
 > format("GoDarda",width=20,justify="n")
 [1] "GoDarda"
 
diff --git a/pages/learn/r/cli/gdarfve.html b/pages/learn/r/cli/gdarfve.html index 361605f..f60c36e 100644 --- a/pages/learn/r/cli/gdarfve.html +++ b/pages/learn/r/cli/gdarfve.html @@ -7,27 +7,27 @@
 godarda@gd:~$ R
 ...
-# create a list
+# Create a list
 > flist <- list("Apple","Orange","Grapes","Apple")
 > flist
 [1] "Apple"  "Orange" "Grapes" "Apple"
 
-# length of list
+# Length of list
 > length(flist)
 [1] 4
 
-# create a list of numbers
+# Create a list of numbers
 > nlist <- list(1,2,3,4,5)
 > length(nlist)
 [1] 5
 
-# create a list of vector
+# Create a list of vector
 > nlist <- list(1:10)
 > nlist
 [[1]]
  [1]  1  2  3  4  5  6  7  8  9 10
 
-# length of list
+# Length of list
 > length(nlist)
 [1] 1
 
diff --git a/pages/learn/r/cli/gdazeek.html b/pages/learn/r/cli/gdazeek.html index c26cc4a..9445f66 100644 --- a/pages/learn/r/cli/gdazeek.html +++ b/pages/learn/r/cli/gdazeek.html @@ -8,14 +8,14 @@
 godarda@gd:~$ R
 ...
-# create vectors
+# Create vectors
 > f <- c("Apple","Orange","Mango")
 > c <- c("Red","Orange","Yellow")
 > r <- c(200,100,500)
 > q <- c(12,12,12)
 > a <- c(FALSE,FALSE,TRUE)
 
-# create a data frame
+# Create a data frame
 > df <- data.frame(f,c,r,q,a)
 > df
        f      c   r  q     a
@@ -23,7 +23,7 @@
 2 Orange Orange 100 12 FALSE
 3  Mango Yellow 500 12  TRUE
 
-# rename columns
+# Rename columns
 > names(df) <- c("Fruits","Colors","Rates","Quantity","Availability")
 > df
   Fruits Colors Rates Quantity Availability
@@ -31,7 +31,7 @@
 2 Orange Orange   100       12        FALSE
 3  Mango Yellow   500       12         TRUE
 
-# display structure of data frame
+# Display structure of data frame
 > str(df)
 'data.frame':	3 obs. of  5 variables:
  $ Fruits      : Factor w/ 3 levels "Apple","Mango",..: 1 3 2
diff --git a/pages/learn/r/cli/gddlyle.html b/pages/learn/r/cli/gddlyle.html
index b475c5a..cd8a3cc 100644
--- a/pages/learn/r/cli/gddlyle.html
+++ b/pages/learn/r/cli/gddlyle.html
@@ -7,46 +7,46 @@
 
 godarda@gd:~$ R
 ...
-# create a vector
+# Create a vector
 > c(1,2,3)
 [1] 1 2 3
 
-# add 10 to each element
+# Add 10 to each element
 > c(1,2,3) + 10
 [1] 11 12 13
 
-# subtract 10 from each element
+# Subtract 10 from each element
 > c(1,2,3) - 10
 [1] -9 -8 -7
 
-# add two vectors
+# Add two vectors
 > c(1,2,3) + c(3,2,1)
 [1] 4 4 4
 
-# create a vector with different numbers
+# Create a vector with different numbers
 > vector = c(1,2,4,5,9,-1.1)
 > vector
 [1]  1.0  2.0  4.0  5.0  9.0 -1.1
 
-# create a sequence of numbers
+# Create a sequence of numbers
 > vector = 1:10
 > vector1 = 1:10
 > vector2 = 10:9
 > vector1 + vector2
  [1] 11 11 13 13 15 15 17 17 19 19
 
-# create a logical vector
+# Create a logical vector
 > print(c(T,T,F,F,T))
 [1]  TRUE  TRUE FALSE FALSE  TRUE
 
# Comparing integers > c(1:5) == 5 [1] FALSE FALSE FALSE FALSE TRUE -# square of each element +# Square of each element > c(1:5) ^ 2 [1] 1 4 9 16 25 -# compare square of each element +# Compare square of each element > c(1:5) ^ 2 >= 5 [1] FALSE FALSE TRUE TRUE TRUE
diff --git a/pages/learn/r/cli/gdegdgz.html b/pages/learn/r/cli/gdegdgz.html index 5ec42f1..225d080 100644 --- a/pages/learn/r/cli/gdegdgz.html +++ b/pages/learn/r/cli/gdegdgz.html @@ -47,7 +47,7 @@
R sum() function
-# sum of two sequences
+# Sum of two sequences
 > 1:10 + 11:20
 [1] 12 14 16 18 20 22 24 26 28 30
 
@@ -58,26 +58,26 @@
 
 
R mean() and median() functions
-# mean of sequence 1 to 10
+# Mean of sequence 1 to 10
 > mean(1:10)
 [1] 5.5
 
-# median of sequence 1 to 10
+# Median of sequence 1 to 10
 > median(1:10)
 [1] 5.5
 
R identical() function
-# check if two objects are identical
+# Check if two objects are identical
 > identical(1,1)
 [1] TRUE
 
-# check if two objects are identical
+# Check if two objects are identical
 > identical(1,1.0)
 [1] TRUE
 
-# check if two objects are identical
+# Check if two objects are identical
 > identical(0 ^ 0,0 ** 0)
 [1] TRUE
 
@@ -95,15 +95,15 @@
R trigonometric function
-# value of pi
+# Value of pi
 > pi
 [1] 3.141593
 
-# sine of 30 radians
+# Sine of 30 radians
 > sin(30)
 [1] -0.9880316
 
-# tangent of 90 radians
+# Tangent of 90 radians
 > tan(90)
 [1] -1.9952
 
diff --git a/pages/learn/r/cli/gdexdvy.html b/pages/learn/r/cli/gdexdvy.html index 61f6abe..28bf1d1 100644 --- a/pages/learn/r/cli/gdexdvy.html +++ b/pages/learn/r/cli/gdexdvy.html @@ -7,38 +7,38 @@
 godarda@gd:~$ R
 ...
-# current date
+# Current date
 > Sys.Date()
 [1] "2020-06-18"
 
-# current date and time
+# Current date and time
 > Sys.time()
 [1] "2020-06-18 17:41:48 IST"
 
-# convert to date
+# Convert to date
 > as.Date(Sys.Date())
 [1] "2020-06-18"
 
-# convert string to date
+# Convert string to date
 > as.Date('2020/06/18')
 [1] "2020-06-18"
 
-# convert date with format
+# Convert date with format
 > as.Date(Sys.Date(),format='%Y-%m-%d')
 [1] "2020-06-18"
 
-# convert string to date with format
+# Convert string to date with format
 > as.Date('June 18, 2020',format='%B %d, %Y')
 [1] "2020-06-18"
 
-# convert string to date with format
+# Convert string to date with format
 > as.Date('18JUN20',format='%d%b%y')
 [1] "2020-06-18"
 
-# get day of the week
+# Get day of the week
 > weekdays(Sys.Date())
 [1] "Thursday"
-
# date difference +
# Date difference > date1 <- Sys.Date() > date2 <- as.Date("2020-06-30") > date1-date2 @@ -50,28 +50,28 @@ > date2 [1] "2020-06-30" -# date difference +# Date difference > date2-date1 Time difference of 12 days -# date difference in weeks +# Date difference in weeks > difftime(date2,date1,units="weeks") Time difference of 1.714286 weeks -# add days to date +# Add days to date > date2 + 20 [1] "2020-07-20" -# date difference in weeks +# Date difference in weeks > difftime(date2+20,date1,units="weeks") Time difference of 4.571429 weeks -
# sequence of dates +
# Sequence of dates > seq(Sys.Date(),by='days',length=12) [1] "2020-06-18" "2020-06-19" "2020-06-20" "2020-06-21" "2020-06-22" [6] "2020-06-23" "2020-06-24" "2020-06-25" "2020-06-26" "2020-06-27" [11] "2020-06-28" "2020-06-29" -# sequence of dates +# Sequence of dates > seq(Sys.Date(),to=as.Date("2020-12-31"),by='4 weeks') [1] "2020-06-18" "2020-07-16" "2020-08-13" "2020-09-10" "2020-10-08" [6] "2020-11-05" "2020-12-03" "2020-12-31" diff --git a/pages/learn/r/cli/gdgebwv.html b/pages/learn/r/cli/gdgebwv.html index b5dd6c3..c135b89 100644 --- a/pages/learn/r/cli/gdgebwv.html +++ b/pages/learn/r/cli/gdgebwv.html @@ -7,55 +7,72 @@
 godarda@gd:~$ R
 ...
+# Create a string
 > "GoDarda"
 [1] "GoDarda"
 
+# Print a string
 > print("Hello World")
 [1] "Hello World"
 
+# Print a string
 > cat("Hello World\n")
 Hello World
 
+# Length of vector
 > length("GoDarda")
 [1] 1
 
+# Number of characters
 > nchar("GoDarda")
 [1] 7
 
+# Convert to uppercase
 > toupper("GoDarda")
 [1] "GODARDA"
 
+# Convert to lowercase
 > tolower("GODARDA")
 [1] "godarda"
 
+# Extract substring
 > substring("GoDarda",3,7)
 [1] "Darda"
 
+# Concatenate strings
 > paste("Go","Darda")
 [1] "Go Darda"
 
+# Concatenate strings with separator
 > paste("Go","Darda",sep="")
 [1] "GoDarda"
 
+# Concatenate strings with separator
 > paste("Go","Darda",sep="@@@")
 [1] "Go@@@Darda"
 
+# Format string with width > format("GoDarda",width=20) [1] "GoDarda " +# Format string with justify > format("GoDarda",width=20,justify="") Error in match.arg(justify) : 'arg' should be one of β€œleft”, β€œright”, β€œcentre”, β€œnone” +# Format string with justify left > format("GoDarda",width=20,justify="l") [1] "GoDarda " +# Format string with justify center > format("GoDarda",width=20,justify="c") [1] " GoDarda " +# Format string with justify right > format("GoDarda",width=20,justify="r") [1] " GoDarda" +# Format string with justify none > format("GoDarda",width=20,justify="n") [1] "GoDarda"
From 6ba9e6104bc8aa5b741d6ab4c9cc7b0305f58174 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 16:55:13 +0000 Subject: [PATCH 04/36] Auto-update GDID sets (#24) Co-authored-by: shubhamrdarda <25701145+shubhamrdarda@users.noreply.github.com> --- assets/gdid_sets/gdid_setA.txt | 100 ++++++++++++++++----------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/assets/gdid_sets/gdid_setA.txt b/assets/gdid_sets/gdid_setA.txt index d5779ac..aaa53ec 100644 --- a/assets/gdid_sets/gdid_setA.txt +++ b/assets/gdid_sets/gdid_setA.txt @@ -4275,25 +4275,6 @@ gdkweoz - CONTRIBUTING.md (line 146); CONTRIBUTING.md (line 91) gdkwzyw - CONTRIBUTING.md (line 147); CONTRIBUTING.md (line 91) gdwyygg - CONTRIBUTING.md (line 148); CONTRIBUTING.md (line 91) gdgggza - CONTRIBUTING.md (line 150); CONTRIBUTING.md (line 96) -gdaeavq - pages/learn/asm/32-bit/gdaeavq.html -gdbhdky - pages/learn/asm/32-bit/gdbhdky.html -gdbqeza - pages/learn/asm/32-bit/gdbqeza.html -gddmaee - pages/learn/asm/32-bit/gddmaee.html -gdqnwvz - pages/learn/asm/32-bit/gdqnwvz.html -gdvakeg - pages/learn/asm/32-bit/gdvakeg.html -gdvvdud - pages/learn/asm/32-bit/gdvvdud.html -gdvxqaz - pages/learn/asm/32-bit/gdvxqaz.html -gdzkizy - pages/learn/asm/32-bit/gdzkizy.html -gdatnak - pages/learn/asm/64-bit/gdatnak.html -gdcgame - pages/learn/asm/64-bit/gdcgame.html -gdgywzg - pages/learn/asm/64-bit/gdgywzg.html -gdsgpyl - pages/learn/asm/64-bit/gdsgpyl.html -gdvnyvi - pages/learn/asm/64-bit/gdvnyvi.html -gdvthab - pages/learn/asm/64-bit/gdvthab.html -gdvyzpn - pages/learn/asm/64-bit/gdvyzpn.html -gdwagtz - pages/learn/asm/64-bit/gdwagtz.html -gdwdwaz - pages/learn/asm/64-bit/gdwdwaz.html -gdwzqyk - pages/learn/asm/64-bit/gdwzqyk.html gdaazcg - pages/learn/c/arrays/gdaazcg.html gdavnal - pages/learn/c/arrays/gdavnal.html gdmqyew - pages/learn/c/arrays/gdmqyew.html @@ -4434,6 +4415,56 @@ gdsxlqq - pages/learn/cg/shapes/gdsxlqq.html gdvayid - pages/learn/cg/shapes/gdvayid.html gdwwsfw - pages/learn/cg/shapes/gdwwsfw.html gdzewpm - pages/learn/cg/shapes/gdzewpm.html +gdaeavq - pages/learn/cluster/asm/gdaeavq.html +gdatnak - pages/learn/cluster/asm/gdatnak.html +gdbhdky - pages/learn/cluster/asm/gdbhdky.html +gdbqeza - pages/learn/cluster/asm/gdbqeza.html +gdcgame - pages/learn/cluster/asm/gdcgame.html +gddmaee - pages/learn/cluster/asm/gddmaee.html +gdgywzg - pages/learn/cluster/asm/gdgywzg.html +gdqnwvz - pages/learn/cluster/asm/gdqnwvz.html +gdsgpyl - pages/learn/cluster/asm/gdsgpyl.html +gdvakeg - pages/learn/cluster/asm/gdvakeg.html +gdvnyvi - pages/learn/cluster/asm/gdvnyvi.html +gdvthab - pages/learn/cluster/asm/gdvthab.html +gdvvdud - pages/learn/cluster/asm/gdvvdud.html +gdvxqaz - pages/learn/cluster/asm/gdvxqaz.html +gdvyzpn - pages/learn/cluster/asm/gdvyzpn.html +gdwagtz - pages/learn/cluster/asm/gdwagtz.html +gdwdwaz - pages/learn/cluster/asm/gdwdwaz.html +gdwzqyk - pages/learn/cluster/asm/gdwzqyk.html +gdzkizy - pages/learn/cluster/asm/gdzkizy.html +gdegsem - pages/learn/cluster/fsharp/gdegsem.html +gdewzhw - pages/learn/cluster/fsharp/gdewzhw.html +gdhadwu - pages/learn/cluster/fsharp/gdhadwu.html +gdwpkzv - pages/learn/cluster/fsharp/gdwpkzv.html +gdxmvyy - pages/learn/cluster/fsharp/gdxmvyy.html +gdzegce - pages/learn/cluster/fsharp/gdzegce.html +gdddysa - pages/learn/cluster/lisp/gdddysa.html +gdggadz - pages/learn/cluster/lisp/gdggadz.html +gdggdyw - pages/learn/cluster/lisp/gdggdyw.html +gdgoauk - pages/learn/cluster/lisp/gdgoauk.html +gdiewcv - pages/learn/cluster/lisp/gdiewcv.html +gdkdena - pages/learn/cluster/lisp/gdkdena.html +gdmalgp - pages/learn/cluster/lisp/gdmalgp.html +gdtrkke - pages/learn/cluster/lisp/gdtrkke.html +gduepzv - pages/learn/cluster/lisp/gduepzv.html +gduzcrz - pages/learn/cluster/lisp/gduzcrz.html +gdvagvz - pages/learn/cluster/lisp/gdvagvz.html +gdvwwue - pages/learn/cluster/lisp/gdvwwue.html +gdydkmw - pages/learn/cluster/lisp/gdydkmw.html +gdzedbg - pages/learn/cluster/lisp/gdzedbg.html +gdzygzo - pages/learn/cluster/lisp/gdzygzo.html +gdzzzay - pages/learn/cluster/lisp/gdzzzay.html +gdawdqp - pages/learn/cluster/octave/gdawdqp.html +gdazzam - pages/learn/cluster/octave/gdazzam.html +gdcvyzd - pages/learn/cluster/octave/gdcvyzd.html +gddggad - pages/learn/cluster/octave/gddggad.html +gdeceiw - pages/learn/cluster/octave/gdeceiw.html +gdeezgn - pages/learn/cluster/octave/gdeezgn.html +gdfxzpq - pages/learn/cluster/octave/gdfxzpq.html +gdgeiev - pages/learn/cluster/octave/gdgeiev.html +gduaulz - pages/learn/cluster/octave/gduaulz.html gdcewwv - pages/learn/cluster/ranorex/gdcewwv.html gdewwzv - pages/learn/cluster/ranorex/gdewwzv.html gdfzznc - pages/learn/cluster/ranorex/gdfzznc.html @@ -4616,12 +4647,6 @@ gdwzsgz - pages/learn/dsa/sorting/gdwzsgz.html gdyezyi - pages/learn/dsa/sorting/gdyezyi.html gdzxlqf - pages/learn/dsa/sorting/gdzxlqf.html gdbuzge - pages/learn/dsa/trees/gdbuzge.html -gdhadwu - pages/learn/fsharp/controls/gdhadwu.html -gdzegce - pages/learn/fsharp/controls/gdzegce.html -gdegsem - pages/learn/fsharp/fundamentals/gdegsem.html -gdewzhw - pages/learn/fsharp/fundamentals/gdewzhw.html -gdwpkzv - pages/learn/fsharp/fundamentals/gdwpkzv.html -gdxmvyy - pages/learn/fsharp/fundamentals/gdxmvyy.html gdaalaw - pages/learn/java/abstraction/gdaalaw.html gdaedbv - pages/learn/java/abstraction/gdaedbv.html gdddxgp - pages/learn/java/abstraction/gdddxgp.html @@ -4762,22 +4787,6 @@ gdwoddg - pages/learn/linux/commands/gdwoddg.html gdwzqca - pages/learn/linux/commands/gdwzqca.html gdyzygf - pages/learn/linux/commands/gdyzygf.html gdzbgoi - pages/learn/linux/commands/gdzbgoi.html -gdkdena - pages/learn/lisp/controls/gdkdena.html -gduepzv - pages/learn/lisp/controls/gduepzv.html -gduzcrz - pages/learn/lisp/functions/gduzcrz.html -gdddysa - pages/learn/lisp/fundamentals/gdddysa.html -gdggadz - pages/learn/lisp/fundamentals/gdggadz.html -gdggdyw - pages/learn/lisp/fundamentals/gdggdyw.html -gdgoauk - pages/learn/lisp/fundamentals/gdgoauk.html -gdiewcv - pages/learn/lisp/fundamentals/gdiewcv.html -gdmalgp - pages/learn/lisp/fundamentals/gdmalgp.html -gdvagvz - pages/learn/lisp/fundamentals/gdvagvz.html -gdvwwue - pages/learn/lisp/fundamentals/gdvwwue.html -gdydkmw - pages/learn/lisp/fundamentals/gdydkmw.html -gdzedbg - pages/learn/lisp/fundamentals/gdzedbg.html -gdzzzay - pages/learn/lisp/loops/gdzzzay.html -gdtrkke - pages/learn/lisp/strings/gdtrkke.html -gdzygzo - pages/learn/lisp/strings/gdzygzo.html gdeuazw - pages/learn/mongodb/crud/gdeuazw.html gdhydqg - pages/learn/mongodb/crud/gdhydqg.html gdhzgdy - pages/learn/mongodb/crud/gdhzgdy.html @@ -4805,15 +4814,6 @@ gdzzcev - pages/learn/mysql/dml/gdzzcev.html gddayxg - pages/learn/mysql/fundamentals/gddayxg.html gdgpzwy - pages/learn/mysql/fundamentals/gdgpzwy.html gdrgtrz - pages/learn/mysql/fundamentals/gdrgtrz.html -gdazzam - pages/learn/octave/fundamentals/gdazzam.html -gddggad - pages/learn/octave/fundamentals/gddggad.html -gdeezgn - pages/learn/octave/fundamentals/gdeezgn.html -gdfxzpq - pages/learn/octave/fundamentals/gdfxzpq.html -gdgeiev - pages/learn/octave/fundamentals/gdgeiev.html -gdawdqp - pages/learn/octave/strings/gdawdqp.html -gdcvyzd - pages/learn/octave/strings/gdcvyzd.html -gdeceiw - pages/learn/octave/strings/gdeceiw.html -gduaulz - pages/learn/octave/strings/gduaulz.html gddeqlk - pages/learn/python/arrays/gddeqlk.html gddkizz - pages/learn/python/arrays/gddkizz.html gddrehr - pages/learn/python/arrays/gddrehr.html From 9d5e624a2ea2343e7a4be5bef7a2ec584bd6fbcf Mon Sep 17 00:00:00 2001 From: Shubham Darda Date: Wed, 4 Feb 2026 18:36:30 +0530 Subject: [PATCH 05/36] v26.2.4 - Add Settings page and update navigation links; enhance footer and CSS styles --- 404.html | 2 +- _data/gd.yml | 12 ++++++--- _includes/footer_app.html | 40 +++++++++++++++------------- _layouts/modern.html | 12 ++++----- assets/css/gd.css | 1 + pages/about/shubhamrdarda/index.html | 5 +--- pages/settings/index.html | 6 +++++ 7 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 pages/settings/index.html diff --git a/404.html b/404.html index 22cca7e..b551c0d 100644 --- a/404.html +++ b/404.html @@ -19,7 +19,7 @@
404 Page Not Found
The page you are looking for doesn't exist. We apologize for the inconvenience. You can use the links below to navigate:
diff --git a/_data/gd.yml b/_data/gd.yml index adad888..3b846d7 100644 --- a/_data/gd.yml +++ b/_data/gd.yml @@ -63,10 +63,6 @@ segments: url: cluster parent: " Cluster " - - title: About Us - url: about - parent: " About " - - title: Tools url: tools parent: " Tools " @@ -91,6 +87,14 @@ segments: url: learn parent: " Learn " + - title: About Us + url: about + parent: " About " + + - title: Settings and More + url: settings + parent: " Settings " + - title: Shubham Darda url: shubhamrdarda parent: " Shubham Darda " diff --git a/_includes/footer_app.html b/_includes/footer_app.html index af7ef6e..4ab326b 100644 --- a/_includes/footer_app.html +++ b/_includes/footer_app.html @@ -1,8 +1,10 @@ -{%- if path[1] == "about" and path[2] == nil -%}{%- assign about_section = "about_home_true" -%} -{%- elsif path[1] == "about" and path[2] != nil -%}{%- assign about_section = "about_home_false" -%}{%- endif -%} -