Pages

@i Blog Posts

Saturday, January 22, 2011

Blog moved to Wordpress

My not so active blog has been moved to Wordpress.


http://ahm3dibrahim.wordpress.com

I have a strong feeling that I will have more posts this year compared to 2010. :P

Monday, May 31, 2010

HTML DOM USING .NET

By Ahmed Ibrahim

Today the software development landscape has evolved significantly with the proliferation of Web technologies. Thus a majority of applications developed have some form of connectivity or integration with another application, web service, web application, remote database, etc.


This article will therefore try to touch one specific area, which is HTML content and DOM. And in doing so will investigate two approaches available in .Net which can be used to fuse these two for some practical purpose.

Examples provided are based on .Net code and libraries. However, the concepts remain the same for HTML and DOM are independent from any programming language. This article is not exhaustive in any manner however references are provided for those seeking a more in depth coverage.


Demo Application Screenshot

Full Article on Code Project...

Monday, April 21, 2008

Free[dom] Licenses

If you are interested in distributing or uploading code, documents, etc., under the claim that it's free, you might find the following link interesting.

http://www.codeproject.com/info/Licenses.aspx

Wednesday, January 2, 2008

Tuesday, December 11, 2007

My first Py

A simple python script to retrieve prayer times form islamicfinder.com. Simply replace the prayerUrl variable to change the location to your preference.




## .-`-. o
## .' .-. `. .
## | ( ) ; |
## `. `-'`'-' `-
## `---
## PrayerTimes v1.0
## 10.12.07

import urllib
from sgmllib import SGMLParser

class TBLParser(SGMLParser):
def reset(self):
SGMLParser.reset(self)
self.doit = 0
self.cols = []
self.rows = []

def start_td(self, attrs):
for k, v in attrs:
if attrs == [('class', 'IslamicData'), ('bgcolor', '#FFFFFF'), ('align', 'center')] or \
attrs == [('class', 'IslamicData'), ('bgcolor', '#FFFFCC'), ('align', 'center')]:
self.doit = 1

def end_td(self):
self.doit = 0

def handle_data(self, text):
if self.doit == 1:
self.cols.append(text)
if len(self.cols)%8 == 0:
self.rows.append(self.cols)
self.cols = []


prayerUrl = "http://www.islamicfinder.org/prayerDetail.php?country=australia&city=perth_city&state=08&zipcode=&lang="
sock = urllib.urlopen(prayerUrl)
html = sock.read()
sock.close()

parser = TBLParser()
parser.feed(html)
parser.close()

for row in parser.rows:
for col in row:
print "%5.5s" % col,
print "\n"



Thanks Gold Flake Linux for the inspiration :)

.::.::.