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
-- Script that runs the other scripts in the proper order | |
-- Reset the value of scripts_path in case it was already set | |
UNDEFINE scripts_path | |
-- ask the user to set the scripts path | |
PROMPT Set the path to the directory in which this file currently is. | |
PROMPT (ex: if the path to this script is C:\SQL\_MASTER_SCRIPT.sql, | |
PROMPT then the path should be C:\SQL\ ) | |
PROMPT |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQENBFhwhlABCADbZSl4xWH4E/OlXKQXpFBN5QRG8UPbZlwtKFhVApRsL/bcJmsG | |
NxrSmbtB/zR9llVF9c1TqWl8OTW0uikwNfoJ2mFshBI69BFL2uz20G//SPKY0Pfr | |
XWCnXZR/rwy2WB7XjfbKFSRBlHDAZ8nm/UAlV+xmKGFbE21I2YmeeetY5mUobCLJ | |
RrUqBm9XVONjEAhUlnPECHgLb+f6VfFWE480qDhHK2l2Nq8893GCkCciq+HGAKJH | |
TGSdxGOYfsRIkvwM0Y5XsSlmBkMt+ZplLqQuvUpudyv4PU9iartzjFGrBrRb8F5y | |
Im3yey8SYLbx2LaFxoIBbTWy/y4EILndZOzLABEBAAG0JENocmlzIEMtVCA8Y2hy | |
aXN0aWFuLWN0QGhvdG1haWwuY29tPokBNwQTAQoAIQUCWHCGUAIbAwULCQgHAwUV | |
CgkICwUWAgMBAAIeAQIXgAAKCRA2RjO/yYA4/vUkCACUaz6INeNSDJS1DSXnJFQj |
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
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import javax.imageio.ImageIO; | |
import java.io.IOException; | |
/** | |
* Converts a png file to a jpg file | |
* WARNING: JPG does not support transparency! It will be replaced by white. | |
* @param imgName Name of the image file | |
*/ | |
public void png2jpg(String imgName) { |
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
import java.util.ArrayList; | |
import java.util.Calendar; | |
import java.util.List; | |
public class CalendarGenerator { | |
public static final int[] MONTH_DAYS = { | |
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | |
public static final String[] MONTH_NAMES = { |
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 static boolean isInString(String haystack, String needle) { | |
return (haystack.indexOf(needle) >= 0); | |
} |
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
# overwrite fname | |
def writeInFile(fname, data): | |
fhandler = open(fname, "w") | |
fhandler.write(data) | |
fhandler.close() | |
# append to new line in fname | |
def writeInFile(fname, data): | |
fhandler = open(fname, "a") |
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 getBetween(s, first, last): | |
try: | |
start = s.index(first ) + len(first) | |
end = s.index(last, start) | |
return s[start:end] | |
except ValueError: | |
return "" |
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
import urllib2,cookielib | |
''' | |
Function that returns the source from the target url | |
@param url | |
''' | |
def file_get_contents(url): | |
url = str(url).replace(" ", "+") # just in case, no space in url | |
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', | |
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', |
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
for i in range(101): | |
if i==0: continue | |
if (i%3==0) ^ (i%5==0): | |
print "fizz" if i%3==0 else "buzz" | |
elif i%3==0: | |
print "fizzbuzz" | |
else: | |
print i |
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 static boolean isInList(String[] myList, String element) { | |
for(String s: myList) { | |
if (s.equals(element)) { return true; } | |
} | |
return false; | |
} | |
public static boolean isInList(char[] myList, char element) { | |
for(char c: myList) { | |
if (c == element) { return true; } | |
} |