[GOOD FAST] # _

Welcome!

My name is Kerneels. I write, code and partner with people to build software systems that are good and fast. Reach me at Google's mail service, with my name as mailbox .

This is my site where I write about anything that interests me.

Recent Posts

Finding vertical and horizontal, or row and column differences on wide tables, faster

published on
Sometimes we need to show that the exact same data is produced by two different processes. We might be replacing one implementation of an algorithm with a more efficient one, or we might be running the same algorithm on a different technology. We want to show that the data in table_a and table_b is identical, or if it is not identical, we want to identify all differences. In this article, I want to share with you a method that helped me do this. Read More...

Two big ideas of SQL: The What, not How, and querying with ease

published on
There are many factors that have contributed to the slow but steady rise of the popularity and ubiquity of SQL as a way to work with data. Among all these factors, the most significant one in my opinion is the concept of “what” rather than “how”. The second factor of greatness of SQL for me is the ability to quickly and easily answer questions about data. I choose to start out with these two big ideas that to me, is fundamental to the language. Read More...

Bar-sized factorial

published on
What’s the first five digits of 1,000,000! or 1 million factorial? Let’s ask Haskell: Prelude> take 5 $ show $ product [1..1000000] "82639" (1043.56 secs, 1,444,511,743,624 bytes) Neat! But you might ask, how many digits is this rather large number, of 1 bar factorial? Let’s ask again: Prelude> length $ show $ product [1..1000000] 5565709 (1103.04 secs, 1,444,845,773,000 bytes) Wow! 5.5 million digits! Way more than all the electrons in the universe. Read More...

Permutations and combinations, and ways to calculate the number of draws in a lottery

published on
With a recent, unusually high Power Ball jackpot of ZAR ~220 million, we could not help discussing one’s chances for actually hitting the jackpot as a bit of nice office banter. Despite your personal take on the Power Ball and Lotto,� we can turn it into a nice mathematical puzzle, and sanatise the gambling aspect away. Yeah, we can do that, because we are into maths, programming and data! For the uninitiated among us, the way it works is simple really. Read More...

How to use the transitive closure over a set of relations for fast path finding in SQL

published on
In a previous post, I wrote about how we make sense of the world by modelling relationships between things as tree-like hierarchies. This time we will add to this hierarchical data structure, a representation derived by calculating all possible paths. This set of paths is referred to as a transitive closure, and can be thought of as the set of all paths if you start at each node in the tree. Read More...

Wizen up a bit : solve problems bitwize

published on
I’m rather obsessed with bits. All sorts of bits, at various times, but in particular, the digital bit of the Binary system. Notice the capitalization of “Binary” - it is intended. Efficient bit representations of information is purity ; ever more compact representations elegance itself, so for this post I invite you to come with me, way back to 2013, when a nice couple of bitwise operations flaunted their power and expressiveness. Read More...

10 Ways to outsmart cyber criminals

published on
Big day; our first guest contribution! Johann Bergh, a professional translator and recovering software developer put together this list of 10 ways how you can be proactive and outsmart cyber criminals. Enjoy, and take action! Information is key to the success of cyber criminals. It is the driver that enables them to destroy, steal and extort. Cyber criminals are great detectives. They unite scraps of information from various sources into a nefarious plan. Read More...

Speed up slow views through custom materialization

published on
SQL views are aluring as a means of abstraction; a “building block” to hide away commonly used complexity. It is no wonder then that us developers will try them out, and before you know it, your clever recursive CTE view on that hierarchy is used everywhere, by everyone, but how is it affecting overall database performance… They look like tables, can be joined on, selected from, and in some cases even updated just like tables, yet the reality is that they are not like tables. Read More...

Knapsack Bitwise

published on
An interesting bit of computer science, the knapsack problem has been studied for over a century, and according to Wikipedia, seems to be quite popular - as these sort of things go. For the first post in this series I’ll present a solution to the 1⁄0, or binary version of this famous problem I designed in 2015. I was immediately intrigued by it when I first read the problem statement. It’s application to anything requireing optimal resource allocation was very clear, and my mind started obsessively thinking of how to solve this efficiently. Read More...

CTE : simplify those nested sub queries

published on
This article examines how sub queries can be substituted for the far more readable common table expressions, or CTEs available in many RDBMS systems. I was motivated to write this article when a friend who is fairly new to SQL expressed difficulty in grasping queries containing nested sub queries. If you’ve never heard of CTEs before and you want to get the most out of this article, I recommend you get AdventureWorks2014 sample database and experiment a little with the queries below. Read More...

Categories

Algorithms (1)

Anomalies (1)

Best-Practice (1)

Bitwise (1)

C# (2)

Code-Contest (1)

Complexity (1)

Computer-Science (1)

Cyber-Security (1)

Data-Analysis (1)

Database (4)

Debugging (1)

Discrete-Mathematics (2)

Hierarchies (1)

Methods (1)

Minimalism (1)

Optimisation (2)

Optimization (1)

Performance (4)

Privacy (1)

Procedures (3)

Programming (3)

Querying (1)

Readability (1)

Simplification (2)

Source-Control (1)

Sql (5)

Sqlite (1)

T-Sql (4)

Transativity (1)

Version-Control (1)

Workflow (1)

Tags

algorithms (1) alias (1) awk (1) bash (1) big-ideas (1) bitwise-operators (1) brute-force (1) c (1) c# (1) cartesian-join (1) clustered-index (1) cte (1) cyber-security (1) full-join (1) gdelt (1) git (1) heaps (1) knapsack-problem (1) malware (1) merge (1) nonclustered-index (1) online-presence (1) physical-layout (1) privacy (1) rebase (1) recursive-cte (1) security-patches (1) social-media (1) sql (1) sqlite (1) stored-procedure (1) sub-query (1) tdd (1) trigger (1) view (1)