// Adapter code
public class CustomAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
ArrayList<String> mItems;
public CustomAdapter(Context context, ArrayList<String> items) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var easing = { | |
linear : function (t){ | |
return t; | |
}, | |
easeInQuad: function (t) { | |
return t*t; | |
}, | |
easeOutQuad: function (t) { | |
return -1 *t*(t-2); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Node = function ( data ) { | |
this.data = data; | |
this.next = null; | |
this.previous = null; | |
} | |
var LinkedList = function () { | |
this.first = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your backup folder | |
cd /backup | |
# make sure mongod instance is running | |
mongodump --db dbname --out ./ | |
# above line will create a folder dbname | |
cd dbname | |
# migrate to mongolab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ResizeAnimation extends Animation { | |
final int startWidth; | |
final int targetWidth; | |
View view; | |
public ResizeAnimation(View view, int targetWidth) { | |
this.view = view; | |
this.targetWidth = targetWidth; | |
startWidth = view.getWidth(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built application files | |
*.apk | |
*.ap_ | |
*.aab | |
# Files for the ART/Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import random, math | |
outputdebug = False | |
def debug(msg): | |
if outputdebug: | |
print msg | |
class Node(): | |
def __init__(self, key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoubleList(object): | |
head = None | |
tail = None | |
size = 0 | |
def append(self, data): | |
new_node = Node(data) | |
if self.head is None: | |
self.head = self.tail = new_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoubleList(object): | |
head = None | |
tail = None | |
size = 0 | |
def append(self, data): | |
new_node = Node(data) | |
if self.head is None: | |
self.head = self.tail = new_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here is the working code of the naive approach. | |
def bruteSearch(W, T): | |
# edge case check | |
if W == "": | |
return -1 | |
# getting the length of the strings | |
wordLen = len(W) | |
textLen = len(T) |
OlderNewer