
coffee spiller | discipline doesn’t scale
Bengaluru🚦
Joined June 2022
- Tweets837
- Following558
- Followers492
- Likes8.1K
Guts 𒉭 retweeted
The least realistic thing about GTA VI is that Jason and Lucia run a whole criminal operation without a single Telegram group.
Guts 𒉭 retweeted
Here's something interesting about LIKE in SQL - it is prone to injection and exploitation. It is unlike SQL injection, but still pretty dangerous. Hear me out...
A simple search feature can be (and probably is) implemented using a LIKE query. This is easy to exploit when the user-provided input contains wildcard characters.
When a wildcard percent sign (%) is given at the start of a user-provided query, and you take this and pass the string as-is to the SQL query under a LIKE clause, the database will treat it as valid input and execute it.
Because LIKE now starts with '%', the database performs a full table scan to find matching rows for the column.
So, if a normal email search completes in 0.01 seconds, but percent signs get inserted at the beginning, the same query can jump to 0.91 seconds. On larger tables, this gap widens significantly.
As you can see, this exploitation is pretty trivial to pull off. Someone could input patterns like `%a%`, and your query would scan through almost the entire table.
This isn't full SQL injection where arbitrary commands get executed, but it's still a denial-of-service. Attackers can slow down your database and exhaust connections.
The fix is straightforward: escape the LIKE metacharacters (`%`, `_`, and the backslash itself) before using user input in LIKE clauses. Most frameworks do not provide built-in helpers for this, so you will need to write your own escaping logic.
Just check your framework's behavior with LIKE queries and inputs, and thank me later :)
Guts 𒉭 retweeted
Let me talk about something obvious but with a bit of quantification...
Theoretically, both arrays and linked lists take O(n) time to traverse, but here's what actually happens when you benchmark by summing 100k integers
- Array: 68,312 ns
- Linked List: 181,567 ns
Summing an array is ~3x faster than LinkedList. Same algorithm, same complexity, but wildly different performance.
The reason is cache behavior. When you access array[0], the CPU fetches an entire cache line (64 bytes), which includes array[0] through array[15]. The next 15 accesses are essentially free. Arrays hit the cache about 94% of the time.
Linked lists suffer from pointer chasing. Each node is allocated separately by malloc(), scattered randomly in memory. Each access likely requires a new cache line fetch, resulting in a 70% cache miss rate.
This is a good example of why Big O notation tells only part of the story. Spatial locality and cache-friendliness can make a 2-3x difference even when the theoretical complexity is identical.
I am sure you would have known this, but this crude benchmark quantifies just how fast cache-friendly algorithms can be.
Hope this helps.
Guts 𒉭 retweeted
gotta love seeing 95% of crypto down because of an AWS outage
very decentralized - great work lads 👍
Guts 𒉭 retweeted
I don’t want to pick an app and build a web3 version of it…
I want to bring web3 to real world and make it private :) and fck digital surveillance!!
Guts 𒉭 retweeted
why limit yourself to someone else's preference?
go build a db
go build a framework
go write a file system
go write a webserver
go build an ORM
go build an agent
build whatever excites you
You have all the resources in the world to build literally anything you want.
Guts 𒉭 retweeted
The best advice so far from himself @kunalstwt , for Tier 3 college's
Guts 𒉭 retweeted
it took me 25 years to realize that the most underrated love language is making someone laugh when they are taking life too seriously
Guts 𒉭 retweeted
People who didn't even know about Ghibli, never watched their movies, and called anime just a cartoon are now creating "Ghibli images" because everyone else is doing it and it's aesthetic. What do you call such people?




















