Showing posts with label firefox. Show all posts
Showing posts with label firefox. Show all posts

Sunday, December 24, 2006

RDF support in Mozilla

nsIRDFSerivce. The RDF service is an utility interface that serves three primary purposes. First, it is used to manage “named” datasources. A named datasource is a singleton datasource that can be acquired using simple URI-like name [4]; e.g., rdf:bookmarks. Second, it is used to implement the function that maps a URI to a resource (which is the inverse of the one-to-one resource-to-URI function described above). Third, it is used to implement the function that maps a string value to a literal (similarly, the inverse of the one-to-one literal-to-string function described above).

nsIRDFNode. This is an interface for a node in the RDF graph. A node must either be an nsIRDFResource or an nsIRDFLiteral [5]. Objects that implement these interfaces must be acquired from the nsIRDFService.

nsIRDFDataSource. This is the interface that provides access to a collection of “related statements” (or a “subgraph”). This interface includes methods that allow testing for the presence of a statement, enumerating the statements contained in the collection, and adding and removing statements to the set.

nsIRDFCompositeDataSource. This interface is derived from nsIRDFDataSource. An implementation of this interface will typically combine the statements from several datasources together as a collective. Because the nsIRDFCompositeDataSource interface is derived from nsIRDFDataSource, it can be queried and modified just like an individual data source.

nsIRDFObserver. This is an interface that an RDF client implements. The interface allows a client to be notified when a change occurs to the statements in a datasource.

nsIRDFContainer. This is an interface that allows for simplified access to an RDF container object (a bag, sequence, or alternation). This interface, in conjunction with nsIRDFContainerUtils provide straightforward, Java vector-esque methods for manipulating and querying RDF container objects.

I've also updated a few sections on MDC's RDF FAQ.

Tuesday, December 19, 2006

My day job project is down all in FireFox. We just can't image how to write web applications with FireFox and all its wonderful extensions. There have been many friends who asked me which FireFox extensions I use for web development. Well, I can never give them a full list until I ran into this list: http://lesliefranke.com/files/firefoxwdev/firefoxwdev.htm

Wednesday, December 13, 2006

"""

Synchronize FireFox 2.0 and Microsoft Dictionaries
Author: Alex Dong
Email: $ python -c "'YWxleC5kb25nQGdtYWlsLmNvbQ==\n'.decode('base64')
Blog: http://thetruelight.blogspot.com/
License: GPL
ReadMe:
Please change the 'word_dict_path' and 'ff_dict_path' to point
them to your local directories.
"""

word_dict_path = 'c:/Documents and Settings/adong/Application Data/Microsoft/Proof/custom.dic'
ff_dict_path = 'C:/Documents and Settings/adong/Application Data/Mozilla/Firefox/Profiles/yl9sxfvv.default/persdict.dat'
wd = open(word_dict_path).readlines()
fd = open(ff_dict_path).readlines()

def merge(a, b):
c = [i for i in a]
for i in b:
if c.count(i)==0: c.append(i)
return c

l = merge(wd, fd)
l.sort()

def update(f, l):
fp = open(f, 'w')
fp.writelines(l)
fp.close()
update(word_dict_path, l)
update(ff_dict_path, l)

print "Updated %d entries"%((len(l)-len(wd)) + (len(l)-len(fd)))