<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 🇸🇬 🇲🇾 Dazzleworth on Medium]]></title>
        <description><![CDATA[Stories by 🇸🇬 🇲🇾 Dazzleworth on Medium]]></description>
        <link>https://medium.com/@dazzleworth13?source=rss-d63ef7a50f36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5DxeO4Z3gwts2NIeo3anaA.jpeg</url>
            <title>Stories by 🇸🇬 🇲🇾 Dazzleworth on Medium</title>
            <link>https://medium.com/@dazzleworth13?source=rss-d63ef7a50f36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:31:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dazzleworth13/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using C/C++ pre-defined constants for array bounds]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dazzleworth13/using-c-c-pre-defined-constants-for-array-bounds-42158b29769f?source=rss-d63ef7a50f36------2"><img src="https://cdn-images-1.medium.com/max/600/1*tYls_ucjR3VLwmzvK9a5Cw.png" width="600"></a></p><p class="medium-feed-snippet">Don&#x2019;t hardcode them in your project unless really necessary</p><p class="medium-feed-link"><a href="https://medium.com/@dazzleworth13/using-c-c-pre-defined-constants-for-array-bounds-42158b29769f?source=rss-d63ef7a50f36------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dazzleworth13/using-c-c-pre-defined-constants-for-array-bounds-42158b29769f?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/42158b29769f</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 08:51:45 GMT</pubDate>
            <atom:updated>2026-09-28T14:30:59.847Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Writing JVM Apps and High-Performance Native Code in a Single Language]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dazzleworth13/writing-jvm-apps-and-high-performance-native-code-in-a-single-language-e44b8f780652?source=rss-d63ef7a50f36------2"><img src="https://cdn-images-1.medium.com/max/613/1*4sTpm7ZCdcecEW07iRAmKA.png" width="613"></a></p><p class="medium-feed-snippet">Let&#x2019;s do it all in a single language (Kotlin/Java): Bypass C/C++ logic, leverage GraalVM static compilation, and bundle AOT-native Java&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@dazzleworth13/writing-jvm-apps-and-high-performance-native-code-in-a-single-language-e44b8f780652?source=rss-d63ef7a50f36------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dazzleworth13/writing-jvm-apps-and-high-performance-native-code-in-a-single-language-e44b8f780652?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/e44b8f780652</guid>
            <category><![CDATA[polyglot]]></category>
            <category><![CDATA[graalvm-native-image]]></category>
            <category><![CDATA[graalvm]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 18:24:47 GMT</pubDate>
            <atom:updated>2026-09-04T04:07:40.881Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Exploring Android Internals with Termux]]></title>
            <link>https://medium.com/@dazzleworth13/exploring-android-internals-with-termux-941946776eac?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/941946776eac</guid>
            <category><![CDATA[termux-android]]></category>
            <category><![CDATA[termux]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Wed, 20 May 2026 14:21:14 GMT</pubDate>
            <atom:updated>2026-05-21T17:06:24.291Z</atom:updated>
            <content:encoded><![CDATA[<h4>Install Python, Kotlin and Android development toolchains on your Android device</h4><h4>In this article, I show you how to run your favorite CLI programmer in a popular development Android app called Termux. I will be demonstrating plain-old-Java, together with some native code for some GNU/linux function calls</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXRUEHRP_Jlpe8cIZE_xdg.png" /><figcaption>Termux: A sysadmin/programmer’s pocket companion dream</figcaption></figure><p>If you wanted to code your Java/C++/C app but do not have a computer, chances are, you would have an android device you can use. Androids are basically Linux boxes, as are Raspberry Pis and you can perfectly run your favorite Java, Python and C/C++ scripts and programs on it</p><h3>Prerequisites</h3><p>First off, you will need to install the Termux App. There are 2 ways to do this. You can sideload it by downloading the .apk file and running the default or a custom Android installer to set it up on your Android device. Alternatively, you can use an “app store” app such as F-Droid to install and automatically keep it up to date when a new version arrives.</p><p>This article assumes you have set-up and run Termux successfully on your Android device. It also assumes you are comfortable with the Linux terminal environment.</p><h3>Installing required tools</h3><p>You may be used to Ubuntu and other Linux package installers like apt-get, yum or pip on PCs. Termux have its own versions, the pkg command and the related repositories also have separate versions that runs on Termux enviroment. This is because Termux runs on a different hardware profile eg. (ARM devices like your mobile phones and tablet PCs) Fortunately, Termux-ported repositories exists for our favorite environments like Java, Python and C++ amongst others. You can try to run the tools as you would on your PC , like java or javac, gcc, clang or python3 and the environment will prompt you to install it if hasn’t been:</p><pre>~ $ java<br>The program java is not installed. Install it by executing:<br> pkg install openjdk-17</pre><p>Here are the common SDKs you can install with pkg install:</p><pre>$ pkg install mono<br>$ pkg install python<br>$ pkg install pip<br>$ pkg install openjdk-XX<br>$ pkg install kotlin<br>$ pkg install ninja<br>$ pkg install git<br>$ pkg install golang</pre><h3>Console I/O Testing</h3><p>Now, we are ready for primetime. So basically, Termux is an Android app similiar to command prompt in Windows and Terminal in Linux &amp; Mac and short of developing anothe installable app, we are limited to develop within the terminal console only. To make the best of it, we present <a href="https://www.reddit.com/r/csharp/">r/csharp</a>’s <a href="https://www.reddit.com/r/csharp/comments/1r8vp1w/c_colorfull_hello_world/">C# Hello, World</a> example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*WkFFExFgW7OYHokcmPLDEg.png" /></figure><p>Make sure you have Mono installed.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUi8I65Uf3dA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FUi8I65Uf3dA%3Fsi%3DtiQjzZiGopgpFHmp&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUi8I65Uf3dA%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/10fcde5873489ad3a3ea4eb6c287b73b/href">https://medium.com/media/10fcde5873489ad3a3ea4eb6c287b73b/href</a></iframe><p>See also</p><ul><li><a href="https://medium.com/@dazzleworth13/java-jni-command-line-programming-on-termux-in-android-477de24b7abe">Java/JNI command-line programming on Termux in Android</a> (Paywall)</li><li><a href="https://medium.com/@dazzleworth13/relative-to-absolute-path-in-jython-37ac2347319f">Relative-to-absolute path in Jython</a> (Paywall)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=941946776eac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java/JNI command-line programming on Termux in Android]]></title>
            <link>https://medium.com/@dazzleworth13/java-jni-command-line-programming-on-termux-in-android-477de24b7abe?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/477de24b7abe</guid>
            <category><![CDATA[termux-android]]></category>
            <category><![CDATA[android-jni]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 09:26:06 GMT</pubDate>
            <atom:updated>2026-05-27T07:11:56.251Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, I show you how to run your favorite CLI programmer in a popular development Android app called Termux. I will be demonstrating plain-old-Java, together with some native code for some GNU/linux function calls</h4><p>If you wanted to code your Java/C++/C app but do not have a computer, chances are, you would have an android device you can use. Androids are basically Linux boxes, as are Raspberry Pis and you can perfectly run your favorite Java, Python and C/C++ scripts and programs on it</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*LXRUEHRP_Jlpe8cIZE_xdg.png" /></figure><h3>Prerequisites</h3><p>First off, you will need to install the Termux App. There are 2 ways to do this. You can sideload it by downloading the .apk file and running the default or a custom Android installer to set it up on your Android device. Alternatively, you can use an “app store” app such as F-Droid to install and automatically keep it up to date when a new version arrives.</p><p>This article assumes you have set-up and run Termux successfully on your Android device. It also assumes you are comfortable with the Linux terminal environment.</p><h3>Installing required tools</h3><p>You may be used to Ubuntu and other Linux package installers like apt-get, yum or pip on PCs. Termux have its own versions, the pkg command and the related repositories also have separate versions that runs on Termux enviroment. This is because Termux runs on a different hardware profile eg. (ARM devices like your mobile phones and tablet PCs) Fortunately, Termux-ported repositories exists for our favorite environments like Java, Python and C++ amongst others. You can try to run the tools as you would on your PC , like java or javac, gcc, clang or python3 and the environment will prompt you to install it if hasn’t been:</p><pre>$ java<br>The program java is not installed. Install it by executing:<br> pkg install openjdk-17</pre><h3>USB Debug State</h3><p>Without further ado, I present an example of a CLI app that detects, in real-time whether ADB debugging has been enabled. I start off with coding the Java-front end (which is using simple console output), generating the JNI function prototypes in native code and coding the detection in native code code. I then compile both the Java the traditional way and the native code with clang, highlighting the principles of creating a shared library and for the correct architecture (ARM 64-bit : aarch64 or arm-v8a)</p><p>First, create a file called NativeReadProperties.java and paste the following:</p><pre><br>public class NativeReadProperties {<br> <br>    static {<br> <br>        System.loadLibrary(&quot;readprops&quot;);<br> <br>    }<br> <br> <br>    private native boolean isUsbDebug();<br> <br> <br>    public static void main(String[] args) {<br> <br>        <br> <br>        if(new NativeReadProperties().isUsbDebug())<br> <br>            System.out.println(&quot;USB Debugging detected. Please turn-off&quot;);<br> <br>        else<br> <br>            System.out.println(&quot;Welcome!&quot;);<br> <br>    }<br> <br>}</pre><p>From Termux, you could nano NativeReadProperties.java it should be installed by default, if not install it using the pkg comand in the above section paste the above and save it. Now, we need to code the native version, we’ll use C:</p><pre>#include &lt;jni.h&gt;<br> <br>#include &lt;string.h&gt;<br> <br>#include &lt;unistd.h&gt;<br> <br>#include &lt;sys/system_properties.h&gt;<br> <br> <br><br> <br> <br>JNIEXPORT jboolean JNICALL Java_NativeReadProperties_isUsbDebug(JNIEnv *env, jobject obj) {<br> <br>    char res[PROP_VALUE_MAX];<br> <br>    __system_property_get(&quot;init.svc.adbd&quot;, res);    <br> <br>    if(strcmp(res, &quot;running&quot;) == 0)<br> <br>             return JNI_TRUE;<br> <br> <br> <br>    return JNI_FALSE;<br> <br>}</pre><p>Here, we’re using the sys/system_properties.h Linux/Android APIs. We have to compile this with an Android NDK compiler that supports ARM 64-bit mode and uses Android API 21. Also like GCC, there’s the -shared option to compile it as a shared library. Here, we are using the __system_property_get function to check for “init.svc.adbd” to contain the property string “running”.</p><pre>$ clang --target=aarch64-linux-android21 -fPIC -shared -o libreadprops.so JNIReadprops.c</pre><p>Now, compile the Java code</p><pre>$ javac path/to/NativeReadProperties.java</pre><p>and run with</p><pre>$ java -Djava.library.path=path/to/library.so NativeReadProperties</pre><p>This should give you the output</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZm39zVWKJK4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FZm39zVWKJK4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZm39zVWKJK4%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/85070a64635d77f332d85a65816e78f0/href">https://medium.com/media/85070a64635d77f332d85a65816e78f0/href</a></iframe><h3>Alternative method with popen()</h3><p>You can also use popen() with getprop command to read the settings to determine USB Debug mode:</p><pre>#include &lt;stdio.h&gt;  //additional header required for popen(), fgets()<br>....................<br><br>FILE *file = popen(&quot;getprop init.svc.adbd&quot;,&quot;r&quot;);<br>bool flag = false;<br>    while (fgets(res, PROP_VALUE_MAX, file) != 0) {<br>        if(strcmp(res, &quot;running&quot;) == 0)<br>             flag = true;<br><br>}<br>    pclose(file);</pre><h3>Further caveats</h3><p>As your code base grows, it would be wise to do some house keeping. If you wish to use the package structure package com.myapp, you should create the path with mkdir -p com/myapp and place NativeReadProperties.java it inside. Navigate back to NativeReadProperties.java and add this line:</p><p>package com.myapp; at the top like this</p><pre>package com.myapp;<br><br>public class NativeReadProperties {<br> <br>    static {<br> <br>        System.loadLibrary(&quot;readprops&quot;);<br> <br>    }<br> <br> <br>    private native boolean isUsbDebug();<br> <br> <br>    public static void main(String[] args) {<br> <br>        <br> <br>        if(new NativeReadProperties().isUsbDebug())<br> <br>            System.out.println(&quot;USB Debugging detected. Please turn-off&quot;);<br> <br>        else<br> <br>            System.out.println(&quot;Welcome!&quot;);<br> <br>    }<br> <br>}</pre><p>The resultant JNI function header code will look like this:</p><pre>JNIEXPORT jboolean JNICALL Java_com_myapp_NativeReadProperties_isUsbDebug(JNIEnv *env, jobject obj);</pre><p>There is a better way to automatically generate these headers. You might be familiar with the javah command that comes with a regular, standard JDK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mB07UerF2Ok0zrInuF-mQA.jpeg" /></figure><p>However, the Termux version seems to be missing that command. Fret not, we can still use the javac command with the -h switch to do so:</p><pre>$ javac -h . path/to/NativeReadProperties.java</pre><p>In this case, this will create a com_myapp_NativeReadProperties.h in the current folder (denoted by . ) which you can #include into your native .c source code file. The com_myapp_NativeReadProperties.hfile contains the correct prototype header for your function.</p><h3>Conclusion</h3><p>There is so much more fun you can have programming on Termux in your pocket. Let me know in the comments below if you have any further ideas on programming in Termux! Is there any topic you like covered? Drop your coments below and do remember to follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=477de24b7abe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The ABCs of OOP Javascript — apply(), bind() and call()]]></title>
            <link>https://medium.com/@dazzleworth13/the-abcs-of-oop-javascript-apply-bind-and-call-6a2869baa191?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a2869baa191</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 16:55:48 GMT</pubDate>
            <atom:updated>2026-05-27T07:12:16.808Z</atom:updated>
            <content:encoded><![CDATA[<h3>The ABCs of OOP Javascript — apply(), bind() and call()</h3><h4>Never, ever learn “Hello, World” until you’ve learnt this-&gt;</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t417otWUloIoX6Qj" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">Sigmund</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you have some programming experience and would like to get comfortable with JavaScript, this may be the only article you need to read. Let’s dive straight in. Even if you are touching Javascript for the first time, these 3 methods are the most important methods you should know in Javascript. It is found in production code and aids with anything from OOP design-patterns to optimization and/or reverse-engineering. From <a href="https://www.w3schools.com/">W3Schools</a>:</p><h4>apply() :</h4><p>Syntax:</p><p>functionName.apply(<strong>this</strong>, [arg1, arg2, …]); [<a href="https://www.w3schools.com/js/js_function_apply.asp">Link</a>]</p><p>Example:</p><pre>const person1 = { name: &quot;John&quot; };<br>const person2 = { name: &quot;Paul&quot; };<br>const person3 = { name: &quot;Ringo&quot; };<br><br>function greet(greeting) {<br>  return greeting + &quot; &quot; + this.name;<br>}<br><br>greet.apply(person3, [&quot;Hello&quot;]);</pre><h4>bind() :</h4><p>Syntax:</p><p>const newFunction = functionName.bind(<strong>this</strong>, arg1, arg2, …); [<a href="https://www.w3schools.com/js/js_function_bind.asp">Link</a>]</p><p>Example:</p><pre>const person1 = { name: &quot;John&quot; };<br>const person2 = { name: &quot;Paul&quot; };<br>const person3 = { name: &quot;Ringo&quot; };<br><br>function greet() {<br>  return &quot;Hello &quot; + this.name;<br>}<br><br>const greetJohn = greet.bind(person1);<br><br>greetJohn();</pre><h4>call() :</h4><p>Syntax:</p><p>functionName.call(<strong>this</strong>, arg1, arg2, …); [<a href="https://www.w3schools.com/js/js_function_call.asp">Link</a>]</p><p>Example :</p><pre>const person1 = { name: &quot;John&quot; };<br>const person2 = { name: &quot;Paul&quot; };<br>const person3 = { name: &quot;Ringo&quot; };<br><br>function greet(greeting) {<br>  return greeting + &quot; &quot; + this.name;<br>}<br><br>greet.call(person3, &quot;Hello&quot;);</pre><h4>More advanced usage</h4><p>Think Javascript is only confined to web development and a very niche segment of the programming field? Think again. Javascript is widely used in React JS/Native and Phonegap/Cordova/Capacitor to develop modern-day cross-platform mobile phone apps and NodeJS for desktop apps.</p><h4>Static Analysis</h4><p>Android Apps with utilise Javascript cross-platform development frameworks usually store the script as text in some form and perform Just-In-Time (JIT) compilation technology. This means code is interpreted rather than compiled. This is done because entire Javascript engines wont need to be re-written from scratch. Here we determined the Hermes engine was used to compile React Javascript to a form of bytecode, so I used the <a href="https://github.com/P1sec/hermes-dec">Hermes Decompiler</a> (hermes-dec) to produce the Javascript code. Here, at line 034034, we see our first apply() function called</p><pre>034022  case 487:<br>034023                r0 = global;<br>034024                r2 = r0.String;<br>034025                r1 = r2.fromCodePoint;<br>034026                r0 = new Array(0);<br>034027                r36 = r0;<br>034028                r35 = r4;<br>034029                r34 = 0;<br>034030                r3 = arraySpread(r36, r35, r34);<br>034031                r36 = r1;<br>034032                r35 = r0;<br>034033                r34 = r2;<br>034034                r0 = apply(r36, r35, r34);</pre><p>Using the prototype functionName.call(<strong>this</strong>, arg1, arg2, …); , we see that we are creating a new array and passing it the values r35 which is the value of r4, followed by an r34, which is the integer 0. r4 is referenced further up in the code, so its up to you to follow the trail (note: link to dump file below). And the array is stored in r0. Pretty straightforward huh?</p><p>Now, let’s move a little further up to line 023654. Here is where it gets a little tricky:</p><pre>023654        var _closure1_slot17 = r0;<br>023655        r0 = function(a0) { // Original name: isNormalizedWindowsDriveLetterString, environment: r1<br>023656            _fun843: for(var _fun843_ip = 0; ; ) switch(_fun843_ip) {<br>023657  case 0:<br>023658                r2 = a0;<br>023659                r1 = r2.length;<br>023660                r0 = 2;<br>023661                r0 = r1 === r0;<br>023662                if(!r0) { _fun843_ip = 49; continue _fun843 }<br>023663  case 18:<br>023664                r4 = _closure1_slot3;<br>023665                r3 = r4.isASCIIAlpha;<br>023666                r5 = r2.codePointAt;<br>023667                r1 = 0;<br>023668                r1 = r5.bind(r2)(r1);<br>023669                r0 = r3.bind(r4)(r1);<br>023670  case 49:<br>023671                if(!r0) { _fun843_ip = 67; continue _fun843 }<br>023672  case 52:<br>023673                r1 = 1;<br>023674                r2 = r2[r1];<br>023675                r1 = &#39;:&#39;;<br>023676                r0 = r2 === r1;<br>023677  case 67:<br>023678                return r0;<br>023679            }<br>023680        };</pre><p>Here, we observed it contains two bind() functions with a syntax that’s very different from the W3Schools documentation. Is that syntax valid? Let’s find out. First, we have to take r5 and r3 as functions if functionName.bind is the syntax. But what about bind(r2)(r1) and bind(r4)(r1)? Enter <a href="https://www.w3schools.com/js/js_function_closures.asp">Closures</a>. From W3Schools:</p><pre>function myCounter() {<br>  let counter = 0;<br>  return function() {<br>    counter++;<br>    return counter;<br>  };<br>}<br>const add = myCounter();<br>add();<br>add();<br>add();<br><br>// the counter is now 3</pre><blockquote>The variable add is assigned to the return value of a function.</blockquote><blockquote>The function only runs once. It sets the counter to zero (0), and returns a function expression.</blockquote><blockquote>This way add becomes a function. The “wonderful” part is that it can access the counter in its parent scope.</blockquote><blockquote>This is called a <strong>closure.</strong> It makes it possible for a function to have “<strong>private</strong>” variables.</blockquote><blockquote>The counter is protected by the scope of the myCounter function, and can only be changed using the add function.</blockquote><p>So using closure style turning variables into functions, lets modify our bind example:</p><pre>const person1 = { name: &quot;John&quot; };<br>const person2 = { name: &quot;Paul&quot; };<br>const person3 = { name: &quot;Ringo&quot; };<br><br>function greet(ee) {<br>  return &quot;Hello &quot; + this.name + &quot;. From &quot;+ee;<br>}<br><br>const greetingsFromMary = greet.bind(person3)(&quot;Mary&quot;);<br><br>greetingsFromMary();         //Hello Ringo. From Mary<br><br>return greetingsFromMary;    //return function reference</pre><p>This is equivalent to r1 = r5.bind(r2)(r1) and r0 = r3.bind(r4)(r1)</p><p>Now, let’s hop over to line 028403. Here, we see that call() without paremeters. This isn’t the usage that is taught in W3Schools. So what’s going on? Recall that methods in JavaScript can be assigned to variables, so this is whats happening.</p><pre>case 351:<br>                    r7 = r7.Uint8Array;<br>                    r7 = r7.prototype;<br>                    if(r5) { _fun921_ip = 385; continue _fun921 }<br>case 365:<br>                    r11 = r7.lastIndexOf;<br>                    r9 = r11.call;<br>                    r9 = r9.bind(r11)(r6, r10, r2);<br>                    return r9;<br>case 385:<br>                    r9 = r7.indexOf;<br>                    r7 = r9.call;<br>                    r7 = r7.bind(r9)(r6, r10, r2);<br>                    return r7;</pre><p>Here, we are basically assigning functionName.callto variables r9 and r7. Then, we still need to call bind() function to bind it with functionName, which in this case is r9 and r11, so likewise we modify our example to get the following. Simple, eh?</p><pre>const person1 = { name: &quot;John&quot; };<br>const person2 = { name: &quot;Paul&quot; };<br>const person3 = { name: &quot;Ringo&quot; };<br><br>// Function to return a greeting<br>function greet(greeting) {<br>  return greeting + &quot; &quot; + this.name;<br>}<br><br>const message = greet.call;<br><br>result = message.bind(greet)(person3, &quot;Hello&quot;);    //result = &quot;Hello Ringo&quot;</pre><p>Download: [ <a href="https://raw.githubusercontent.com/dazzleworth/react-js-android-demo/refs/heads/master/user_0/app/my_output_file.js">JS File</a> | <a href="https://raw.githubusercontent.com/dazzleworth/react-js-android-demo/refs/heads/master/user_0/app/my_output_file_with_ln.js">JS File (with line numbering)</a> ] Warning: 10–12 Megabytes (300K lines of code) text files follow, recommended to save the file to your device and view it with a dedicated text editor as browser may have limited memory and crash when viewing large text data. I use the free <a href="https://notepad-plus-plus.org/">Notepad++</a> to search, find variable usage and other useful tools</p><h3>Obfuscation &amp; Optimisation</h3><p>As you may have noticed the code here seems overly complex and hence is likely to be obfuscated with unreadable identifiers such as _fun843 and r0…r5 . Like in JavaScript code used in web development, code in cross-platform JavaScript apps is obfuscated or at least “minified” before it goes into “production” or “release” mode. This is done not just to make the code harder to understand but the significant performance tradeoff as code becomes more compact. Mini-fication also combines many JavaScript libraries in a single JS file. This is evident that although we are looking at an Android app, we see code for iOS, Windows and Mac in the Android bundle file. Here we can see function definitions for 6,334 JS methods!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sbdv6kbbrNlHsHGRF3_jVQ.png" /><figcaption>React JS encompasses a whooping 6334 methods across desktop and mobile platforms!</figcaption></figure><p>Recall, as I mentioned earlier about ascertaining the validity of the JS code? Why is this an issue? Because decompilers aren’t guaranteed to produce 100% fully functional code. They often produce code that is approximated and close as possible to the actual code. The probability they don’t increases if packers and obfuscators are used. If you are me that has a special interest in reverse engineering, it’s important to know the correct syntax to understand what the decompiled does, and make intelligent guesses where needed, and to make changes to .</p><p>As this is static analysis only, we are unable to gain much information from the inner workings of this app. Effective reverse-engineering often pairs static analysis with dynamic analysis to discover hidden secrets of the app. Dynamic analysis is beyond the scope of this article, but you can <a href="https://pilfer.github.io/mobile-reverse-engineering/react-native/reverse-engineering-and-instrumenting-react-native-apps/">check this link out</a> if you are interested.</p><h4>Conclusion</h4><p>Here, I’ve covered the important ABCs specific to the JavaScript language one must understand in order to quickly become familiar with the language. Also helpful topics include Closures, modules, reflection and proxies in JavaScript to be effective as a JavaScript developer or software engineer. Is there any JavaScript specific topic that you think is essential? Have you found any interesting use case of ABC in the massive JS file? Let us know in the comments below!</p><p>Visit the <a href="https://github.com/dazzleworth/react-js-android-demo">Github repository for article materials</a>.</p><p>Is there a topic you would like me to investigate and write about? Get in touch with me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a2869baa191" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Modern Managed C++ on Visual Studio]]></title>
            <link>https://medium.com/@dazzleworth13/exploring-modern-managed-c-on-visual-studio-79b6c37a088f?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/79b6c37a088f</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[retrocomputing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Fri, 16 Jan 2026 15:59:14 GMT</pubDate>
            <atom:updated>2026-01-26T17:31:41.242Z</atom:updated>
            <content:encoded><![CDATA[<h4>We look at what it takes to get what is now known as C++/CLI running on today’s Microsoft’s Visual Studio and Windows Server</h4><p>How does a 20-odd year old, obscure, little known, C++ like .NET language get revived? You would assume it has been buried and forgotten. Contrary to popular belief, it is still very much supported in the latest versions of Visual Studio and Windows 10+ although you’ll need a few tweaks to get it going. In this article, we are going to explore its history, how to get up and running and its advantages over traditional C++ and popular .NET languages such as C# and Visual Basic</p><h4>History</h4><p>C++/CLI is a 20-year old plus language launched around 2002 by Microsoft. It borrowed much of its syntax from traditional K&amp;R C / C++ 98 and supports full Object Oriented Programming (OOP) concepts. Two versions exist:</p><ul><li><a href="https://en.wikipedia.org/wiki/Managed_Extensions_for_C%2B%2B">Managed C++</a> (original, introduced around 2001–2005; with the corresponding versions of Visual Studio)</li><li><a href="https://en.wikipedia.org/wiki/C%2B%2B/CLI">C++/CLI</a> (after 2005 — current; till depreciated)</li></ul><p>So from now on well reference it as C++/CLI as this is the latest version. Still, C++/CLI is considered a .NET language (much like C#/VB) and not a fully native C++ variant, so it uses Intermediate Language (IL) compilation by default. Additionally, C++/CLI is only supported on a limited range on OS and devices. It is designed to develop apps that run on the Windows platform and for developing Desktop, Windows Store and Web/Web Service (ASP.NET) apps only. No universal/multiplatform (Linux, Mac and mobile Xamarin/MAUI) support, unfortunately</p><h4>Set-Up and Preparation</h4><p>First of all, well need a Windows 10+ machine and Visual Studio Installed, if you have already done this, which I assume you have, you may skip this part. So, go ahead and download the Visual Studio Installer executable and run it. Follow the instructions to download a Visual Studio product. If already installed, press the Modify button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AiaX6M3imumvOCmyZcRYYw.png" /></figure><p>Ensure “Desktop development with C++” and “Universal Windows Platform development” under Desktop &amp; Mobile component is selected under “Workloads” tab when installing as this will allow you to create a C++ project later</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D24nwKKy_jmJTw8oDbP5JQ.png" /></figure><p>Also recommended to ensure that C++/CLI support for build tools are checked under the Individual Components tab. See highlighted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*po0QlcvKIcwNHvBw1J-cmA.png" /><figcaption>From the installer, I currently have Visual Studio 2019 Professional Installed. Not the latest, but modern enough</figcaption></figure><p>As you can see, I already have Visual Studio 2019 Installed on my Windows 10 machine. That is modern enough, as would be any version after it. I will be using this version for the demo that follows. We launch Visual Studio either by pressing the Launch button provided in the Visual Studio Installer App or by the locating the program in the Windows Start Menu</p><h4>Creating a C++ Project</h4><p>Once you have Visual Studio installed and run for the first time, you’ll want to create a new C++ Project. To do this, go to the File menu -&gt; New -&gt; Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQIZMCljGacLlCm_aUtDWQ.png" /></figure><p>Don’t worry if your interface is different. If you have just installed VS, you wont have recently opened files and projects. Then navigate to “Create a new project” under Get Started</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TLLtZrU9EpR_KLBUjJxw0g.png" /></figure><p>So we will be creating a C++ project. Since VS Studio has so many choices of project templates to choose from depending on your installation, we shall simplify things by filtering our criteria. From the drop-down boxes labeled (1–3), select &gt; C++ (1), &gt; Windows (2) and &gt; Desktop (3)</p><p>I haven’t tried all the configurations yet, but I suggest going with</p><ul><li>Windows Desktop Wizard</li><li>Windows Desktop Application</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfeJ9IY8lOHoMUy90mvK8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*MuvY1tKec1grRflwiGk4jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*CIipCw-PBMZAGZZ58mvOCw.png" /><figcaption>Project configurations. We’ll first create a Console Application, then a Desktop Application (which is a Windows App). Both app types are supported in C++/CLI. There is an option to create static (.lib) and dynamic (.dll) link libraries, but I haven’t tried that option yet</figcaption></figure><p>Name your project, then click Create, leave “Application type” as “Console Application (.exe)” then click OK. If you checked the “Empty project”, then follow the next step to create a C++ source file (.cpp) Else, skip it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*WKLMPHaSGV8A4FE6CioEew.png" /></figure><p>In your solution explorer, you will notice there are no C++ source code files. So we are going to create a .cpp file with a main() function. To do this, right click on the Project → Add → New Item. Alternatively, go to Project → Add New Item from top menu bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*L-C3TgrrJMnjAifviJ_tXw.png" /></figure><p>Ensure C++ File (.cpp) is selected and we are going to name it ASimpleProject.cpp, then press Add</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*4pBAQQDD0m2hO6-UvRzE_A.png" /><figcaption>Ooops, I forgot to change it when creating the .cpp file to ASimpleProject.cpp. But we can right click on it and rename.</figcaption></figure><p>If you did not check the Empty Project option when creating the project, you will end up with a C++ file with the same name as you gave your project, ending in a .cpp file extension. All C++ source code files are “Source Files” in the project’s Solution Explorer.</p><p>Since there should be only a single .cpp file, open it and add the following code to it, clearing the previous auto generated code (if any):</p><pre>// Fig. 2.18: ASimpleProject.cpp<br>// Simple welcome program.<br><br>#include &quot;stdafx.h&quot;<br><br>#using &lt;mscorlib.dll&gt;<br><br>using namespace System;<br><br>int _tmain()<br>{<br>   Console::WriteLine( S&quot;Welcome to Visual C++ .NET!&quot; );<br><br>   return 0;<br>}<br><br>/*************************************************************************<br>* (C) Copyright 1992-2004 by Deitel &amp; Associates, Inc. and               *<br>* Pearson Education, Inc. All Rights Reserved.                           *<br>*                                                                        *<br>* DISCLAIMER: The authors and publisher of this book have used their     *<br>* best efforts in preparing the book. These efforts include the          *<br>* development, research, and testing of the theories and programs        *<br>* to determine their effectiveness. The authors and publisher make       *<br>* no warranty of any kind, expressed or implied, with regard to these    *<br>* programs or to the documentation contained in these books. The authors *<br>* and publisher shall not be liable in any event for incidental or       *<br>* consequential damages in connection with, or arising out of, the       *<br>* furnishing, performance, or use of these programs.                     *<br>*************************************************************************/</pre><p>As you may have guessed, this code was taken from the then-popular (and still is) Deitel &amp; Deitel series visual textbook for learning programming:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*bnNELa2_3UYaTc6Pqrafow.jpeg" /><figcaption><em>by Harvey M. Deitel (Author), Paul J. Deitel (Author).</em></figcaption></figure><p>Book link : <a href="https://archive.org/details/visualcnethowtop0000unse">Archive.org</a> | <a href="https://ia800103.us.archive.org/view_archive.php?archive=/0/items/ftp-ftp.prenhall.com/ftp.prenhall.com.zip&amp;file=ftp.prenhall.com%2Fpub%2Fdeitel%2Fvcppnet-htp1%2Fexamples%2Fvcppnet-htp1_examples.zip">Source code examples (.zip) Archived</a></p><p>Books on C++/CLI were written during the height of the language popularity, means it’s very unlikely to find a book written after 2010, so small changes may have happened from Managed C++’s transition to C++/CLI. More about books will be covered in the resources section below.</p><h4>Errors</h4><p>Pasting it in will almost certainly give you errors — minor tweaks will be required to allow the code to compile with newer Visual Studio versions. Depending on your version of Visual Studio, you may get the following errors. VS versions 2002–2010 worked flawlessly, now that’s behind us. But that doesn’t mean such language is no longer compatible.</p><pre>Severity       Code  Description                   Project          File                                                      Line Suppression State<br>Error (active) E0725 name must be a namespace name ModernManagedCpp H:\ModernManagedCpp\ModernManagedCpp\ModernManagedCpp.cpp 8 <br>Error (active) E1696 cannot open source file &quot;stdafx.h&quot; ModernManagedCpp H:\ModernManagedCpp\ModernManagedCpp\ModernManagedCpp.cpp 4 <br>Error (active) E1943 &quot;#using&quot; requires C++/CLI mode ModernManagedCpp H:\ModernManagedCpp\ModernManagedCpp\ModernManagedCpp.cpp 6</pre><p>Let’s fix errors E0725 and E1943 first, since the error descriptions clearly indicate that we are currently compiling in a mode that VS doesn&#39;t recognise, but its solvable.</p><h4>Switching to C++/CLI mode</h4><p>When we create any C++ type project, newer VS versions expect the programmer to use traditional ISO C++ rather than .NET code, which C++/CLI is categorised as. This means that syntax such as #using followed by specifying an IL Assembly isn’t part of the standard C++ and produces errors.</p><h4>Adding /clr support</h4><p>Under Project Property Pages → Configuration Properties → Advanced → C++/CLI Properties, we can choose from</p><ul><li>/clr:netcore (recommended)</li><li>/clr</li><li>/clr:pure</li><li>/clr:safe</li></ul><p>Click Apply, then Ok to apply changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*vXLXnb1JryBslr3SXfd0Bg.png" /></figure><h4>Cannot open source file stdafx.h</h4><p>As per SO advice, stdafx.h has been superseded with pch.h (acronym for pre-compiled header) in newer Visual Studio. If you had selected the type of project to be “Windows Desktop Application” then pch.h will automatically be included in your source file.</p><p><a href="https://stackoverflow.com/a/53932533/23163592">Error C1083: Cannot open include file: &#39;stdafx.h&#39;</a></p><h4>two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase</h4><ul><li>Project Property Pages → Configuration Properties → C/C++ → Command Line</li><li>Additional Options → Add : /Zc:twoPhase- . If other options already exists, add it after</li></ul><h4>Change _tmain() to main()</h4><ul><li>Locate the int _tmain() function and change it to read int main()</li><li>Locate any int APIENTRY _tWinMain() and change it to int APIENTRY WinMain</li></ul><h4>Finally</h4><pre>#using &lt;mscorlib.dll&gt;<br><br>using namespace System;<br><br>int main() {<br> Console::WriteLine( &quot;We are C++ .NET (C++/CLI) ready!!&quot; );<br><br> if (!System::Diagnostics::Debugger::IsAttached)  //Prevent auto-close when running from IDE<br>  Console::Read();<br><br> return 0;<br>}</pre><p>Download the project on <a href="https://github.com/dazzleworth/ModernManagedCpp">Github</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*NSNsfMVbKZlZsLKnO1OMWw.png" /><figcaption>Build Successful. Finally. although ignore the insufficient disk space warning</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*rUC-9DQJp8F5IZp_0-i-Ww.png" /><figcaption>Running in Windows 10 and above</figcaption></figure><h3>Deploying C++/CLI on ASP.NET Web Apps</h3><p>I personally haven’t had the luxury of time to try this yet but see:</p><p><a href="https://www.codeproject.com/articles/ASP-NET-with-Managed-C-">ASP.NET with Managed C++ - CodeProject</a></p><p><a href="https://www.codeproject.com/articles/ASP-NET-with-Managed-C-#comments-section">Use Managed C++ as your code-behind file for ASP.NET web app</a></p><p>Will update this article if I do actually try and encounter issues</p><h3>Books and further resources</h3><ol><li>Visual C++ . Net: How to Program by Paul J. Deitel (featured above)</li><li>Visual C++ .Net: A Managed Code Approach for Experienced Programmers (Deitel Developer Series)<br>by Lp. J.. Deitel, C. J. Courtemarche, J. C. Hamm, J. P. Liperi, T. R. Nieto, C. H. Yaeger, Harvey M. Deitel</li><li>Foundations of C++/CLI: The Visual C++ Language for .NET 3.5 (Expert’s Voice in .NET) by Gordon Hogenson</li><li>Expert Visual C++/CLI: .NET for Visual C++ Programmers (Expert’s Voice in .NET) by Marcus Heege</li><li>C++/CLI Primer: For .NET Development<br>by Vivek Ragunathan</li><li>C++/CLI in Action by Nishant Sivakumar</li></ol><h4>Conclusion</h4><p>It is highly encouraged to feel free to experiment with the different app modes you could create with C++/CLI. You’ve also seen the interoperability power and ease C++/CLI has to offer when porting over legacy C++ code to .NET</p><p>Thanks for reading. Have you used C++/CLI? Follow and let me know your thoughts of this splendid language in the comments below.</p><p>For collab, please DM me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79b6c37a088f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The State of fast-food chain desserts in Singapore and Malaysia]]></title>
            <link>https://medium.com/@dazzleworth13/the-state-of-fast-food-chain-desserts-in-singapore-and-malaysia-133379f22e89?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/133379f22e89</guid>
            <category><![CDATA[global-foodies]]></category>
            <category><![CDATA[ice-cream]]></category>
            <category><![CDATA[malaysia]]></category>
            <category><![CDATA[new-year]]></category>
            <category><![CDATA[singapore]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 04:03:24 GMT</pubDate>
            <atom:updated>2026-01-10T07:35:29.770Z</atom:updated>
            <content:encoded><![CDATA[<h3>[2025] — The State of soft-serve ice-cream in Singapore and Malaysia</h3><h4>Never thought I’d cap off the year with another foodie review. Here goes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gqGUJ3JpEf7KMRdDouoAwA.jpeg" /><figcaption>Mixed Berry yoghurt sofuto ice cream (with added toppings by me) in Family Mart, Malaysia. Introduced in 2025</figcaption></figure><p>I really love ice-cream. The soft serve kinds. and not just plain Vanilla. So I gotta admit, 2025 has been a good year for soft-serve in Malaysia and Singapore. Let’s recap. In Malaysia, <a href="https://familymart.com.my/">Family-Mart</a> did exceptionally well with these 3 flavours:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ta780e82tN536LCm5yj2MA.jpeg" /><figcaption>Sour fruit ice ream should reflect the flavour, hence yoghurt ice cream give it the tangy yoghurt taste we are all familiar with. Takes the 1st prize if i am the judge.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArNfapCixMhFYSX_HW5CcA.jpeg" /><figcaption>Miss you and hope to see you again</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhH4PN4SM9tr4ly32FYN1A.jpeg" /><figcaption>…and you, I didn’t even get to try. You came and went in a flash for only 3 weeks. Hope you’ll make a comebavk</figcaption></figure><p>Unlike in Singapore, not having <a href="https://www.hpb.gov.sg/food-beverage/healthier-choice-symbol">HPB to regulate you</a> can be a good thing as in how creative you can get with your food, and the ability to freely and rampantly produce, market, advertise and sell it. Well, ok, a double edge sword as you get a ultra health conscious nation. I personally belief in self moderation and regulation, your body, your choice(s), your responsibilities. Nevertheless, this is not to say there aren’t good soft serve flavours in Singapore. Read on…</p><h3>Singapore’s offerings</h3><p>Ask any Singaporean where to buy soft serve, and you’ll likely be told McDonalds, the most common place known to sell soft serve. Some may answer Burger King. Both are correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJnwlGjFIH7Qxyu25rDFaQ.jpeg" /><figcaption>BurgerKing Singapore also waded in with their mint softserve in the later part of 2025. Perfect pairing with Coke zero</figcaption></figure><h3>McDonalds flavours</h3><p>Besides the seasonal chocolate Hershey’s soft-serve that appears around the month of May — June, Macdonalds launched two frutti flavours, strawberry, and mango &amp; pineapple.</p><p>At Macs dessert kiosk, the strawberry soft serve became a permanent flavour fixture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TiOnEePQZ2fj111pVNxvjQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsclY4ccAqH9XSFRG9TZvw.jpeg" /><figcaption>A permanent flavour fixture at Macs dessert kiosks?</figcaption></figure><h3>Popeye’s flavours</h3><p>A new contender is <a href="https://popeyes.com.sg/">Popeyes Singapore</a>. A Texas-based fast-food chain serving fried chicken, it recently broke through the softserve scene with two flavours, caramel and chocolate hazlenut. Towards the end of 2025, during Christmas, sensing it’s popularity, it launched two variants of chocolate hazlenut softserve, with toppings and without</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN7w0rGAE2tT3nJBWzgQIw.jpeg" /></figure><h3>Is WYSIWYG really WYSIWYG?</h3><p>As a die-hard softserve fan, my expectations are more than just the sense of taste. Visual presentation matters as much. The closer the real thing is towards the advertising the better it scores. Let’s find out.</p><h3>Now comes the caveats</h3><p>Ordering the chocolate hazlenut from Popeyes din’t leave me disappointed. Using the mobile kiosk, I was presented with these options. Chocolate hazlenut soft serve in a cone and Chocolate hazlenut sundae in a cup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H06kvF4YcV56r464_9eaqQ.jpeg" /></figure><p>Now, what about if I wanted it in a cup? Well there’s an option for that too by paying an extra $1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ji8sJ1IkUSt5fDI1MEJidQ.jpeg" /></figure><p>however, cup usually means an opaque paper cup rather than transparent plastic cup, like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*cRD8iigGUWLOnOLJnzPfJw.jpeg" /></figure><p>They reserved the plastic cups for the actual sundae:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjf2kdQMGU8y-fMIu6mPGg.jpeg" /><figcaption>With the difference in pricing between cup and sundae, I decided to order the sundae (with toppings) instead</figcaption></figure><p>But does this matter? Remember I said that presentation matters, the ability to see the entire softserve in a cup in its full glory makes more WYSIWYG sense and appealing from a marketing perspective. Well, I guess you could get your way by paying the difference:</p><ul><li>hazlenut soft serve (in cone): S$1.5</li><li>hazlenut soft serve (in paper cup): S$2.50</li><li>hazlenut soft serve sundae: S$2.90</li></ul><p>You might have to order the full sundae and request for NO toppings to get what you want as per advertising poster.</p><h3>Comparison with Macs</h3><p>Macdonalds seems to do a good job with advertising their soft serve flavours as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AmpYSFCUx7hCr3lKkR2-_A.jpeg" /></figure><p>however just after launching their strawberry soft serve, they have resorted to serving soft serve in cups. Not even if you are willing to pay extra ocassionally</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*79snk6Hq2XjlnQmnMm5lDg.jpeg" /></figure><p>To be sure, its good to be environmentally friendly, but why not give me the plastic cup if I’m willing to pay extra?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQYIEhozRweZcoeQf7UpcQ.png" /></figure><p>It seems not alone in this when my elected govt representative, Mr Hoe, David remarked something similar on his <a href="https://www.instagram.com/stories/davidhoesg/">Instagram</a>.</p><h4>Other specialist Food &amp; Beverage chains with soft serve ice cream</h4><p>Okie, enough of the big boys already. Besides the popular fast-food chains, there are few niche F&amp;B outlets that have multi-flavour soft-serve on my recommendation list. Given the few outlets they have, I would consider them exotic in Singapore. I wont mention those that have many outles or only serve vanilla or plain yoghurt ice cream</p><h4>Smooy (7 outlets)</h4><p>They serve chocolate and sometimes other flavour softserve and yoghurt ice cream. They have a total of 8 public outlets over Singapore, plus an additional 4 more at educational institutions. From $5.50 pls</p><p>Check them out here: <a href="https://smooy.sg/">https://smooy.sg/</a></p><h4>Rollneys (1 outlet)</h4><p>Their only SG outlet at Vivocity, 1 Harbourfront Walk 02–133, they have a choice of vanilla or chocolate soft serve ice cream uniquely wrapped in croissants or in a cup. However, they are strong on topping ingredients with a wide selection. The are known to also have an outlet in Johor, Malaysia</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bPIe96PYt-fDmdVa.jpg" /></figure><p>Check them out here: <a href="https://sg.rollneyofficial.com/">https://sg.rollneyofficial.com/</a></p><h3>Closing remarks</h3><p>Thanks for reading and I wish 2026 will bring about more memorable and sweeter year with even new flavours. Hippie (no pun intended) New Year everyone, and stay healthy!</p><p>For collab, please DM, email or whatsapp me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133379f22e89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The best confectionery producing countries in the world]]></title>
            <link>https://medium.com/@dazzleworth13/the-best-confectionery-producing-countries-in-the-world-854c429d87da?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/854c429d87da</guid>
            <category><![CDATA[christmas-2025]]></category>
            <category><![CDATA[home-based-business]]></category>
            <category><![CDATA[retail]]></category>
            <category><![CDATA[confectionery]]></category>
            <category><![CDATA[foodies]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 04:56:25 GMT</pubDate>
            <atom:updated>2025-12-28T09:31:36.541Z</atom:updated>
            <content:encoded><![CDATA[<h4>This is my first foodie post, I’m making it completely free to read.</h4><p>Okay, so what motivated me to write this? We living in Singapore and Malaysia have a very limited subset of confectionery produced by some of the best brands (<a href="https://www.haribo.com/">Haribo</a>, <a href="https://www.instagram.com/thenaturalconfeccompany">TNCC</a>, <a href="https://www.trolli.com/">Trolli</a>) in the world in our supermarkets. That’s not to say such brands don’t exists, but the same variation of the brands are “recycled” in our supermarket shelves which makes life boring. In this post, I also describe how I hope to change that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*zDJ7fFHgI4TKy9lOoN1Atg.jpeg" /><figcaption>The world selection is larger than we thought</figcaption></figure><h3>Import initiatives</h3><p>Singapore and Malaysia supermarkets definitely do seasonal imports. They have one big problem though. Retail prices are marked up and passed on to consumers. Its an added insult to injury as such imports are a subset of what is offered out there; the choice isn’t necessarily much larger, more expensive and for a limited time only.</p><p>Specialty stores like “<a href="https://candyempire.com.sg/">Candy Empire</a>” and “<a href="https://www.thesgfrstore.com/">The SGFR store</a>” do exist as businesses in Singapore, but like seasonal imports they also suffer from the same fate as you aren’t able to select the entire available range and being “private” business the mark-up can be much higher than supermarkets due to prime area rentals and overheads. You will never be able to buy these sweets and snacks close to supermarket prices at Woolworths in Australia for instance. A number of “home based” business do exists on platforms such as Shoppee and Lazada, availability and responsiveness of such sellers vary.</p><h3>Exploring the solution</h3><p>Being frustrated with the situation is a good thing if it spurs us to develop alternatives. Its not our intention to undercut the existing businesses, nor question existing business on their practice for/not importing more varieties, but we seek a solution where we bring what’s available abroad to our shores. Both Singaporeans and Malaysians do travel alot, regardless for work or leisure.</p><h3>Chat-based marketplace</h3><p>Launched during the year-end festivities of 2025/2026 where there’s demand for goods is at its peak, this is a WhatsApp chat group to facilitate the cross border selling and distribution of confectionery in Singapore and Malaysia for people who travel regularly. We intend to keep it going from this point forward, regardless. While its targetted to bring goods towards people living in Singapore and Malaysia, we welcome people living in other countries too who would like to gain access to confectionery from the top 10 producing countries, if you follow rules and guidelines</p><p>Everyone and anyone who is ok with making their public mobile number public is welcome to join. <strong>We have six simple rules to follow but if you are agreeable, we hope to see you on board.</strong></p><p>Do encourage your family and friends to join so that you can coordinate your wish list when you go travelling. For now we aim to run this group in a family-knit like manner with limited members</p><figure><img alt="WhatsApp 3d Icon Concept. Dark Mode Style. Write me: alexanderbemore@gmail.com, if you need 3D visuals for your products 🖤" src="https://cdn-images-1.medium.com/max/1024/0*U4U37YCju1LVso8w" /><figcaption>Join our WA group at the link below (Photo by <a href="https://unsplash.com/@alexbemore?utm_source=medium&amp;utm_medium=referral">Alexander Shatov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>)</figcaption></figure><p>Join us: <a href="https://chat.whatsapp.com/L7E384aRicDIPQu5Dn5GMn?mode=hqrt1">Worldwide Confectionery Buy and Sell (these are the best producing countries)</a> (WhatsApp required)</p><h3>Existing store owners</h3><p>Already have a similar business on Shoppee, Lazada or Carousell? No problem. In future , we may accept donations to help you advertise by pinning a link to your store with every donation, etc. The possibilities to collaborate are endless!</p><figure><img alt="3D Telegram Icon" src="https://cdn-images-1.medium.com/max/1024/0*ZGugUPZSiYBe909t" /><figcaption>Coming soon. (Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=medium&amp;utm_medium=referral">Rubaitul Azad</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>)</figcaption></figure><p>We plan to set-up a Telegram group in the near future for those who want to join <strong>without</strong> using their mobile phone numbers.</p><h3>The best confectionery producing countries in the world</h3><p>And now, for the best part, do you know what quality confectionery is? Well, basically, if the manufacturer originates from the following countries below, then they are the best in the world. Its based our personal observations and opinions, so lets agree to disagree. Here goes:</p><ol><li>Germany 🇩🇪</li><li>Turkyie 🇹🇷</li><li>Mexico 🇲🇽</li><li>United Kingdom 🇬🇧</li><li>Netherlands 🇳🇱</li><li>Canada 🇨🇦</li><li>USA 🇺🇲</li><li>Japan 🇯🇵</li><li>Australia 🇭🇲</li><li>New Zealand 🇳🇿</li></ol><p>No doubt some of the producing companies from the above countries have shifted the factory operations to China 🇨🇳 (or Taiwan 🇹🇼), quality and standard remains maintained, while reduction in costs for the consumer. Manufacturers usually state the country of origin in the packaging, so do look out for that if its your concern. Nevertheless, the overseas selection is bigger that what you’ll ever find in Singapore and Malaysia so your online window shopping activities or visits to the local grocer and supermarket while you are on an overseas trip is definitely not a waste of time</p><h3>Conclusion</h3><p>Getting genuine and quality sweet and snacks from the world to to us may be challenging due to negative perceptions with regards to the sugar content of such snacks as well as govt driven “healthy campaigns” eg. “HPB HEALTHIER CHOICE” (Please note these are govt initiatives, not bound by law, and as an individual consumer you still have the right to determine acceptable limits of dietary intake in relation to your genetics, lifestyle and state of health), but it shouldn’t be impossible.</p><p>Thanks for reading and we hope you can be proud owning part of this initiative. We take this opportunity to wish you the best of an ending 2025 and a Happy New Year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=854c429d87da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Relative-to-absolute path in Jython]]></title>
            <link>https://medium.com/@dazzleworth13/relative-to-absolute-path-in-jython-37ac2347319f?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/37ac2347319f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[jython]]></category>
            <category><![CDATA[ghidra]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 01:26:14 GMT</pubDate>
            <atom:updated>2026-05-06T16:41:45.051Z</atom:updated>
            <content:encoded><![CDATA[<p>A handy polygot guide to solving path problems, particularly useful on Windows systems</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*GffS3QcRdE7MyEyI70cvpg.png" /></figure><p>I simply love Jython. It combines the power of scripting (Python) with the power of a full-fledged programming framework (Java). Who says we can’t have the best of both worlds?</p><h4>Where am I?</h4><p>One of the most important things about the Python API is the environment. Knowing the script’s location under different OSes like Linux and Windows. For that, we use <strong>os.path.dirname</strong>, <strong>os.path.pardir</strong> and the <strong>__file__</strong> macro to get a PNG image for Java JOptionPane’s messageDialog. I then use Python’s print function for debugging purposes to ensure the correct absolute path being built. Spoilers: I got a little help from StackOverflow¹, and you can too. The simple code example below demonstrates it best:</p><pre>import os<br>from javax.swing import JOptionPane, ImageIcon<br><br>ico_rel_path=&quot;data/img/logo.64x64.png&quot;<br>abspath = os.path.abspath(os.path.join(os.path.join(os.path.dirname(__file__), os.path.pardir), ico_rel_path))<br>icon = ImageIcon(abspath)<br>JOptionPane.showMessageDialog(None, &quot;I like easter eggs&quot;, &quot;Script Test&quot;, JOptionPane.INFORMATION_MESSAGE, icon)<br>print abspath &#39;For debugging</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*GffS3QcRdE7MyEyI70cvpg.png" /></figure><p>You can either run this from a Ghidra environment (which has Jython puilt in) or standalone Jython (I did this from Ghidra):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*3_rfBZtb0TvYh-pyyMBhNA.png" /><figcaption>The Script Manager feature in Ghidra</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*tAVZyqjrV7Wd21FM6-kVug.png" /><figcaption>The full abspath printed in debugger mode</figcaption></figure><h4>(UPDATED for 2026) Enter Artificial Intelligence</h4><p>These days Python is heavily used in data analytics, machine learning and artificial intelligence. Popular machine learning frameworks include NumPy, SciPy, scikit-learn, Pandas and mathplotlib. So why not run them from Jython, especially if you have existing software to integrate? <strong>It’s not so easy</strong>. Many of these libraries have native C bindings of which is incompatible with Jython. Also many of such ML/PL libraries are built on top of each other. So, unfortunately, we’ll need to look beyond legacy Jython to use more advanced libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*If_-GDk-qhESK9GNnG5ImQ.png" /></figure><h4>Jep — Java Embedded Python</h4><p>Enter <a href="http://ninia.github.io/jep/">JEP</a>, a polyglot solution that combines Java, C/C++ (via JNI and CPython) and Python. We’ll start of by creating the GUI in Java. Here, we use Java Swing, which is a pure Java UI implementation. There are alternatives, like JavaFX or SWT, but we will stick with Swing for now:</p><pre>JButton addBtn = new JButton(&quot;Process Data File&quot;);<br><br>        addBtn.addActionListener(e -&gt; {<br><br> JFileChooser fileChooser = new JFileChooser();<br><br>        // Optional: Set the initial directory (e.g., user&#39;s home folder)<br>        fileChooser.setCurrentDirectory(new File(System.getProperty(&quot;user.home&quot;)));<br><br> fileChooser.setFileFilter(new FileNameExtensionFilter(&quot;Text Files&quot;, &quot;txt&quot;, &quot;csv&quot;));<br><br> if(fileChooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {<br><br> byte[] grphData = MLOpsKit.runMLOps(fileChooser.getSelectedFile().getAbsolutePath());<br><br> graphpanel.add(new JLabel(new ImageIcon(grphData)));<br><br>        // 2. Refresh the layout<br>        graphpanel.revalidate();<br>            <br>        // 3. Redraw the panel<br>        graphpanel.repaint();<br> }<br>        });<br></pre><p>Then add it to your Java Swing GUI:</p><pre>ctrlpanel.add(addBtn);          //I use a JPanel to keep thing organised<br>...........<br>frame.add(ctrlpanel, BorderLayout.SOUTH);      //JFrame frame<br>...........</pre><p>There are many ways to configure this, but my design is to attach it as a event to a JButton. You can use my example if you wish, link to my code at my Github.</p><h4>Prediction model example</h4><p>We will start with an example from an older Machine Learning textbook (Lee, W.-M. (2019). <a href="https://onlinelibrary.wiley.com/doi/book/10.1002/9781119557500"><em>Python machine learning</em></a>. Wiley, p. 135) that does a simple graph prediction by linear/polynomial regression. Here’s the Python Machine Learning workload (slightly updated to run on newer matplotlib, pandas and numpy versions):</p><pre>import matplotlib.pyplot as plt<br>import pandas as pd<br>import numpy as np<br>import io<br>from sklearn.linear_model import LinearRegression<br>df = pd.read_csv(&#39;polynomial.csv&#39;)      # In Java, we let user select file<br>plt.scatter(df.x, df.y)<br>model = LinearRegression()<br>x = df.x.values[0:6, np.newaxis]<br>y = df.y.values[0:6, np.newaxis]<br>model.fit(x,y)<br>y_extrp = model.predict(x)<br>plt.scatter(x, y, s=10, color=&#39;b&#39;)<br>plt.plot(x, y_extrp, color=&#39;r&#39;)<br>buf = io.BytesIO()<br>plt.savefig(buf, format=&#39;png&#39;)<br>image_bytes = buf.getvalue()            #taget image bytes to be read by Java</pre><p>This is used to generate and plot the following graph below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*D7TgN3z0JGpEVWJeQMXDUw.png" /></figure><p>To execute our Python code in Java, JEP, provides an API through the Jep obj to call the code in Python. We can call <a href="https://ninia.github.io/jep/javadoc/4.3/jep/Jep.html#exec-java.lang.String-">exec</a>() method for each line of the code in Listing 4 (above). Are there more elegant ways? Sure, we can call <a href="https://ninia.github.io/jep/javadoc/4.3/jep/Jep.html#runScript-java.lang.String-">runScript</a>(path_to_file) method for a static .py file and pass it the location. We can also use a resources placeholder file to provide a template with variables that can be programatically filled in (for example :import %s) and then call <a href="https://ninia.github.io/jep/javadoc/4.3/jep/Jep.html#eval-java.lang.String-">eval</a>(&quot;entire_listing4block_as_string&quot;) . Please note that this requires interactive mode == false. This is a programming paradigm called “separation of concerns (SoC)”</p><pre>package dazzleworth;<br><br>import jep.Jep;<br>import jep.SharedInterpreter;<br>import jep.NDArray;<br>import jep.JepException;<br><br>public class MLOpsKit {<br><br> public static byte[] runMLOps(String path) {<br>  Object result = null;<br><br>  try (Jep interp = new SharedInterpreter()) {<br>   interp.exec(&quot;import matplotlib.pyplot as plt&quot;);<br>   interp.exec(&quot;import pandas as pd&quot;);<br>   interp.exec(&quot;import numpy as np&quot;);<br>   interp.exec(&quot;import io&quot;);<br>   interp.exec(&quot;from sklearn.linear_model import LinearRegression&quot;);<br>   interp.set(&quot;fullPath&quot;, path);<br>   interp.exec(&quot;df = pd.read_csv(fullPath)&quot;);<br>   interp.exec(&quot;plt.scatter(df.x, df.y)&quot;);<br>   interp.exec(&quot;model = LinearRegression()&quot;);<br>   interp.exec(&quot;x = df.x.values[0:6, np.newaxis]&quot;);<br>   interp.exec(&quot;y = df.y.values[0:6, np.newaxis]&quot;);<br>   interp.exec(&quot;model.fit(x,y)&quot;);<br>   interp.exec(&quot;y_extrp = model.predict(x)&quot;);<br>   interp.exec(&quot;plt.scatter(x, y, s=10, color=&#39;b&#39;)&quot;);<br>   interp.exec(&quot;plt.plot(x, y_extrp, color=&#39;r&#39;)&quot;);<br>   interp.exec(&quot;buf = io.BytesIO()&quot;);<br>   interp.exec(&quot;plt.savefig(buf, format=&#39;png&#39;)&quot;);<br>   interp.exec(&quot;image_bytes = buf.getvalue()&quot;);<br>   result = interp.getValue(&quot;image_bytes&quot;, byte[].class);<br>  } catch(Exception e) {<br>   GraphWindow.displayErrPmt(e.getMessage());<br>  }<br><br>  return (byte[]) result;<br> }<br>}</pre><p>Here we read, create, plot and predict this graph using Python ML tools. We then generate the graph image and store the raw image data in a byte array in Python. To get it into Java, we need to de-serialize/serialize the bytes representing this image using the PyPlot framework and hand the byte array over to Java</p><p>The second approach we could use is to use PyPlot savefig() to save the graph as a graphic file, then open the file from within Java side. This approach is less efficient and requires filesystem ‘write’ permissions. Thankfully, we won’t need that.</p><h4>Software Engineering Notes</h4><p>To conclude that while ML frameworks exists in other languages, like Weka, DL4J, ONNX for Java and ML.NET for C#, Python remains by far, the most popular, flexible and up-to-date AI/ML frameworks. More importantly its possible to harness their power intergrate them into your existing apps and pipelines without learning an entire new language.</p><p>Oh, lastly, did I share with you this part where I catch Python ModuleNotFoundErrors and prompt the user to install the relevant module with pip install:</p><pre> public static void displayErrPmt(String err) {<br> String[] tokens = err.split(&quot;:&quot;);<br><br>   if(tokens[0].equals(&quot;&lt;class &#39;ModuleNotFoundError&#39;&gt;&quot;)) {<br>      tokens[1] = tokens[1].strip();<br>      String t = &quot;No module named &#39;&quot;;<br>      t = tokens[1].substring(tokens[1].indexOf(t) + t.length(), tokens[1].lastIndexOf(&quot;&#39;&quot;));<br>      JOptionPane.showMessageDialog(gwInstance, &quot;Required Module &quot; +t+ &quot; is not installed. You can install it by running \n\npip install &quot; +t, &quot;Error&quot;, JOptionPane.WARNING_MESSAGE);<br> }<br> else<br>  JOptionPane.showMessageDialog(gwInstance, &quot;Unknown Python error occured. Check Python environment.&quot;, &quot;Error&quot;, JOptionPane.ERROR_MESSAGE);<br>}</pre><p>To be continued….I’ll update this list as I go along</p><p>[1] <a href="https://stackoverflow.com/questions/21005822/what-does-os-path-abspathos-path-joinos-path-dirname-file-os-path-pardir">https://stackoverflow.com/questions/21005822/what-does-os-path-abspathos-path-joinos-path-dirname-file-os-path-pardir</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37ac2347319f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 4 countries for Asian shirtless hunks on social media]]></title>
            <link>https://medium.com/@dazzleworth13/top-4-countries-for-asian-shirtless-hunks-on-social-media-e4080607f1b7?source=rss-d63ef7a50f36------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4080607f1b7</guid>
            <category><![CDATA[society-and-culture]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[singapore]]></category>
            <category><![CDATA[fashion]]></category>
            <category><![CDATA[asia]]></category>
            <dc:creator><![CDATA[  Dazzleworth]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 06:19:45 GMT</pubDate>
            <atom:updated>2026-01-19T02:38:52.845Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌈 Top 4 countries for Asian shirtless hunks on social media (LGBT themes)</h3><h4>Want a hint on generally liberal dressing countries in South-East Asia? Read on…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*1QrxQfglNrJSo2orrAuJSQ.jpeg" /><figcaption>Photo taken from Instamen, a popular facebook page for hunk pictures and videos, link below</figcaption></figure><p><a href="https://www.facebook.com/Instamen">Log in or sign up to view</a></p><p>Here’s the link if you’d like to read this article for free (and connect with me) on Facebook:</p><p><a href="https://www.facebook.com/brendchung/posts/pfbid0u34zgeQYi1aNrUjTEbQXgLaM7h2sCtFiXp5271kvBeyVwwdUhvjUgcZ6f5rzfvUTl">Brendan Chong</a></p><p>Before I reveal, I would like to dedicate this article to a guide to being shirtless in Singapore.</p><h4>Singapore laws on liberal dressing</h4><p>Firstly, there is no explicit law on being shirtless in public, and AFAIK while being shirtless may draw the authorities attention for further checks, there has been no case of someone being detained or prosecuted solely for being shirtless in public. This video below highlights the legal status of being shirtless in Singapore, and why enforcing any ambiguous laws are difficult:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FN5_8IVfvCYo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DN5_8IVfvCYo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FN5_8IVfvCYo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7eed7c5d5f3f1e82f071a1b8f4f7226/href">https://medium.com/media/f7eed7c5d5f3f1e82f071a1b8f4f7226/href</a></iframe><h4>Government&#39;s stance on liberal dressing</h4><p>The government has generally been silent regarding supporting or disapproving a formal or casual dress-code for its non-frontline public officers. In fact, the Basic Military Training Centre (BMTC) school of the Singapore Armed Forces (SAF) requires that its trainees perform physical fitness and strength conditioning shirtless during peacetime so as to promote body positivity and avoid heat-related injuries amongst recruits:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9YSgk96Bz_w2dCEy9cZmw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3kqPaVb1uVdKfhUPX5KcA.jpeg" /></figure><p>Initially the BMTC school published ample images of trainee cohorts doing physical training shirtless. But when <a href="https://www.reddit.com/r/NationalServiceSG/comments/qx2v5b/bmt_tekong_physical_training_shirtless/">discussions regarding that sprang up online</a>, their social media channels spotted a noticeable decline on such photos use during training publicity. However, that doesn’t imply training procedures have changed, only the publicity of it. You can visit the SAF BMTC official social media pages here:</p><ul><li>Facebook: <a href="https://www.facebook.com/BMTCSAF/">https://www.facebook.com/BMTCSAF/</a></li><li>Instagram: <a href="https://www.instagram.com/saf.bmtc">https://www.instagram.com/saf.bmtc</a></li></ul><p>Where the military uniform is needed (aka No . 4), its simulated training in air-conditioned theatres or during non-sun intensity peak times</p><h4>Public opinions on liberal dressing</h4><p>So what does the Singaporean public think of being shirtless in public? Let’s explore. First off, if you spend a day in Singapore, you’ll notice the high number of days the weather is menacingly hot and yes, humid too. You do not need to actually be out in the sun to actually feel the heat and humidity. The humidity persists in all spaces where there is a lack of air-conditioning.</p><p>However, what’s surprising is how the people living in Singapore cope with it. You would actually find the locals dressed in the same way they would in a temperate country. Doesn’t the humidity affect them? What this means is you are less likely to find a man shirtless in public (unless just before, during or after exercise) or performing paid work shirtless, even for laborious tasks.</p><p>So what would happen if you tried to be different? Well, for a start Singapore seems to encourage conformity and that would not be a promising sign. If you could simply search the web for “shirtless in Singapore”, responses are varied but many commenters point out that people do routinely exercise and run shirtless in Singapore. Another school of thought is that your body need to be in shape to be otherwise it may be offensive to people here.</p><p>So bottom-line is, while its not the social norm, there’s no general law that forbids it — some may argue the law is vaguely worded, but until laws change, we shouldn’t allow a “vague” law to disrupt our daily lives.</p><h4>When the lines blur…</h4><p>So by now, you can gather that most of the Singaporean population would draw a line between shirtless during exercise and and home and not when not exercising and in public with the former being not considered socially acceptable , and the later, not. To be sure, I think its universally agreed that shirtless is an inappropriate dress code during certain events (eg. high level business, state/government and solemn ceremonies)</p><p>However, for the commoners like us, it may not be as easy as it seems as there appears to be very grey areas on where else going shirtless is acceptable. Some also draw the line between doing vigorous activity as a job vs exercise and conclude that is ok to perform the latter without a shirt, while the former not (more on that latter in the next section) However, this erroneous thinking is dangerous. What if the job demands just as vigorous activity as a good workout in a hot, non-airconditioned environment? What if I’m doing food delivery on just a bicycle in the hot and humid weather? What if I’m a swimming instructor who spends the whole day in the swimming pool teaching swimmers?</p><h4>Do people care?</h4><p>The people who may report you would act based on what they perceive as morally wrong, not legally wrong. As mentioned earlier, that action of people reporting you may draw attention of the authorities to subject you to further checks from legal authorities, but if you are found to be lawful in other aspects, you have absolutely nothing to worry about! With that out of the way, lets turn our attention towards progressive in initiatives to normalise this and allow freedom of body expression</p><h4>Body Positive initiatives in Singapore</h4><p>Rock The Naked Truth (RTNT) — This movement was founded by Cheryl Tay who suffered from eating disorders and body image problem for decades. Its an annual event.</p><blockquote>I know firsthand how difficult it is to take your shirt off in public, let alone run without your shirt. That’s why I applaud every participant who found the courage to show up on an early Sunday morning to be a part of this movement and take their shirts off for the 5km run.</blockquote><blockquote>I had people coming up to me or messaging me on Instagram that this was the first time they are running shirtless, and that they were nervous, but they felt better once they saw they were in the good company of bodies of all shapes and sizes. Remember that you’re never alone!</blockquote><blockquote>Although I have recovered from my eating disorders that plagued me for over a decade, I still struggle from time to time with my body. Not sure if everyone here is aware, but I had to find the courage to be in my sports bra in front of so many people because it’s not something I usually do!</blockquote><blockquote>I often tell others that your relationship with your body image is a lifelong journey that you need to consistently put effort into. Life is too short, so don’t hold yourself back from chasing your dreams, love and live fiercely and surround yourself with positive people that lift you up.</blockquote><blockquote>Thankfully, the weather was bright and sunny, complete with blue skies and clouds. We ran across the iconic Tanjong Rhu bridge, headed in the direction of Marina Barrage, with scenic views of the Kallang River.</blockquote><blockquote>We had young children run with us and some participants even ran with their kids in prams. One participant brought her dog for the run too! Hopefully, this meaningful run was a great start to the year for all who came.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHadnyloC-cjxxnfrtjgwA.jpeg" /></figure><p>Hyrox Singapore — This CrossFit like training circuit has a standardised, global competition format, held an event in Singapore recently, with high levels of local and foreign participation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*zXEfgREaWsVMFPwD-4to9Q.jpeg" /></figure><h4>Working Shirtless in a Job</h4><p>Okay, so when we talked about being shirtless in Singapore, it usually meant in a leisure context (eg non-work, and during exercise), but what if we could take it a notch up and be shirtless during work? To be sure such jobs do exists. Some examples are like the fitness training centre for military recruits (as elaborated above), carpentry and home renovation, gardening and cleaning.</p><p>For a start, we should recognise that not every male will want to be shirtless and have a shirt on. That’s okay, but we shouldn’t harass those who opt to do so.</p><p>So where does that leave us with? Firstly, no I’m not trying to draw a link between the LGBT cause and being shirtless. Regardless of which end of your believes lie, there is no such relevance to sexual orientation. But there’s certainly a link between blindly following social norms and being a catalysts for change. Finally, in all cases, there is appropriateness of going shirtless, the more places its acceptable, the more open and tolerant the society is. I also casually pointed out the link between a country having more shirtless influences and public figures and the openness of their society. Thanks for reading.</p><p>Now, for the article:</p><p>Top 4 countries for Asian shirtless hunks on social media:</p><p>Thailand 🇹🇭 <br>Vietnam 🇻🇳 <br>Taiwan 🇹🇼 <br>Philippines 🇵🇭</p><p>Middle Tier:</p><p>China 🇨🇳 <br>Hong Kong 🇭🇰 <br>South Korea 🇰🇷 <br>Japan 🇯🇵</p><p>Bottom of the list:</p><p>Malaysia 🇲🇾 <br>Indonesia 🇮🇩 <br>Singapore 🇸🇬</p><p>To be fair, the bottom countries do also have shirtless public figures (note that they are not all LGBT) eg. <a href="https://www.facebook.com/jordanyeohfitness?__cft__[0]=AZUjgxM3Um-u1e8YVfq84MbX_SZYKr6RQGaomVxV4mnDHn7lQelzINMxVS-CO_Ddh4GjDtkowkWsTW4HxYB23f5HzOK23Lf6CHMfuGhSwankW8bVRM9eBg2fri5X5p8gYRhfnE7Hhe6Wh4fRSWjFIaZD&amp;__tn__=-]K-R">Jordan Yeoh</a> from Malaysia 🇲🇾 , <a href="https://www.facebook.com/jason.peikun?__cft__[0]=AZUjgxM3Um-u1e8YVfq84MbX_SZYKr6RQGaomVxV4mnDHn7lQelzINMxVS-CO_Ddh4GjDtkowkWsTW4HxYB23f5HzOK23Lf6CHMfuGhSwankW8bVRM9eBg2fri5X5p8gYRhfnE7Hhe6Wh4fRSWjFIaZD&amp;__tn__=-]K-R">Jason Chee</a> from Singapore 🇸🇬 and <a href="https://www.facebook.com/profile.php?id=100058186984320&amp;__cft__[0]=AZUjgxM3Um-u1e8YVfq84MbX_SZYKr6RQGaomVxV4mnDHn7lQelzINMxVS-CO_Ddh4GjDtkowkWsTW4HxYB23f5HzOK23Lf6CHMfuGhSwankW8bVRM9eBg2fri5X5p8gYRhfnE7Hhe6Wh4fRSWjFIaZD&amp;__tn__=-]K-R">Andhi Pikapi</a> from Indonesia 🇮🇩</p><p>But why is Singapore, a country that’s more secular than its Muslim neighbours, that not too long ago, repealed s. 377A , and that allows the annual <a href="https://www.facebook.com/pinkdotsg?__cft__[0]=AZUjgxM3Um-u1e8YVfq84MbX_SZYKr6RQGaomVxV4mnDHn7lQelzINMxVS-CO_Ddh4GjDtkowkWsTW4HxYB23f5HzOK23Lf6CHMfuGhSwankW8bVRM9eBg2fri5X5p8gYRhfnE7Hhe6Wh4fRSWjFIaZD&amp;__tn__=-]K-R">Pink Dot SG</a> at the bottom of the list ?</p><p>Because in reality, we could be in the list but in appears practice the government is playing the bargaining game between the conservatives and liberals as a political tool.</p><p>A recent example of backward steps was the <a href="https://regardless.sg/deryne-sim-is-not-a-threat-to-conservative-values-for-now/">dropping of potential PAP pro-LGBT candidate Deryne Sim</a> during the recent GE 2025. The People’s Action Party (PAP) has been the dominant incumbent party since Singapore’s founding. Granted, we may be in the same league as South Korea and Japan (US bloc leaning but conservative and not approving of LGBT marriage) but these countries have citizens who dare to speak out and be different. They might become the next countries with marriage equality faster than we think. For the average Singaporean local, they are considered meek and non-chalant</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4080607f1b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>