View MyKeyboardBindings.mkd
  • File structure (Navigate to functions, variables of the same class)

    cmd + r

  • Navigate Back to last cursor position

    cmd + [

  • Navigate Forward

    cmd + ]

  • Move Line/Lines up/down

View go_oop4.go
// Taking the same Go example as above
// Human and Student structs ....
human := Human{"John"}
// human will be passed by value, new copy will be created.
student := Student{human, 1}
View go_oop3.java
public class Human {
public String name;
public Human(String name) {
this.name = name;
}
}
public class Student {
private Human human;
View go_oop3.go
// Go’s syntax is very much like C, you should be fine
// reading it.
// Defining Human type, it has a variable Name of type string.
// (Yes, type is mentioned after variable name)
type Human struct {
Name string
}
// Defining a method GetName on the type Human which
View go_oop2.java
// the example is in Java
class Base {
private int i = 0;
void inc1() {
inc2(); // the change
}
void inc2() {
View go_oop1.java
// the example is in Java
class Base {
private int i = 0;
void inc1() {
i++;
}
void inc2() {
View kmp_algo.py
W = "acabacacd"
T = "acfacabacabacacdk"
# this method is from above code snippet.
aux = creatAux(W)
# counter for word W
i = 0
# counter for text T
j = 0
View kmp_create_aux.py
def createAux(W):
# initializing the array aux with 0's
aux = [0] * len(W)
# for index 0, it will always be 0
# so starting from index 1
i = 1
# m can also be viewed as index of first mismatch
m = 0
while i < len(W):
View string_matching_naive.py
# 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)
View doubleList.py
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