This file contains hidden or 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
def find_min(head): | |
if head.get_next: | |
next_min = head.get_next() | |
return head.value if head.value < next_min else next_min | |
return head.value |
This file contains hidden or 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
def find_sum(self): | |
current = self.head | |
total = 0 | |
while current != None: | |
total += current.get_data() | |
current = current.get_next() | |
return total |
This file contains hidden or 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
def get_total(head): | |
if not head: | |
return 0 | |
return head.val + get_total(get_next()) |
This file contains hidden or 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
words = file.read().split() | |
for word in words: | |
try: | |
word_dict += 1 | |
except EXCEPTION: | |
word_dict = 1 |
This file contains hidden or 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
from mongo import Mongo | |
import inspect | |
""" | |
Metaclass to simplify use of items stored in the database | |
""" | |
class DatabaseLinkMeta(type): | |
def __new__(metaclass, classname, bases, classdict): | |
mongo = Mongo() |
This file contains hidden or 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
package GUI; | |
import java.awt.BorderLayout; | |
import java.awt.CardLayout; | |
import java.awt.Dimension; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javax.swing.DefaultListModel; | |
import javax.swing.JButton; |
This file contains hidden or 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 String toArgument(){ | |
StringBuilder filterParam = new StringBuilder(); | |
//To make old code work | |
DrawTextFilter overlay=this; | |
filterParam.append("drawtext=fontfile='"); | |
filterParam.append(overlay.getFont()); | |
filterParam.append("':text='"); | |
filterParam.append(overlay.getText()); | |
filterParam.append("':x=(W/2)-(w)/2:y=5:draw='gt(t,"); |
This file contains hidden or 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
filterParam.append("drawtext=fontfile='"); | |
filterParam.append(overlay.getFont()); | |
filterParam.append("':text='"); | |
filterParam.append(overlay.getText()); | |
filterParam.append("':x=(W/2)-(w)/2:y=5:draw='gt(t,"); | |
filterParam.append(overlay.getStartTime()); | |
filterParam.append(")*lt(t,"); | |
filterParam.append(overlay.getEndTime()); | |
filterParam.append(")':fontsize="); | |
filterParam.append(overlay.getTextSize()); |
NewerOlder