• Reverse Engineering Code Art - Part 1

    Original Dwitter by FireFly

    TLDR

    This incredibly amazing piece of code produces 48 procedural generated sprites on screen

    Sprite sheet screenshot

    
    
    for(i=2e3;!t&&i--;Math.random()>(X**2+(Y-4)**2)**.5/6&&f(7)+f(-7))X=i&3,Y=i>>2&7,f=m=>x.fillRect(240*(i>>5&7)+120-X*m,180*(i>>8)+50+Y*7,7,7)
    
    
    
  • Case study on extended statistics

    Case study on extended statistics

    First we need to ask ourselves the following questions

    • What are statistics in Postgresql?
      • When we do a query the planner will need to estimate the number of rows to retrieve from the table. To do this infomation is stored in the table pg_statistic
      • Entries here are updated by ANALYSE and are always kept up to date, in the example I would be showing a case where that occurs
      • The statistics stored however are for a single column
    • What is an extended statistics?
      • An extended statistics is something an user can create
      • This is used in cases when queries are slow due to correlation between columns
  • Different ways of packing JAR in Java

    A JAR is abbreviated as Java ARchive, which is basically as the definition says it is a collection of your class files also with some meta data defined in META-INF/MANIFEST.MF, zipped into a single file

    The manifest contains the location to the classpath dependencies, main class to run if your jar is to be an application.

    Though Java is dynamically linked, due to JARs we can create a single uber jar if needed. There are a couple of ways of packing the JAR, depending on your use case

  • Covariance and Contravariance

    Covariance and Contravariance

    Design Guideline 2 - Covariant and Contravariance

  • Law of Demeter

    Law of Demeter

    Stumpled across this from PMD at 2AM at office 😓, and what did I do?? Ping chat about the topic, fix my code and sleep

    What is the Law of Demeter?

    • Each unit should have only limited knowledge about other units: only units “closely” related to the current unit.
    • Each unit should only talk to its friends; don’t talk to strangers.
    • Only talk to your immediate friend