Category: programming
-
Python – Check List of URLs
# -*- coding: UTF-8 -*- def main(): source=’/webdev/links-of-urls.txt’; destination=source+”.result” check_urls(source, destination) print(‘done!’) def check_urls(source, destination): with open(source, ‘w’) as fout: with open(source, ‘r’) as fin: for url in fin: pre=”ERR” try: data = urllib2.urlopen(url.trim()).read() pre=”OK” except: print(“Failed…”) fout.write(pre+” “+url) if __name__ == ‘__main__’: main()
-
CSS – Styling HTML Links – removing underline
Simple Link styling Link: This Link to Google is Red Code: Link: This Link to Google is Red Link styling for visited links Link: This Link to my Blog is always Green Code: In order to make sure that the link color “sticks” even for visited links, use the following CSS. Link: This Link to…
-
JavaScript – Check and uncheck Checkboxes
Choose Your Favorite Programming Languages Java Python PHP HTML JavaScript SQL | Code: Your Favorite Scripts & Languages Java Python PHP HTML JavaScript SQL |
-
JavaScript – Dynamically Change Title of Current Browser Page
Click Here To Change Page Title JavaScript Property: document.title Code: Click Here To Change Page Title
-
PHP – Reliable Array Size
Code: function size($array) { if (isset($array) && is_array($array)) { return sizeof($array); } return 0; }