<?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 Mohammed Zaheeruddin Malick on Medium]]></title>
        <description><![CDATA[Stories by Mohammed Zaheeruddin Malick on Medium]]></description>
        <link>https://medium.com/@mohammedzu?source=rss-e6f95e6192d5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DetjBQsSTWX0iCyc.</url>
            <title>Stories by Mohammed Zaheeruddin Malick on Medium</title>
            <link>https://medium.com/@mohammedzu?source=rss-e6f95e6192d5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:16:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammedzu/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[Father’s day hacking: xPlatform Edge CV with Flutter + TensorFlow Lite + MobileNet]]></title>
            <link>https://mohammedzu.medium.com/flutterhacks-xplatform-edge-cv-with-flutter-tensorflow-lite-mobilenet-on-fathers-day-2b3b791ef2d1?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b3b791ef2d1</guid>
            <category><![CDATA[fathers-day]]></category>
            <category><![CDATA[object-recognition]]></category>
            <category><![CDATA[tensorflow-lite]]></category>
            <category><![CDATA[mobilenet]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 02:22:38 GMT</pubDate>
            <atom:updated>2022-06-20T06:47:02.637Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s the father’s day weekend, Happy Father’s day to all…</p><p>I had a great start to the day; my babies surprised me with a nice breakfast, thoughtful gift and cards :) feeling so blessed… and it’s been quite a while since i got some good dose of hacking dopamine — so :) thought of hacking a random idea and hope to inspire my babies to be builders this Father’s day.</p><p><strong>First</strong> need a random idea… My baby wants an app which can identify all kinds of birds perching in our yard… hmm… that’d require some darwinistic level of model training, so wanted to start small first, perhaps identify fruits and veggies… as baby steps.</p><p>My tool of choice is flutter, It still has a long way to go for mainstream adoption but it’s been growing leaps and bounds, attracting an army of app developers and fostering a strong community…</p><p>Lets get started — what do we need <strong>first?</strong> flutter setup, thats a standard op: <a href="https://docs.flutter.dev/get-started/install/macos">https://docs.flutter.dev/get-started/install/macos</a></p><p><strong>Second</strong>: we need a way to make Edge CV work, turns out Tensor flow has a lite version for mobile and some googling lead me to Tensorflow Lite “tflite”: <a href="https://www.tensorflow.org/lite">https://www.tensorflow.org/lite</a></p><p><strong>Third</strong>: Does flutter support tflite bindings? again google to the rescue, turns out there is a binding, although badly outdated, so had to struggle a bit to get it to work, but it worked nevertheless <a href="https://github.com/shaqian/flutter_tflite">https://github.com/shaqian/flutter_tflite</a></p><p><strong>Fourth</strong>: Now, we need a pre-trained model for getting started fast, googling again and after some filtering found a TFlite model trained on imagenet dataset: <a href="https://github.com/tensorflow/models/tree/master/research/slim">https://github.com/tensorflow/models/tree/master/research/slim</a> (search for ‘mobilenet_v1_1.0_224’)</p><p><strong>Fifth:</strong> Let the hacking begin…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*BzqmRGVamv587vM5PoTF2w.gif" /></figure><p>Keeping it simple, let’s build a simple scaffold based interface, nothing fancy, initialize the model, provide a way for the user to select an image from the gallery using an action button and image picker, run inference and display the results…</p><p>Code is straight forward, wanted to keep it within 150 lines… best written code is always self-documenting…</p><pre>import &#39;dart:async&#39;;<br>import &#39;dart:io&#39;;<br><br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br>import &#39;package:image_picker/image_picker.dart&#39;;<br>import &#39;package:tflite_maven/tflite.dart&#39;;<br><br>void main() =&gt; runApp(FlutterEdgeCVApp());<br><br>class FlutterEdgeCVApp extends StatelessWidget {<strong> </strong><br>  @override<br>  Widget build(BuildContext <em>context</em>) =&gt;<br>      MaterialApp(<em>home</em>: FlutterEgdeCVAppWidget());<br>} <strong>// Boiler plate</strong><br><br>class FlutterEgdeCVAppWidget extends StatefulWidget {<br>  @override<br>  State&lt;FlutterEgdeCVAppWidget&gt; createState() =&gt; _FlutterEgdeCVAppWidgetState();<br>} <strong>// Boiler plate</strong><br><br>class _FlutterEgdeCVAppWidgetState extends State&lt;FlutterEgdeCVAppWidget&gt; {<br>  XFile? selectedImage;<br>  List inference = [];<br>  bool modelBusy = false;</pre><pre>  @override<br>  void initState() {<br>    super.initState();<br>    modelBusy = true;<br>    loadModelMobilenet().then((<em>_</em>) {<br>      if (mounted) setState(() =&gt; modelBusy = false);<br>    }); <strong>// Load Mobilnet model</strong><br>  }</pre><pre>  Future selectImageAndInfer() async {<br>    var image = await ImagePicker().pickImage(<br>                          <em>source</em>: ImageSource.gallery);<br>    if (image == null) return;<br>    if (mounted) setState(() =&gt; modelBusy = true);<br>    inferObject(image);<br>  } <strong>// Select image using image picker from gallery</strong><br><br>  Future inferObject(XFile? <em>image</em>) async {<br>    if (<em>image </em>== null) return;<br>    recognizeImage(<em>image</em>).then((<em>_</em>) =&gt; setState(() {<br>          selectedImage = <em>image</em>;<br>          modelBusy = false;<br>        }));<br>  } <strong>// Pass selected image to model in memory for inferencing</strong><br><br>  Future loadModelMobilenet() async {<br>    Tflite.<em>close</em>();<br>    try {<br>      Tflite.<em>loadModel</em>(<br>              <em>model</em>: &quot;assets/mobilenet_v1_1.0_224.tflite&quot;,<br>              <em>labels</em>: &quot;assets/mobilenet_v1_1.0_224.txt&quot;,<br>              <em>useGpuDelegate</em>: true)<br>          .then((<em>_result</em>) {<br>        modelBusy = false;<br>        print(&quot;Loading Mobilenet v1 Model: $<em>_result</em>&quot;);<br>      }); <strong>// Load Mobilnet model, metadata and label</strong><br>    } on PlatformException {<br>      print(&#39;Failed to load Mobilenet v1 Model&#39;);<br>    }<br>  }<br><br>  Future recognizeImage(XFile <em>image</em>) async {<br>    int startTime = DateTime.now().millisecondsSinceEpoch;<br>    final inferenceResults = await Tflite.<em>runModelOnImage</em>(<br>        <em>path</em>: <em>image</em>.path,<br>        <em>numResults</em>: 6,<br>        <em>threshold</em>: 0.05,<br>        <em>imageMean</em>: 127.5,<br>        <em>imageStd</em>: 127.5); <strong>// Run inferencing on picture</strong><br>    setState(() =&gt; inference = inferenceResults ?? []);<br>    int endTime = DateTime.now().millisecondsSinceEpoch;<br>    print(&quot;Done in ${endTime - startTime}ms&quot;);<br>  }<br><br>  @override<br>  Widget build(BuildContext <em>context</em>) {<br>    final List&lt;Widget&gt; listViewItems = [];<br><br>    listViewItems.add(selectedImage != null<br>        ? Padding(<br>            <em>padding</em>: const EdgeInsets.all(8.0),<br>            <em>child</em>:<br>                Image.file(File.fromUri(<br>                    Uri.file(selectedImage?.path ?? &quot;&quot;))))<br>        : Padding(<br>            <em>padding</em>: const EdgeInsets.all(8.0),<br>            <em>child</em>: Text(&quot;Select an image&quot;,<br>                <em>textAlign</em>: TextAlign.center, <br>                <em>style</em>: TextStyle(<em>fontSize</em>: 20)))); <strong>// UX Layout</strong><br><br>    _tableCell({<em>text</em>, TextAlign <em>align </em>= TextAlign.end}) =&gt;    <br>      TableCell(<br>        <em>child</em>: Padding(<br>            <em>padding</em>: const EdgeInsets.all(2.0),<br>            <em>child</em>: Text(<em>text</em>,<br>                <em>textAlign</em>: <em>align</em>,<br>                <em>style</em>: TextStyle(<em>color</em>: Colors.<em>black</em>, <br>                <em>fontSize</em>: 21.0))));<br><br>    listViewItems.add(Table(<br>      <em>children</em>: inference.map((<em>_</em>) { <br>        print(<em>_</em>);<br>        return TableRow(<br>          <em>children</em>: [<br>            _tableCell(<em>text</em>: &quot;${<em>_</em>[&quot;label&quot;]} :&quot;),<br>            _tableCell(<br>                <em>text</em>: <br>                  &quot;${(<em>_</em>[&quot;confidence&quot;] * 100).toStringAsFixed(2)}%&quot;,<br>                <em>align</em>: TextAlign.start)<br>          ],<br>        );<br>      }).toList(), <strong>// Tabulate result classes and confidence scores</strong><br>    ));<br><br>    return Scaffold( <strong>// Flutter scaffold boilerplate</strong><br>      <em>appBar</em>: AppBar(<br>          <em>title</em>: const Text(&#39;Flutter + TensorFlow Lite&#39;),<br>          <em>backgroundColor</em>: Colors.<em>black</em>),<br>      <em>body</em>: modelBusy<br>          ? Center(<em>child</em>: CircularProgressIndicator())<br>          : ListView(<em>children</em>: listViewItems),<br>      <em>floatingActionButton</em>: FloatingActionButton(<br>          <em>backgroundColor</em>: Colors.<em>black</em>,<br>          <em>onPressed</em>: selectImageAndInfer,<br>          <em>child</em>: Icon(Icons.<em>image</em>)),<br>    );<br>  }<br>}</pre><p>And that’s it works great on IOS emulator… well was not exactly a breeze, faced a bunch of build failures, deprecation issues and what not, golden rule: make sure you configure the IOS module in XCode to use Objective-C as the source to be compiled.</p><p>And of-course, configure pubspec.yaml (which essentially tells flutter build tool to download all the required dependencies)</p><pre>name: FlutterEdgeCV<br>description: Edge CV with Flutter and TFlite.<br><br>version: 1.0.0+1<br><br>environment: <strong>## Boiler plate, upgraded to Flutter 3</strong><br>  sdk: &quot;&gt;=2.17.1 &lt;3.0.0&quot;<br><br>dependencies:<br>  flutter:<br>    sdk: flutter<br><br>  <em># The following adds the Cupertino Icons font to your application.<br>  # Use with the CupertinoIcons class for iOS style icons.<br>  </em>cupertino_icons: ^1.0.5<br>  image_picker: ^0.8.5+3 <strong># Dependency for image picker</strong><br><br>dev_dependencies:<br>  flutter_test:<br>    sdk: flutter<br><br><br>  tflite_maven: ^1.1.5 <strong># Tensor flow lite binding plugin</strong><br>  flutter_lints: ^2.0.1<br><br><br>flutter:<br>  uses-material-design: true<br><br>  assets:<br>    - assets/mobilenet_v1_1.0_224.txt<br>    - assets/mobilenet_v1_1.0_224.tflite<br><strong>  # ^^ Model, Metadata and labelling assets</strong></pre><p><strong>Sixth:</strong> Try it on Android emulator but now i ran out of luck… dang! Android embeddings used by the tflite binding is grossly outdated, i need to port the bindings to the latest standards (let’s park that for now) but will definitely try running the model on live capture frames with IOS…</p><p><strong>What’s next</strong>: The model needs to be trained with more data and tuned, to identify more objects, specifically birds or at-least the finches and humming bird visitors in my yard!</p><p>Hmm… that was quick, was able to get this up and running in couple hours… and it’s been so exciting to get this working first attempt, perhaps having a way to collect labelled ground truth from users and running training in the cloud to push updated models back to the device would drastically improve accuracy and coverage…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*bPYF5fhbOHgpYQ4BuUy1gQ.jpeg" /></figure><p>Let the hacking continue…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b3b791ef2d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CockroachDB — Postgres for the cloud]]></title>
            <link>https://mohammedzu.medium.com/cockroachdb-bf69fec90a0b?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf69fec90a0b</guid>
            <category><![CDATA[cockroachdb]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 06:33:53 GMT</pubDate>
            <atom:updated>2022-02-16T06:46:17.121Z</atom:updated>
            <content:encoded><![CDATA[<p>I wonder why <a href="https://www.cockroachlabs.com/">CockroachDB</a> is not picking up steam, It’s written by the three of the most prolific engineers on the planet: Spencer Kimball, Peter Mattis, and Ben Darnell.</p><p>I am a big fan of Kimball and Mattis as they gave the world, for free and open source, The GTK framework which led to the Gnome project — The foundation of Linux GUI; Using GTK they developed GIMP (poor-man’s photoshop, but not poor in functionality). Later these genius engineers worked on Google Spanner and since google is not open sourcing the same (I hope they will one day), they started developing an open source variant of Spanner but named it CockroachDB! Woink Woink!!</p><p>The name may not be very marketing-friendly, but the meaning sure is — Cockroach is one organism which can potentially survive a man-made (nuclear) or act-of-god (some asteroid the likes of which killed the dinosaurs) armageddon, heck roaches can even eat radio-active dust and adapt, nerdy to name a database for its resiliency just like the cockroach!</p><p>The DB is super cool though, it is built natively for the cloud, works seamlessly with Kubernetes, installs easily with helm and has an hybrid architecture, as-in, the underlying persistence engine is a distributed key-value store with highly fault tolerant automatic-replication and sharding of the key-space powered by the gossip protocol (smart! they kicked zookeeper to the curb!!), yet the query layer is Postgres wire compatible SQL, by doing this they brought the best of both words together in one package!</p><p>You can use ORM the likes of Hibernate/SqlAlchemy or if you hate ORM-generated SQL then perhaps JDBI or even plain old JDBC works with no issues and full syntax compatibility with PostGres (and yes, it works perfectly fine with table plus) and they very smartly chose Go lang for developing the database, which perhaps made it much easier to port/adapt PostGres wire protocol from C source code, and thanks to go lang, it comes with automatic garbage collection for free (Go lang ~ C with Garbage Collection) how cool is that!</p><p>Furthermore, it comes with an admin interface which servers on port 8080, with all the info about cluster and Keyspace metrics, and even has features for query debugging, all built-in!!</p><p>I am in awe as to how well they have thought out each and every aspect of engineering the new database, starting with the programming language, to automatic resiliency, to seamless scalability, to marrying the best of both worlds — sql and no-sql, to the tenet of being cloud native, to the admin interface, to the postgres compatibility and amazing documentation, just nailed it!! Pure Genius!!</p><p>I am still a big fan of Postgres, its legendary but CockroachDB (crdb) is a true evolution of the legend!</p><p>God bless the smart engineers who solve internet scale problems for fun in their garage, and give it away for free!</p><p>Don’t mess with the geeks</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf69fec90a0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graal “The Holy Grail” VM (Part II)]]></title>
            <link>https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-ii-9272fe144fbc?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9272fe144fbc</guid>
            <category><![CDATA[quarkus]]></category>
            <category><![CDATA[graalvm]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Wed, 19 Jan 2022 06:00:19 GMT</pubDate>
            <atom:updated>2022-02-22T02:49:33.598Z</atom:updated>
            <content:encoded><![CDATA[<p>Part I: <a href="https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-i-9b0c074088be">https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-i-9b0c074088be</a></p><p>Let’s complete the Graal saga with some hands-on…</p><p>I am going to demonstrate with a test project using Quarkus, a simple rest api called ‘yo yo!’ ← Name rings a bell? yes yes, the project which <a href="https://en.wikipedia.org/wiki/Yo_(app)">fetched</a> 1M investment in no time, back in the web 2.0 craziness days… phew! and now we are doing web3… deja vu!</p><p>The best thing about being in the valley is FOMO, and equally the worst, if you don’t have the nerve to keep up with the craziness, to keep learning and to keep racing then…. run away as far as you can… even Corona and WFH cannot undo the valley cult!!</p><p><strong>Ah the demo… it’s simple, follow along.</strong></p><blockquote>1. Go to quarkus.io and generate a new project selecting gradle and resteasy</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*230hyn73Y1NIIojoPmZdnQ.png" /></figure><blockquote>2. fire up IntelliJ (this isn’t a vi vs emacs discussion… if you ain’t using intellij, yet can still blurt out java code, you are a Demi god!)</blockquote><blockquote>3. open “main/java/it.graal/GreetingsResource” (don’t forget to comment out the test cases)</blockquote><blockquote>4. GreetingsResource thats a boring name, so i refactored it to RestYo</blockquote><blockquote>5. The cheapest of code for a ReST resource i can blurt out</blockquote><pre>@Path(&quot;/graal&quot;)<br>public class RestYo {<br><br>   @GET<br>   @Produces(MediaType.TEXT_PLAIN)<br>   @Path(&quot;/yoyo/{me}&quot;)<br>   public Response yo(<br>         @PathParam String me<br>   ) {<br>      return Response.<em>ok</em>(String.<em>format</em>(&quot;Yo! Yo! %s\n&quot;, me)).build();<br>   }<br>}</pre><blockquote>6. Resteasy really makes it easy, the code is self explanatory i guess, if not then all it does is defines a root level path /graal, and a GET handler for /yoyo/&lt;path-parameter&gt;, which simply responds with “Yo! Yo! &lt;path-parameter&gt;”, like below:</blockquote><blockquote>~ curl <a href="http://localhost:8080/graal/yoyo/mz">http://localhost:8080/graal/yoyo/mz</a><br>Yo! Yo! mz</blockquote><p>That’s it, that’s our demo la grande! but the real deal is to see the memory and run-time superiority of Graal over JVM, right! moving on…</p><blockquote>7. Get the GraalVM 21.3 community edition from <a href="https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.3.0">here</a> , i used the darwin build for mac <a href="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-darwin-amd64-21.3.0.tar.gz">here</a></blockquote><blockquote>8. Unzip to some place cool</blockquote><blockquote>9. Set the environment and install the native image: <br>➜ ~ export GRAALVM_HOME=/your/path/to/graalvm-ce-java11–21.3.0/Contents/Home/<br>➜ ~$GRAALVM_HOME/bin/gu install native-image</blockquote><blockquote>10. Fire up a Gradle build (you can use maven too but i really like gradle, without the xml quirks), It takes a lot more time to build than conventional jar build (you know the “AOT” thingy from Part I) have some patience, its really worth gold here and when its done, voila! you have the executable (called runner) and the uber-jar both at your disposal in the build folder:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aj_Ed9WXsW_59tjjWJLJ0g.png" /></figure><blockquote>11. Let’s fire it up, first JVM, next GRAAL, standard stuff, run with a <strong>time</strong> prefix and a <strong>top -pid &lt;pid&gt; </strong>for checking memory</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88Yd55GvBibhbtY_JCudbw.png" /><figcaption><strong>JVM</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLDLk9n5U2Np9sFQrpM0Gg.png" /><figcaption><strong>GRAAL</strong></figcaption></figure><blockquote><strong>DONE</strong>! Now….. What did your keen eyes notice? <br>Clue: Zoom in to “Started in…” and “MEM”</blockquote><ul><li>The startup time: JVM is <strong>0.924s</strong>, for Graal its <strong>0.023s</strong>, beat that!</li><li>Next Memory: JVM (<strong>108 freaking megs</strong>…. lol) and Graal (<strong>10 megs</strong>) …. this is a no contest! cold start, what cold start</li></ul><blockquote>You know what makes this even better, you guessed it, DORA (docker once run anywhere) but thats for Part III and what makes it a killer? is to dora and fly a kite (you know k8s… sounds like a kite, no? you like “kubernetes” better, sure!) thats for part 4.</blockquote><h3>That’s it folks, see you in part III, to do the DORA</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9272fe144fbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graal “The Holy Grail” VM (Part I)]]></title>
            <link>https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-i-9b0c074088be?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b0c074088be</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[graalvm]]></category>
            <category><![CDATA[jvm]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Fri, 14 Jan 2022 07:18:31 GMT</pubDate>
            <atom:updated>2022-03-03T23:30:14.025Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been a while since i have written anything, and i am really disturbed today about something, so either i could just keep ruminating about what happened or find a way for a positive distraction, so thought well!, let’s do a medium post on something which has been fascinating me about the evolution of java runtime lately.</p><p>GraalVM — even the naming sounds like a some sort of LOTR sequel… perhaps right fully so.</p><p>I am not a big fan of java, primarily because its a very very verbose language, in the world of super idiomatic new comers like Kotlin and swift and dart and typescripts, Java is reeling to catch-up.</p><p>If you have written micro-services in java, you’d probably have used the ubiquitous spring boot framework for the dependency injection tricks, aah…. yes.. .DI… the quirky xml configs which define the beans, and packaging the Netty service into docker boxes, 1k LOC program ends-up as a 200meg bundle and has a cold start time of 5 seconds! (The go lang folks are laughing at a distance yes!)</p><p>Enter server-less, the above problem is even more pronounced, heck! it’s a deal breaker, 5 seconds to cold start the docker image + bootstrap time for the underlying docker runtime and what not, forget it!</p><p>I am like, dude! java is a dead horse in the world of Server-less! but thanks to some quick googling, i came across GraalVM, hmm… the name sounded scary at first, but i decided to dig deep.</p><p>So whats GraalVM, let me see if i can explain it like you are 5! (ELI5)</p><p>Traditional java programs are built and executed using a java virtual machine yeah? hmm… so you have</p><ol><li>The java byte code to execute</li><li>The Java Virtual Machine</li><li>The Platform (Linux or Mac or Windows)</li></ol><p>So, what GRAAL does is that it creates 1 bundle combining the JVM + The java byte code, which runs natively on the underlying platform, meaning java code runs, at-least in principle, the same as C or C++ executable, how cool is that!</p><p>so…. whats the trick and what the catch?</p><p>Well, its how GraalVM builds the big fat executable in the first place, using a nifty technique called AOT (Ahead of time compilation), which as the name suggests, walks through the java executable and tries to resolve classes and their dependencies during build time!</p><p>Whats that!!</p><p>Hmm.. traditional java code, usually runs on this cool self-optimizing runtime called JIT or Hotspot VM, which does a lot of manipulatory acts, plugging and pushing objects out of memory, modulating life cycles, garbage collecting obsoletes, blah blah blah etc… this meant, java folks had a free hand to inventing more and more abstractions and jargons that go with it… the most ugliest of them being “Reflections!”</p><p>I am not like a pro java guy, but those who are - either swear by Reflections or hate it to death… (the good ones usually hate it, and avoid it completely)</p><p>Man! i am digressing… let’s come back to the rant on reflections later.</p><p>We were talking about AOT, AOT is the opposite of JIT (Just in time compilation), why? because with Graal, we don’t have a JVM anymore! so all those dynamic run-time optimizations with JIT tricks wont fly in Graal.</p><p>With Graal, you have to be able to walk through the dependency tree class by class as if. you are executing the code during compilation, which leads to a big fat executable, something which you can run on say unix like “~$./runner”.</p><p>If you are old school java folk, you’d probably be up in arms with the banner “Hey! whatever happened to write once run anywhere”…. but folks! folks! which rock were you living under in the past decade… haven’t you heard of containers?</p><p>Who needs a JVM + WORA anymore? just get the Graal executable bundle it with docker and docker runs anywhere, its docker once run anywhere now (DORA) ← i made that up just now! Cool right?</p><p>But the back pain in making this work is… yeah! you guessed it… Reflection-ismo!</p><p>Why? well this Reflections concept allows a class to invoke non-public methods of another class, thanks to JVM being a master manipulator at work.</p><p>But! GraalVM breaks down with reflections, with Graal, you have to be able to walk through the dependency tree class by class as if you are executing the code during build time, naturally the so-called non-public methods are not visible and this leads to whole bunch of build failures!</p><p>So, if you are dealing with a whole bunch of legacy code written by reflections kamikaze developers, you should probably stick to jvm, its not worth it…</p><p>But, lets say if its manageable, then you use this file called reflection-config.json and you specify which classes contain non-public methods and ask GraalVM compiler to not do a AOT on it…</p><p>Whaat! what good is that then?</p><p>Well.. like i said, only if there aren’t too many reflections, but the net performance gain coming out of GraalVM is orders of magnitude superior.</p><p>I can write a lot more about this, but for now i am starting to feel tired, so will continue in part II… but if you want to know how fast is GraalVM, in memory and run-time superiority over JVM, go to: www.quarkus.io and see just the pictures on the landing page (you can ignore everything else!!)</p><p>I am not going to proof read this write-up or anything! i intended it to be dirty and it turned out to be dirty… just free flow dump of thoughts.</p><p>But, i am actually feeling better after writing this…. :D :D so my primary objective is accomplished..</p><p>Part II: <a href="https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-ii-9272fe144fbc">https://mohammedzu.medium.com/graal-the-holy-grail-vm-part-ii-9272fe144fbc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b0c074088be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tiger 2012–2021]]></title>
            <link>https://mohammedzu.medium.com/tiger-2012-2021-447123332716?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/447123332716</guid>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Tue, 09 Mar 2021 09:19:31 GMT</pubDate>
            <atom:updated>2021-03-09T11:57:12.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*R4_4q6w4fpt4sCwX7NoUyw.jpeg" /></figure><p>Yesterday (March 8th 2021), Our Tiger passed away after being with us for 8+ years, The guy was a very smart fish with his big eyes and an attitude, he’d recognized faces judging from the fact that he had distinct behavior for each of us at home, Z used to play tank hide and seek with him, as-in he’d dash from one corner to another for biting her! My wife used to feed him, so he’d swim to the top of the tank with his big eyes rolled up like a puppy, being very expressive, blowing bubbles, little z was more fond of Mermaid (our albino pleco, his tank mate) but he knew her as well. He’d play with his blue marble ball tossing it around the tank, harmlessly bullying mermaid, tossing around the tank heaters and the ornaments and what not, he was the king of his aquarium domain, A rowdy fish!, A majestic creature in orange and black :(</p><p>We are sad but some astonishing things happened today, which brings us some joy in mourning:</p><ol><li>As he was dying, Tiger was in his best colors, the brightest and darkest of Orange and Black we have ever known him to be, he looked majestic as he was taking his last breath which was not expected from a dying fish, on the contrary color-rich fish go pale when dying due to distress. The guy left wearing the best of his style!</li><li>Perhaps a reminder to us that death and empathy are universal and so is the love of our creator for all his creations — Our pleco “Mermaid”, who prefers to stay clear from tiger normally as he has this habit of harmlessly bullying her, nudging and reminding her as to who is the boss of the aquarium occasionally, We never thought that she’d move from her side of the tank to be with tiger, as if to let him know that “I am here for you in your last moments!”, as the big guy was resting at the bottom of the tank, she slid underneath his dying head to let it rest on hers (my entire family is witness to this) and she remained in this position as tiger was breathing his last until he stopped breathing, and stayed until the point we removed his body from the tank for burial… it was an inexplicable act of empathy from one animal to another, she knew somehow that her tank buddy, a frenemy!, was dying, I can’t verbalize what we experienced, i mean, these are fish we are talking about :(</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CkM2X-OjDrenJmXcdWYbzQ.jpeg" /><figcaption>Tiger with his favorite blue ball and his tank mate Mermaid</figcaption></figure><p>Tiger is gone, He is no more! we adopted him when he was probably just a few weeks old hatch-ling, measuring barely an inch, our Z was a only a year and a half old baby at that time, and since then he has seen the highs and lows, as we moved from apartment to apartment, and when pets were not allowed, we had to request our friends to adopt him until we could buy our own soon enough, eventually they couldn’t take care of him, so we had to request another friend until we get our own in 2018, and finally have him back to his own home and now 2 years out we said our good byes to him.</p><p>Tiger and my little girl Z, they’ve been bonded since she was barely 2 years old, and practically grew up together, she has been crying all day, but an important life lesson for my baby today, that death is certain for all living things, After burying him beside our pine tree, we cleaned up the tank and now Mermaid seems sad, she is lonely now, no more tiger to bother her… tank is void without him, will take some time to sink in, we prayed as a family for him and for us to feel better.</p><p>At death, he was around 13 inches and perhaps weighing almost 3 pounds, in retrospect he was a barely an inch and perhaps just a few ounces when we first adopted him… Some fond memories of him playing dead a few times in the early days come to mind (a survival tactic displayed by Tiger Oscars which we were not aware of that time) — My wife and I used to be so worried for his life with his tricks! :) but this resilient guy survived and thrived through such near death events for real, Once, we were on a vacation to LA back in 2014, The filtration system had failed unexpectedly and yet he was surviving like a fighter in some real poor quality water conditions until we returned! I had to do an emergency water change and we thought he’d die for certain but then he fought time and again when faced with odds and always used to come out strong.</p><p>We were hoping that this time he’d pull it off as well, but it was his time, this time :( He went on to live a long life almost 9 years with an attitude! proving Oscars are one of the smartest of the fresh water aquarium fish.</p><p>I can’t verbalize the emotions we are going through unless you are a fellow pet parent as well and went through similar emotions at some point in your life, so jotted down this post in memory of our big eyed guy! :(</p><p>Inna Lillah Wa Inna Ilaihi Raji’un (To you, my lord! do we belong, and to you we shall return!)</p><p><strong>Tiger 2012–2021</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=447123332716" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Count Min Sketch in Pythonic Art]]></title>
            <link>https://mohammedzu.medium.com/count-min-sketch-in-pythonic-art-66eca72666c6?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/66eca72666c6</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[count-min-sketch]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Tue, 21 Jan 2020 02:20:12 GMT</pubDate>
            <atom:updated>2020-01-21T09:23:46.382Z</atom:updated>
            <content:encoded><![CDATA[<p>Constant time probabilistic data structure for counting streaming events, in Python.</p><p>Count Min Sketch is a fast and highly space efficient probabilistic data structure that serves as a frequency table of events in a stream, Similar to Bloom Filter, Count Min Sketch utilizes fast non-cryptographic hash functions (k) for mapping events to frequencies. Count Min Sketch guarantees zero under-counting and tunable probability over-counting, The accuracy of the sketch is a function of the number of hash functions (k) and the number of slots per hash function (m).</p><p>This code illustrates an example use case for count min sketch which is to count the viewers watching all sci-fi movies available on any streaming service.</p><p>Part II of the 2020 weekend coding series on probabilistic data structures.</p><p>Part I: <a href="https://medium.com/@mohammedzu/bloom-filters-in-pythonic-art-4226657db71a">https://medium.com/@mohammedzu/bloom-filters-in-pythonic-art-4226657db71a</a></p><p>Errata in the hand-written notes below: In the table H3(3) is 4 and Min(H1…K(‘Lion’)) is 4 as well, not 6, which is the frequency of the event ‘Lion’, ‘Lion’ and ‘Cat’ have collisions at H1(1), H2(2) and H3(4)</p><p><a href="https://en.wikipedia.org/wiki/Count%E2%80%93min_sketch">Count-min sketch - Wikipedia</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DbPmJPdggOp2AVY_oNLNLA.png" /></figure><p>Try running the program multiple times for instances of over-counting.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fcountminsketchpy%3Flite%3Dtrue&amp;url=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fcountminsketchpy%3Flite%3Dtrue&amp;image=https%3A%2F%2Frepl.it%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=repl" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/184e1c3a470cc3d34ee1060132deba84/href">https://medium.com/media/184e1c3a470cc3d34ee1060132deba84/href</a></iframe><pre><strong>$time python3 count_min_sketch.py<br></strong><br>Trial: <strong>1</strong>/<strong>3 </strong>[Initializing...]<br>Filter Size: <strong>10977 </strong>Hash Functions: <strong>3 </strong>Unique Items: <strong>173<br></strong>Loose Limit for Events: <strong>1295<br></strong>Generating Random Click Stream and counting... Please wait<br>Stream Size: <strong>224035<br></strong>Validating Counter Sketch...<br>Over-counted (<strong>0</strong>/<strong>173</strong>): {}<br><br>Trial: <strong>2</strong>/<strong>3 </strong>[Initializing...]<br>Filter Size: <strong>10977 </strong>Hash Functions: <strong>3 </strong>Unique Items: <strong>173<br></strong>Loose Limit for Events: <strong>1295<br></strong>Generating Random Click Stream and counting... Please wait<br>Stream Size: <strong>224035<br></strong>Validating Counter Sketch...<br>Over-counted (<strong>1</strong>/<strong>173</strong>): {&#39;Resident Evil (2002)&#39;: {&#39;True Count&#39;: <strong>452, </strong>&#39;Min Count&#39;: <strong>487, </strong>&#39;Count Vector&#39;: [<strong>487, 1969, 1461</strong>]}}<br><br>Trial: <strong>3</strong>/<strong>3 </strong>[Initializing...]<br>Filter Size: <strong>10977 </strong>Hash Functions: <strong>3 </strong>Unique Items: <strong>173<br></strong>Loose Limit for Events: <strong>1295<br></strong>Generating Random Click Stream and counting... Please wait<br>Stream Size: <strong>224035<br></strong>Validating Counter Sketch...<br>Over-counted (<strong>1</strong>/<strong>173</strong>): {&#39;A Scanner Darkly (2006)&#39;: {&#39;True Count&#39;: <strong>1324, </strong>&#39;Min Count&#39;: <strong>1959, </strong>&#39;Count Vector&#39;: [<strong>8671, 1959, 2316</strong>]}}<br><br>Accuracy over <strong>3 </strong>Trials: <strong>0.9961464354527938<br><br></strong>real   <strong>0</strong>m10<strong>.525</strong>s<br>user   <strong>0</strong>m10<strong>.417</strong>s<br>sys    <strong>0</strong>m0<strong>.050</strong>s</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66eca72666c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bloom Filters in Pythonic Art]]></title>
            <link>https://mohammedzu.medium.com/bloom-filters-in-pythonic-art-4226657db71a?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4226657db71a</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bloom-filter]]></category>
            <category><![CDATA[probabilistic-programming]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Sun, 12 Jan 2020 09:38:01 GMT</pubDate>
            <atom:updated>2020-01-13T05:58:42.782Z</atom:updated>
            <content:encoded><![CDATA[<p>Use Case: User login handle existence test during profile creation using Bloom Filter, in Python.</p><p>Part I of the 2020 weekend coding series!</p><p>Bloom Filter is a highly space efficient probabilistic data structure that guarantees zero false negatives and tunable probability false positives.</p><p>Bloom filters are popularly used for filtering use cases, requiring fast and space efficient key existence checks, such as testing for existing user handles during login and profile creation, Access control lists for security applications such as spam filtering, Cache filtering in CDNs, Database design (Cassandra uses bloom filter) among others.</p><p>Bloom filters are implemented using bitmaps offering orders of magnitude higher memory efficiency than hash maps.</p><p><a href="https://en.wikipedia.org/wiki/Bloom_filter">https://en.wikipedia.org/wiki/Bloom_filter</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryzDFi_XjIiIiL8fpCPFYA.png" /></figure><p>Run the program multiple times to see instances of False positives and FPR.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fbasicbloomfilterpy%3Flanguage%3Dpython3%26lite%3Dtrue&amp;url=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fbasicbloomfilterpy%3Flanguage%3Dpython3%26lite%3Dtrue&amp;image=https%3A%2F%2Frepl.it%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=repl" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c00cda5e7dc8d857023ec1bb669b6d4/href">https://medium.com/media/0c00cda5e7dc8d857023ec1bb669b6d4/href</a></iframe><pre>...<br>...<br>Trial: <strong>199</strong>/<strong>200 </strong>[....<strong>.1</strong>..<strong>.1</strong>..<strong>.1</strong>.<strong>.11.11.113</strong>.<strong>.111</strong>.<strong>.7.3</strong>.<strong>.1</strong>.<strong>.211221.3.21</strong>..<strong>.27231422.1.21.3711142321224243173.32211327322233214133</strong>]<br>Trial: <strong>200</strong>/<strong>200 </strong>[........<strong>.1</strong>..<strong>.2</strong>..<strong>.1</strong>.<strong>.2.11</strong>..<strong>.1212172211</strong>.<strong>.22.21.121321.431712142.211.221723333124311264372353.12227231133224424</strong>]<br><br>[Legend] Hash Collision = &#39;n&#39; functions<strong>, </strong>Clear = &#39;.&#39;<br><br>Test Data: {False: [&#39;zu&#39;<strong>, </strong>&#39;zzzu&#39;<strong>, </strong>&#39;jaggu&#39;<strong>, </strong>&#39;ninja&#39;<strong>, </strong>&#39;neo&#39;<strong>, </strong>&#39;trinity&#39;<strong>, </strong>&#39;morpheus&#39;<strong>, </strong>&#39;po&#39;<strong>, </strong>&#39;shifu&#39;<strong>, </strong>&#39;tigress&#39;]<strong>, </strong>True: [&#39;mz&#39;<strong>, </strong>&#39;maryam&#39;<strong>, </strong>&#39;isabelle&#39;<strong>, </strong>&#39;jo&#39;<strong>, </strong>&#39;ch&#39;]} Positives<br><br>Trials=<strong>200, </strong>Filter Size(m)=<strong>1513, </strong>Hash Functions(k)=<strong>7 </strong>Items(n)=<strong>108<br><br></strong>True Negatives: Counter({&#39;zu&#39;: <strong>200, </strong>&#39;zzzu&#39;: <strong>200, </strong>&#39;jaggu&#39;: <strong>200, </strong>&#39;ninja&#39;: <strong>200, </strong>&#39;neo&#39;: <strong>200, </strong>&#39;trinity&#39;: <strong>200, </strong>&#39;morpheus&#39;: <strong>200, </strong>&#39;shifu&#39;: <strong>200, </strong>&#39;tigress&#39;: <strong>200, </strong>&#39;po&#39;: <strong>198</strong>})<br>True Positives: Counter({&#39;mz&#39;: <strong>200, </strong>&#39;maryam&#39;: <strong>200, </strong>&#39;isabelle&#39;: <strong>200, </strong>&#39;jo&#39;: <strong>200, </strong>&#39;ch&#39;: <strong>200</strong>})<br>False Positives: Counter({&#39;po&#39;: <strong>2</strong>})<br><br>False Positive Rate: <strong>0.001<br></strong>Avg Collisions on all k: <strong>5.38<br></strong>Bloom Filter BitArray Size: <strong>190 </strong>bytes</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4226657db71a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph coloring in Pythonic Art]]></title>
            <link>https://mohammedzu.medium.com/graph-coloring-in-pythonic-art-2c86a6da90cd?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c86a6da90cd</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[graph-algorithms]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Mon, 30 Dec 2019 14:07:16 GMT</pubDate>
            <atom:updated>2019-12-30T20:41:59.574Z</atom:updated>
            <content:encoded><![CDATA[<h3>Graph Coloring in Pythonic Art</h3><p><em>Greedy BFS Graph coloring Algorithm in Python</em></p><p>Part IV and finale of the Holidays 2019 coding series… Happy 2020 Y’all</p><p>This implementation illustrates Graph Coloring (An NP-Complete Problem) of US map using Greedy BFS.</p><ul><li><a href="https://en.wikipedia.org/wiki/Graph_coloring"></a></li><li><a href="https://en.wikipedia.org/wiki/Four_color_theorem">Four color theorem - Wikipedia</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WD0aa7O2_2i7BuxtDvSVXQ.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fgraphcoloringbfsgreedy%3Flanguage%3Dpython3%26lite%3Dtrue&amp;url=https%3A%2F%2Frepl.it%2F%40linuzoo%2Fgraphcoloringbfsgreedy%3Flanguage%3Dpython3%26lite%3Dtrue&amp;image=https%3A%2F%2Frepl.it%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=repl" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/0134d44c01183c35977e0ee2a423bf5d/href">https://medium.com/media/0134d44c01183c35977e0ee2a423bf5d/href</a></iframe><p>Part I: <a href="https://medium.com/@mohammedzu/least-recently-used-lru-cache-in-pythonic-art-bda8a62fce36">https://medium.com/@mohammedzu/least-recently-used-lru-cache-in-pythonic-art-bda8a62fce36</a></p><p>Part 2:<a href="https://medium.com/@mohammedzu/least-frequently-used-lfu-cache-in-pythonic-art-fbaa63b34da9">https://medium.com/@mohammedzu/least-frequently-used-lfu-cache-in-pythonic-art-fbaa63b34da9</a></p><p>Part 3:<a href="https://medium.com/@mohammedzu/directed-acyclic-graphs-dag-and-topological-sorting-b35cb869a66a">https://medium.com/@mohammedzu/directed-acyclic-graphs-dag-and-topological-sorting-b35cb869a66a</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c86a6da90cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Directed Acyclic Graphs (DAG) and Topological Sorting]]></title>
            <link>https://mohammedzu.medium.com/directed-acyclic-graphs-dag-and-topological-sorting-b35cb869a66a?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b35cb869a66a</guid>
            <category><![CDATA[batch-job-scheduling]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[directed-acyclic-graph]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Tue, 24 Dec 2019 08:32:33 GMT</pubDate>
            <atom:updated>2019-12-25T00:16:05.218Z</atom:updated>
            <content:encoded><![CDATA[<h3>Directed Acyclic Graphs (DAG) and Topological Sorting in Pythonic Art</h3><p>Part III of the Holidays Coding Series.</p><p>Directed Acyclic Graphs are Graphs without cycles with the property that an edge E exists between any two nodes u, v such that E= {u, v} but *not* {v, u} and no back edges. This property makes DAGs suitable for building dependency chains used in many versatile applications including, but not limited to Crypto-currencies (Distributed Ledgers) both stand-alone (IoTA) and in combination with block chain, Package dependency management for building large software systems (Gradle), Task flow scheduling for Batch processing (e.g. Apache Airflow), Networking protocols such as RPL for Internet of Things among others.</p><p>Topological sorting Algorithm for DAG returns a linear ordering of nodes such that for every directed edge uv, node ‘u’ precedes v in order. Topological sorting only works if the DAG is indeed Acyclic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LriA1U2BVQ5WdKW1xXVQuw.png" /></figure><h4>Depth First Search (DFS) Recursion Stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*_v9voeRnKkBpprHD07KwHQ.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Frepl.it%2F%40linuzoo%2Ftopsortpy%3Flite%3Dtrue&amp;url=https%3A%2F%2Frepl.it%2F%40linuzoo%2Ftopsortpy%3Flite%3Dtrue&amp;image=https%3A%2F%2Frepl.it%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=repl" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/369ef1de8bf206fddce91124a4891136/href">https://medium.com/media/369ef1de8bf206fddce91124a4891136/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b35cb869a66a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Least Frequently Used (LFU) Cache in Pythonic Art]]></title>
            <link>https://mohammedzu.medium.com/least-frequently-used-lfu-cache-in-pythonic-art-fbaa63b34da9?source=rss-e6f95e6192d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbaa63b34da9</guid>
            <category><![CDATA[lfu-cache]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Mohammed Zaheeruddin Malick]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 01:21:19 GMT</pubDate>
            <atom:updated>2019-12-23T05:15:37.988Z</atom:updated>
            <content:encoded><![CDATA[<p>Double Maps and a Double Linked List implementation of a classic cache management Algorithm in Python.</p><p>Part II of the Holiday Coding Series — Happy Holidays!</p><p>Part I (LRU Cache): <a href="https://medium.com/@mohammedzu/least-recently-used-lru-cache-in-pythonic-art-bda8a62fce36">https://medium.com/@mohammedzu/least-recently-used-lru-cache-in-pythonic-art-bda8a62fce36</a></p><p>A Least Frequently Used Cache (LFU) evicts the least frequently used key, value tuple when the cache is full, to do so the frequency of each key is updated on each access, a map of frequencies pointing to a double linked list keeps track of all items having the same access frequency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U530f3Khs0qRsgqI-IIpfg.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Frepl.it%2F%40linuzoo%2Flfucachepy%3Flite%3Dtrue&amp;url=https%3A%2F%2Frepl.it%2F%40linuzoo%2Flfucachepy%3Flite%3Dtrue&amp;image=https%3A%2F%2Frepl.it%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=repl" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd8700232af2ac048e232c014c9497d4/href">https://medium.com/media/fd8700232af2ac048e232c014c9497d4/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbaa63b34da9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>