View Posts for Software Engineering

  • Fixing Gradle Javadoc task failure when using Java Modules

    |
    Updated at

    You may be familiar with this shitty error probably using Gradle 6.7:

    Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')

    You likely have this in your afterEvaluate block:

    javadoc {
      inputs.property("moduleName", moduleName)
      doFirst {
        options.addStringOption('-module-path', classpath.asPath)
      }
    }

    You can fix it with:

    javadoc {
    inputs.property("moduleName", moduleName)
    o...
  • One of the Reasons I Love Rust Macros

    |
    Updated at

    You just can't beat this feature.


    use ::phf::{Map, phf_map};
    
    static MAP: Map<char, &'static str> = phf_map! {
        'a' => "apple",
        'b' => "bear",
        'c' => "cat",
    };


    Makes it so easy to create a very fast constant static hashmap at build time. You just can't beat it.. you just can't.

  • One Way How Javascript Bundling is Stupidly Complex

    |
    Updated at

    Anyone heard of any other language where there are "module" specs? You know specs for how your library will be bundled up in order to expose your library for consumption.

    AMD, CJS, UMD, ESM, SystemJS, GGJS, HYZM and whatever acronyms out there

    Why the fk do these things exist? Oh right, because Javascript left the idea of library importing out. It wasn't conceivable that people would need to do this in the browser until they did. I guess other language designers figured people share code and that company fron...

  • CRDTs are Interesting

    |
    Updated at

    It has been a while since the last time I looked into CRDTs or Conflict-free Replicated Data types. The name is pretty descriptive in that you want data types that replicate in a conflict free manner such as distributed counters, sets and maps.

    I found a really good resource on learning about CRDTs from a fundamental standpoint, which could help in building your own CRDTs that no one has. Lars Hupel's CRDTs

    The way it talks relates abstract math to how certain CRDTs work is very easily read. 'Here is a lattic...

  • When to use NPM's Peer Dependencies

    |
    Updated at

    I'll keep it short. First tech related post in a while too.

    I never used peer dependencies because I did not understand the point. It never installed the library I wanted! So it made no sense to me.

    I kept running into a problem with certain libraries that require use of a singleton instance that caches data. When multiple dependencies use the same library then they will all have their own version of the library which obviously causes unforeseen issues.

    There are libraries out there like Class Transformer that...

  • Updated Blog for 2020

    |
    Updated at

    Every year I try to see what I can do for my blog. This year, I decided not to change the layout. I think the layout is simple enough.

    Instead, I updated the font to use Inter and updated infrastructure. There are some kinks to work out.

    Styling and Font

    The inter font (https://rsms.me/inter/) is a very legible and dynamic font. I intend to use this on all my web properties. It just makes sense for the eyes.

    - Another legible and easy on the eyes font is called Lexend (https://www.lexend.com/), which I could sw...

  • "Why do Go articles so often have no syntax highlighting?"

    |
    Updated at

    https://news.ycombinator.com/item?id=23308644

    "Rob Pike, one of the 3 original Go architects, has stated in the past he doesn’t like syntax highlighting"

    https://groups.google.com/forum/#!msg/golang-nuts/hJHCAaiL0so/kG3BHV6QFfIJ

    "Syntax highlighting is juvenile. When I was a child, I was taught
    arithmetic using colored rods
    (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I
    use monochromatic numerals.

    -rob"

    Believe it and that's why I can say Fuck Go Lang and its shit author. Early decisions...

  • MySQL Binary Log Pub/Sub

    |
    Updated at

    MySQL's Binary Log is nice to have, but not easiest to use. Change data capture (CDC) is the primary reason why I have to do it. When a user performs and action that causes an INSERT/UPDATE/DELETE, I want to know about it.

    Typical way is to plug it into your application, but that is prone to issues when your CDC statement doesn't run because fatal error caused your application to quit in the middle of the data manipulation statement. The entry was written to MySQL and its Binary Log though!

    I've always read ...

  • My Learnings about DAWGs or Directed Word Acylic Graphs

    |
    Updated at

    When I begun with the goal of looking for a better way to compress a string in real time in memory while gaining fast query capabilities, I had a Rust Generalized Suffix Tree built naively on top of a C Library called LibART (Adaptive Radix Tree). It gave me super fast prefix, suffix and contains like no other would believe. At the expensive of memory.

    For example, a pathological case of 300k 128 Alphanumeric strings would take 6GB. If you do the calculation based on unicode, you'll see it doesn't take much ...

  • Obessed with Making a GST Memory Efficient: End of the Road

    |
    Updated at

    Update: Found several bugs in my Typescript and Rust implementation that looks to invalidate the results here. Either I stumbled into a way to construct a minimized graph that can find what I want or what. Only found it after I implemented a traverser with backwards lookup. Might as well use a Finite State Transducer Index as far as I can see. I'm going to keep looking into this since it is a radix and suffix tree.

    - One of the bugs is related to my misreading of the paper. One should not use same terminator...