Skip to content

Instantly share code, notes, and snippets.

View bigntallmike's full-sized avatar

Michael T. Babcock bigntallmike

View GitHub Profile
public class OrderedArrayList<T> {
private ArrayList<T> data;
private int searchpos;
public OrderedArrayList(ArrayList<T> data) {
this.data = data;
searchpos = 0;
}
public boolean contains(T other) {
@bigntallmike
bigntallmike / listintersection.java
Last active March 4, 2020 18:26
Find the intersection of N lists contained in SearchResults
if (SearchResults.size() == 1) {
DATA = SearchResults.get(0);
} else {
/* Find the smallest list */
int baseitem = 0;
for (int i = 1; i < SearchResults.size(); i++) {
if (SearchResults.get(i).size() < SearchResults.get(baseitem).size()) {
baseitem = i;
}
}
@bigntallmike
bigntallmike / rebuildraid.py
Last active February 14, 2020 19:21
Rebuild raid concept
#!/usr/bin/python -ttu
#
# For a set of disks that were previously in a RAID set, build an image of the data such as it was,
# ignoring parity.
class RAIDDEV:
def __init__(self, DEVICE, OFFSET=0):
self.DATA=file(DEVICE, r)
self.DATA.seek(OFFSET)