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()); |
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
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
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
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
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
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 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
#!/usr/bin/bash | |
get_focus() { [[ $1 == "true" ]] && echo 1 || echo 0; } | |
# read workspace data into an associative array | |
i=0 | |
focus=0 | |
declare -A ws_data | |
prior_monitor=0 | |
while read line; do |
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
class Facbook: | |
def __init__(self, token): | |
self.token = token | |
self.graph = facebook.GraphAPI(token) | |
self.profile = self.graph.get_object("me") | |
def get_friends(self): | |
friends = self.graph.get_connections("me", "friends") | |
# To extract names | |
# friend_list = [friend['name'] for friend in friends['data']] |
OlderNewer