If you run a facebook page or have a facebook app, Facebook collects oodles of data about who uses your app or page, when, and how. Facebook provides some pretty good analytics tools on their insights page, but there is … Continue reading
Fundamentally Incomplete
I am not a true statement. Not only is this sentence rather paradoxical in meaning (if it’s false, it’s true; it it’s true, it’s false), but it is also self-referential. This is rather an odd thing for a sentence to … Continue reading
Get all Full Text Search word breakers
I couldn’t find this anywhere online so I figured it out myself. You can run the below script to get all of the defined word breakers for a given language. That is, the characters that will be considered a word … Continue reading
Find area of a polygon
The following java method calculates the sum of a polygon given a list of the points in either clockwise or counter clockwise order: private double calculateArea(List<Point> orderedPoints) { //multiply each x coordinate by the following y int positiveDiagonalSum = 0; … Continue reading
Intelligence part 1 – A definition
It seems the general opinion (especially of sci-fi writers and doomsday predictors) is that eventually computer programs will become complex enough to be intelligent. In reality, there is nothing intelligent about most computer programs. Nothing. Making the programs more complicated … Continue reading
Expensive Dinner
Problem: There are N people going to a restaurant, entering one at a time. Each person is unhappy upon sitting down if the total bill does not equal a multiple of that person’s integer identifier. So, person “3″ will not … Continue reading
Markov Chains
A markov chain is built by tracking the order data occurs in. We can then take this observation and create new data that will closely resemble the initially observed data. With enough data to analyze, this allows the creation of … Continue reading
Bribe The Prisoners
Problem: You are in charge of a prison with P number of cells in a straight line. Each cell has a window on the walls it shares with the neighbor cells. You need to release a certain number of prisoners, … Continue reading
Quick Sort
The quick sort partitions objects into two groups, one group of the objects with a value above a certain value, and another group with a value below. Each of these groups is further divided, and this action continues recursively until … Continue reading
TSQL Index Mega-Query
This TSQL query returns a huge amount of useful information about indexes. You can see how much an index is used, how much space it is taking up, what columns are included, etc. It is a great first step towards … Continue reading