Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
def compute_suffix_table(pattern)
suffix = []
index = 0
cur = pattern.length - 1
pattern.reverse.each_char do |c|
if index == 0
(1...pattern.length).reverse_each do |i|
@betamike
betamike / FetchTest.m
Created August 17, 2011 20:25
fmdb test case
//test method which roughly mimics how I normally fetch results
-(NSTimeInterval)fetchResultsTest
{
static NSString * const selectFavorites = @"SELECT songId, title FROM songs LIMIT 50";
NSMutableArray *fetched = [NSMutableArray array];
FMResultSet *resultSet = [[self database] executeQuery:selectFavorites];
NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
-(void)sendLogs
{
NSString *logsPath = [[NSFileManager pathToDocumentsDirectory] stringByAppendingPathComponent:@".logs"];
NSArray *filenames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logsPath error:NULL];
if (filenames == nil)
{
return;
}
<<<<<<< HEAD
static NSString *const selectEmptyPlaylists = @"SELECT DISTINCT p.playlistID FROM playlists AS p LEFT OUTER JOIN playlists_songs AS ps ON p.playlistID = ps.playlistID WHERE ps.songID IS NULL";
=======
>>>>>>> Fixed bug: deleting offline (and all) songs from a playlist does not clear the playlist offline songs count
FMResultSet *emptyListSet = [db executeQuery:selectEmptyPlaylists];
NSMutableSet *emptyPlaylists = [NSMutableSet set];
while ([emptyListSet next])
{
tagName = e.target.nodeName.toLowerCase();
if (that.focusedInput) {
that.focusedInput.blur();
that.focusedInput = false;
}
if (tagName === "select" || tagName === "input" || tagName === "textarea") {
//e.target.focus();
e.target.dispatchEvent("touchstart");
<html>
<head>
</head>
<body>
<script>
mopub_ad_unit = 'agltb3B1Yi1pbmNyDQsSBFNpdGUY0ZOZEww';
mopub_ad_width = 300;
mopub_ad_height = 250;
</script>
<script src="http://ads.mopub.com/js/client/mopub.js"></script>

Keybase proof

I hereby claim:

  • I am betamike on github.
  • I am betamike (https://keybase.io/betamike) on keybase.
  • I have a public key whose fingerprint is 9C10 CBEC A5A4 DD69 67CA 4F7A 9B11 4689 C03C 7D02

To claim this, I am signing this object: