{"id":337,"date":"2020-03-07T23:16:00","date_gmt":"2020-03-07T23:16:00","guid":{"rendered":"https:\/\/alterego.cc\/wp\/?p=337"},"modified":"2022-10-17T20:11:13","modified_gmt":"2022-10-17T20:11:13","slug":"string-permutations-sample-code","status":"publish","type":"post","link":"https:\/\/alterego.cc\/wp\/2020\/03\/07\/string-permutations-sample-code\/","title":{"rendered":"String permutations sample code"},"content":{"rendered":"\n<p>For some reasons had to test how GitHub works and upload an application there. I do like to code simple applications in&nbsp;<a href=\"https:\/\/www.xojo.com\/\" target=\"_blank\" rel=\"noreferrer noopener external\" data-wpel-link=\"external\">Xojo<\/a>&nbsp;when I need to fill the gap and cannot find the right tool for what I need to do<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"613\" height=\"392\" src=\"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?resize=613%2C392&#038;ssl=1\" alt=\"\" class=\"wp-image-339\" srcset=\"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?w=613&amp;ssl=1 613w, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?resize=300%2C192&amp;ssl=1 300w, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?resize=520%2C333&amp;ssl=1 520w, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?resize=320%2C205&amp;ssl=1 320w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/figure>\n<\/div>\n\n\n<p>In this case I needed a simple program to calculate all the possible permutations of a given string. There are many examples of this simple exercise on the Internet. I started by looking at&nbsp;<a href=\"https:\/\/www.geeksforgeeks.org\/write-a-c-program-to-print-all-permutations-of-a-given-string\/\" target=\"_blank\" rel=\"noreferrer noopener external\" data-wpel-link=\"external\">these<\/a><\/p>\n\n\n\n<center>\n\n\n        \n        <div class=\"embedpress-gutenberg-wrapper source-provider-Giphy aligncenter clear   ep-content-protection-disabled inline\" id=\"\" data-embed-type=\"Giphy \">\n            <div class=\"wp-block-embed__wrapper \">\n                <div id=\"ep-gutenberg-content-\" class=\"ep-gutenberg-content\">\n                    <div >\n                        <div class=\"ep-embed-content-wraper preset-default insta-grid ep-google-photos-carousel\"\n                                                                                                                >\n\n                            <div class=\"ose-giphy ose-uid-49c6bdb67fbbc8ce0f673dc6cf9d678f ose-embedpress-responsive\" style=\"width:600px; max-width:100%; height: auto; display:inline-block;\"><a href=\"https:\/\/giphy.com\/gifs\/PLCnext-plcnext-phoenixcontact-plcnexttechnology-fwbZnTftCXVocKzfxR\" data-wpel-link=\"external\" target=\"_blank\" rel=\"external noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/media1.giphy.com\/media\/fwbZnTftCXVocKzfxR\/giphy.gif?resize=600%2C450&#038;ssl=1\" alt=\"Code Coding GIF by PLCnext Technology - Find &amp; Share on GIPHY\" width=\"600\" height=\"450\" \/><\/a><\/div>                        <\/div>\n\n                                            <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    \n\n\n<\/center>\n\n\n\n<p>The Java version looked like a good candidate for \u201ctranslation\u201d, so I took inspiration from it. The code is well commented (or at least this is what I think). Xojo is free to download and test, so the project can be opened and checked without having to pay for the&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Integrated_development_environment\" target=\"_blank\" rel=\"noreferrer noopener external\" data-wpel-link=\"external\">IDE<\/a>. I provided a compiled version as well. The setup is quite big because I had to include some Microsoft Windows runtime libraries but those won\u2019t get installed at all if you already have them on your system. The compiled version can be downloaded from&nbsp;<a href=\"https:\/\/github.com\/fabiolichinchi\/permute\/releases\" target=\"_blank\" rel=\"noreferrer noopener external\" data-wpel-link=\"external\">here<\/a>&nbsp;and the source code from&nbsp;<a href=\"https:\/\/github.com\/fabiolichinchi\/permute\" target=\"_blank\" rel=\"noreferrer noopener external\" data-wpel-link=\"external\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A really simple project in Xojo, just for fun and because I noticed there were examples of string permutations code in so many languages but Xojo. I fixed that. You are welcome<\/p>\n","protected":false},"author":1,"featured_media":339,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12],"tags":[64,43,50,51,52],"class_list":["post-337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-english","tag-github","tag-permutations","tag-string","tag-xojo"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/permutations.png?fit=613%2C392&ssl=1","jetpack-related-posts":[{"id":328,"url":"https:\/\/alterego.cc\/wp\/2020\/03\/05\/core-php-okta-login-example\/","url_meta":{"origin":337,"position":0},"title":"Core PHP + Okta Login Example","author":"fabio","date":"5 March 2020","format":false,"excerpt":"Encountered a funny error while testing an Okta tutorial. This is the story of how I overcome the problem and lived happily ever after","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/alterego.cc\/wp\/category\/tutorials\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/CorePHPOktaLoginExample.jpg?fit=499%2C246&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1968,"url":"https:\/\/alterego.cc\/wp\/2026\/03\/19\/fix-browsertamer-1-0-available-on-github\/","url_meta":{"origin":337,"position":1},"title":"fix-browsertamer 1.0 available on GitHub","author":"fabio","date":"19 March 2026","format":false,"excerpt":"Modern Windows versions introduced mechanisms such as UCPD and UserChoice protections that prevent programmatic changes to default browsers. This post introduces a script that restores Browser Tamer as the default browser and automates the entire workaround process","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/alterego.cc\/wp\/category\/software\/"},"img":{"alt_text":"Illustration of a Windows laptop running a script to fix Browser Tamer as the default browser, routing links to multiple browsers","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/03\/fix-browser-tamer.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/03\/fix-browser-tamer.png?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/03\/fix-browser-tamer.png?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/03\/fix-browser-tamer.png?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/03\/fix-browser-tamer.png?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1503,"url":"https:\/\/alterego.cc\/wp\/2023\/02\/19\/pinterest-downloader-first-release\/","url_meta":{"origin":337,"position":2},"title":"Pinterest downloader first release","author":"fabio","date":"19 February 2023","format":false,"excerpt":"Pinterest downloader first command line release for Windows 64 bit!","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/alterego.cc\/wp\/category\/development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2023\/02\/Pinterest_Small_Logo.png?fit=660%2C660&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2023\/02\/Pinterest_Small_Logo.png?fit=660%2C660&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2023\/02\/Pinterest_Small_Logo.png?fit=660%2C660&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1390,"url":"https:\/\/alterego.cc\/wp\/2022\/11\/14\/macos-ventura-issues-with-multiple-monitors\/","url_meta":{"origin":337,"position":3},"title":"macOS Ventura issues with multiple monitors","author":"fabio","date":"14 November 2022","format":false,"excerpt":"Having issues with Microsoft Remote Desktop on a Mac running macOS Ventura? It might be your Color Profile. A couple of things to try:","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/alterego.cc\/wp\/category\/software\/"},"img":{"alt_text":"MacOS Ventura Roundup Header","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/11\/macos-ventura-roundup-header.webp?fit=800%2C450&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/11\/macos-ventura-roundup-header.webp?fit=800%2C450&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/11\/macos-ventura-roundup-header.webp?fit=800%2C450&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/11\/macos-ventura-roundup-header.webp?fit=800%2C450&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":321,"url":"https:\/\/alterego.cc\/wp\/2020\/02\/12\/shaarli-and-external-links-in-a-new-tab\/","url_meta":{"origin":337,"position":4},"title":"Shaarli and external links in a new tab","author":"fabio","date":"12 February 2020","format":false,"excerpt":"I love Shaarli. I loved it less when I found out links were opened in the same tab as Shaarli itself. Then I felt in love again when I found out this plugin to open links in new tabs. Eventually I modified it. Read about the excellent modification!","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/alterego.cc\/wp\/category\/development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/shaarli_logo2.png?fit=600%2C223&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/shaarli_logo2.png?fit=600%2C223&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2022\/02\/shaarli_logo2.png?fit=600%2C223&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1982,"url":"https:\/\/alterego.cc\/wp\/2026\/04\/05\/fix-browsertamer-1-1\/","url_meta":{"origin":337,"position":5},"title":"fix-browsertamer 1.1","author":"fabio","date":"5 April 2026","format":false,"excerpt":"Make BrowserTamer stick as default on Windows 10\/11: UCPD, UserChoiceLatest, PS-SFTA, registration fixes, phantom-browser cleanup, and uninstall.","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/alterego.cc\/wp\/category\/development\/"},"img":{"alt_text":"Illustrated BrowserTamer version 1.1 banner with a smiling robot holding a wrench, surrounded by gears, code icons and repair symbols","src":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/04\/BrowserTamer-1.1-release-announcement.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/04\/BrowserTamer-1.1-release-announcement.png?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/04\/BrowserTamer-1.1-release-announcement.png?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/04\/BrowserTamer-1.1-release-announcement.png?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/alterego.cc\/wp\/wp-content\/uploads\/2026\/04\/BrowserTamer-1.1-release-announcement.png?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":0,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/media\/339"}],"wp:attachment":[{"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alterego.cc\/wp\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}