Bypassing checks for apostrophes in a database

by Max Dulin, 2018

Background An SQL injection is when the input is crafted to to where the user can manipulate the database to do something unintended. Given a user and password storage, a query may look something like: SELECT * FROM users WHERE password = var1 AND…

Consensus Problem

by Evan Conrad, 2018

The consensus problem in parallel computing is the problem of getting several processes to decide on the same answer. In order for it to be “solved” they must: Decide on a value if they have not crashed (Termination). Agree on the same value…

CAP Theorem

by Evan Conrad, 2018

The CAP theorem asks you to pick two of the of the following three benefits in a distributed storage system or database: C onsistency A vailability P artition Tolerance Dividing a Database Often, you may want to split up or duplicate your database…

Bernstein Conditions

by Evan Conrad, 2018

Bernstein conditions are a set of formal rules that will let you determine if two pieces of code can be run in parallel. These rules are as follows: The inputs into the first piece of code cannot be the same memory as the outputs of the second piece…

Data Dependencies as Polytopes

by Evan Conrad, 2018

We've seen before that we can represent data dependencies as a graph. But we can also represent them as a polytope ! Instead of a solid shape, we'll use a lattice or a series of points on a grid that loosely resemble a polygon. Example In the…

Data Dependencies

by Evan Conrad, 2018

A data dependency is a situation in which one part of a program depends on another's memory in order to work. Example Data dependencies cause problems when creating parallel programs because each line must run sequentially. As a graph Like any…

Polytopes 🔺

by Evan Conrad, 2018

A polytope is a generalization of polygon (2d) or polyhedron (3d) for any number of dimensions. To put it another way, a polytope is an “n-dimensional” object. A polygon would then be a "2-dimensional" polytope and a polyhedron would be a "…

Convex Sets (big ol' blobs)

by Evan Conrad, 2018

A convex set is a set of points where you can always draw a straight line between one point and another. Example Convex set Example Not-convex set Note that since the points in the red line are not in our set (big ol' blob), then we can say it's…

Voronoi Diagrams: Not Delaunay Triangulations

by Kathrine Gibson, 2018

Voronoi Diagrams split an area up with polygons that each have a generating point. Each subsequent point in the polygon is closer to the generating point than any other. Voronoi diagrams and Delaunay triangulations are related to each other , but…

IP Address Encodings for Browsers

by Maxwell Dulin, 2018

Typically, an IP address is seen in the form x.x.x.x, which is four octets that are hexadecimal, going up to 255. But, an IP address can be interpreted in multiple ways depending on the browser... I did all of these on the Chrome Browser, but Firefox…

Affine Transformations

by Evan Conrad, 2018

An affine transformation is a function that maps one vector to another. Python Example In the following example, we'll create an affine transformation that translates an x and y coordinate such that every point is moved right 10. If we apply this…

Delaunay Triangulation

by Kathrine Gibson, 2018

Delaunay Triangulation is a trigonometrical technique that creates a triangular mesh, avoiding sliver triangles. Here's a more formal definition. How to Implement There are five algorithms to compute Delaunay triangulations but all rely on the…

Iteration Domains: Let's Draw Shapes

by Evan Conrad, 2018

An iteration domain is the total range of values that a program is iterating over. Example Take the following code: If we plot a point at every i and j value, we've mapped the "iteration domain" of the program: Source

Loop Unrolling and Code Optimization

by Evan Conrad, 2018

Loop Unrolling is an optimization technique that reduces overhead by removing instructions that control the loop such as iteration: i++ or end-of-loop tests: i < 5 . Static vs Dynamic Loop Unrolling If the programmer discovers the overhead and…

Little's Law

by Evan Conrad, 2018

Little's Law is a theorem in queueing theory that the average number of items in a queue is equal to the average arrival rate multiplied by the average time the item spends in the queue. Expressed in code, this looks like this The interesting bit…

[Meta] How to Publish

by 🤐 Anonymous, 2018

Welcome to Bits, GUMAD's tech blog. "Bits" is designed for small articles that explain complicated tech topics. The idea is to be axios but instead of talking about capitalism we talk about CAP theorem. Articles must be fewer than 150 words…