Archive for the 'XML' Category

SQL – XML in SQL Server 2000

September 13, 2006

I managed to try out the sp_makewebtask T-SQL stored procedure for exporting the result of an SQL query to XML file that I mentioned in an earlier post. I’m happy to say that it works a treat! I’m quite excited about it and would love to know if there is something similar for mysql now that stored procedures are supported (mysql 5).

The conversion is as simple as creating a .tpl file with the following (root can either be removed or changed to represent a doc type definition, much more useful then just root!):

<root>
<%begindetail%>
<%insert_data_here%>
<%enddetail%>
</root>

And then calling the stored procedurce in the query analyser, or however way you wish to call it.

sp_makewebtask @outputfile = ‘c:\temp\myxmlfile.xml’,
@query = ‘select * from sysobjects for xml auto’,
@templatefile = ‘c:\temp\template.tpl’

The result is an XML file created in c:\temp called myxmlfile.xml. I tried a few different queries such as: select * from customer where custID=1… which created a node called customer with the customer details as attributes.

<root>

<Customers custID=”1″ custFirstName=”John” custLastName=”Smith” custAddress=”123 Queen St”/>

</root>

I see this as being useful for sites such as del.icio.us where a user may want to export their url list to a file (del.icio.us actually offer this service, just using it as an example).

Advertisements

Java based RSS reader

August 12, 2006

As regular viewers will know I have been wanting to make a RSS reader for some time, mostly because it is something that interests and will be a great learning experience.

I have decided that I will do it in Java/Swing, and not delphi as originally intended. I want it to be as portable as possible and want to extend my java knowledge as this is the type of job I will be looking for next year.

That plan of attack is to use a JEditorPane and send a ‘chunk’ of xml (parsed) to it via a stylesheet to be viewed. For example I will have a tree on the left with the subscribed feeds, expanding a feed will display each topic in the feed, clicking that topic will then display the contents for that topic in the JEditorPane, as html via XML/XSL conversion.

This is somewhat to compensate for Java Swing’s embarrassingly lacking HTML/XML rendering components.

I read the article: Sun should Open Source Swing: what is bad for Gosling is good for propaganda over at O’REILLY, which echos my view. Very well written and informative article.

As per suggested in the article I may look for an opensouce XML rendering component at JavaDesktop instead of using the JEditorPane.
Either way, I’m looking forward to getting this up and running!

My original RSS (type) idea 7 years ago

July 10, 2006

I was in bed last night when it occured to me, I thought up an RSS type idea 7 years ago! I was 13 or so and had a southpark website with a collection of various media (all credited of course :)) and regularly checked the top southpark websites. There was a very good community and many of the top sites were friends with eachother.

I liked the idea (and still do) of having a website built based on seperate files (side bar, header etc) and after using frames for a bit I realised I could use an external javascript file with a series of document.write() statements. Frameless pages with seperated content! (I didnt know about server side scripting then!).

I then had an idea, what if all the major websites had a javascript file on their server with a standard name/location and made the location publically available? This file would contain document.write statements with a decription of the latest content. A website could place a series of these to show their visitors what the other sites are upto. I thought I could make a webpage designed for this purpose (a portal).

I never actually did this or looked into it much further, sadly. Now that we have XML this is exactly what is being done with RSS, I had the concept just not the greatest implementation!

Edit:

I recieved a comment on my digg submission which I found very informative and thought I should mention it here to ensure I have expressed my idea correctly!

The comment is as follows:

“I hate to break it to you, but RSS is over seven years old and the general concept is about a decade old. Your idea was not new or original in any way, in fact it came *after* the whole “push” fad had died down. I specifically remember that I was automatically downloading news, website updates and rich media (a.k.a. podcasts and videocasts in all but name) with Pointcast ten years ago.

http://www.tnl.net/who/bibliography/pointcast/

http://goatee.net/2003/rss-history.html

The current RSS hype is at least the third time this sort of thing has been popular. Internet Explorer 4 had CDF built in, which was very similar to RSS and could be displayed on Windows 98’s “Active Desktop” in much the same way lots of Apple Dashboard widgets display RSS and Atom feeds these days.” Jim

In direct response I would like to say the following:

I completely forgot about those services and feel very silly for not considering this! In my defense I’d like to point out I wasn’t a heavy power user back then and I didn’t really know about those features at the time. This was more my interpretation of what would be a good service (too bad it had been done!). I’ll read those links with great interest thanks for putting me right!

While XML syndication was available then it was still not widely used by many websites in the form it is now, and not with the ease my initial concept would have provided. RSS feeds for websites were not common.

Just to clear things up I was not trying to say my idea pre-dated XML syndication or anything just that without knowledge of this I came up with a concept that is similar to the RSS feeds that have grown hugely in popularity recently.

Now that we have XML this is exactly what is being done with RSS

Should have read, now the XML has become more common place

Holidays!

June 28, 2006

Well the holidays have finally come and I have finished all my subjects, hoping for good marks all round 🙂 Now that I have some more free time I will be able to update much more and get started on some projects I have been meaning to do. Currently my list is (in some form of importance from 1st to last) below:

  1. Create dump program. I have a really bad habbit of saving everything to the desktop and working from there. Each new semester I create new folders for each subject as well as a folder for reference, this usually lasts 2 weeks before it is a mess again. I have an idea how I can solve (inspired by using ANT with TomCat) this so will get out DELPHI tonight or tomorow.
  2. Host my blog and some friends blogs on a new server, get some experience with how wordpress works.
  3. Install a new harddisk and format my old one.
  4. Learn C# and make NoteThis! application, an application to store text based notes by tagging and saving. Will have an XML backend.
  5. Re-write my content management system into Ruby to allow more webhosting options and to learn ruby on rails.
  6. Make a Java RSS feed reader (Ideally will run from command line and will later add a gui)
  7. Get organised!

I’ll update with my progress on this as well as other development topics I come across.

Link dump and SPAM

June 21, 2006

I'm still finishing assignments and have been really flat out so this post  is just a link dump. I had a rather large collection of bookmarks in FireFox which was getting very hard to manage as well as many links going un-noticed (I'd forgotten about them). I decided to organise them by deleting them from FireFox and uploading them to my del.icio.us account. The result is much better managed bookmarks that I can access from anywhere as well as share with anyone interested. I am a huge supporter of social networking. (excluding myspace :P)

Links of interest:

XSPF: XML Shareable Playlist Format: Home

Nvu – The Complete Web Authoring System for Linux, Macintosh and Windows

APPLE VS MICROSOFT (WINDOWS VS MACINTOSH)

Dia – Wikipedia, the free encyclopedia

These are a select few of the links on my del.icio.us account. If you are interested in software development I suggest having a look as there are lots of good resources not in this list. Alternatively you can keep visiting this blog as I will be doing more link dumps as welll as a few write ups.

Lately I have been getting a large amount of spam comments which is very annoying, I'm going to have to start validating comments I think. 

Get in sync

June 15, 2006

As I move between different computers quite often I have been wanting some form of tool that syncs your browser settings between computers. I started to think of how I could make an application to do something like this using an intermediate server and firefox, but … Google has done it! Another great tool to the large list of quality Google services is Google Browser Sync. As suggested it syncs your bookmarks, history and form passwords as well as remembering what tabs you had open when you closed the browser window (a feature I have found to be extremely useful).  Another highly reccomended download.
I briefly mentioned in my post Hello World a while ago that I have been thinking about exactly what area of programming I'd like to ideally get into at the end of this year when my degree is completed. In contrast to what I wrote in that post (favouring low level programming) I think the area I'd like to get into is more server side applications, using languages/application such as XHTML, CSS, Java, XML, MySQL, C++, PHP, and Apache. These are what I will be focusing on from now. My industry project involves the research, design and implementation of a client server application which is directly related to this so it will be good experience.

I also have collected fair amount of bookmarks for various tech/development related topics which I need to organise (information isn't valuable unless its accessable 😛 . I will start uploading them to my del.icio.us account which I havn't been making much use of.

Holidays in a little over a week so I can begin on the various projects I have lined up, including the hosting of this blog and some friends. As well as getting my NoteThis application working. I'd like to set this up as an open source project if there is interest , to see what can be added as well as to learn from others how my programming can be improved.

Note this

June 4, 2006

I have been planning my new project and drew up a small prototype GUI in visio today:

Note This

Currently called note this (until I think of something better) the application will be a simple notepad that saves notes in an XML database with notes filed under categories (tags).

The idea for this came from realising there is a better way to storing notes such as passwords, emails, quotes, and other bits and pieces than to create seperate .txt files for each, which is what I have been doing. The GUI shown will be complemented with a viewer that allows saved notes to be easily viewed after being recorded. The beauty of this application will be its simplicity; when a note coms to mind simply open note this (from a keyboard shortcut) write the note, add some tags and save it. No file names, no locations, just gone!

There will also be an export option.

I get to start it in 3 weeks and hope to have it done in 3 weeks from then. I will post progress updates! 

Java Java Java

May 26, 2006

I have spent all day trying to get my java application (just a test application) to connect to MS SQL server 2003 from a Linux box. My code compiles and I am using the jTDS JDBC driver which allows me to connect to the server without having to use the ODBC-JDBC driver which is buggy and not recomended for production use, although it is fine for the prototype I am doing. I am getting ClassNotFound exceptions so I'm obviously setting up the driver wrong.

Among my travels I did come across The DocBook Project. Looks like it would be very useful for documentation I plan to start using this soon.

I was also going to add a music page to my blog today with some of my personaly picked essential albums and artists to look out for. I'll proberly end up doing it tomorow now as the Java stuff took much longer than expected!

I really should update my about me page too! 

Learning C#

May 15, 2006

For my up and coming industry project I have decided what ever it is I decide to do, I will be doing development work with C# (pronounced "See Sharp"). This is because I have never used it and it looks like a very capable programming environment. I am familiar with Java programming so it should be a fairly easy transition. There are also increasing jobs for C# and decreasing jobs for Java programmers in the entry level positions and positions targeted as graduates. This is not always the case but I see having C# on my resume as a very good advantage.

There are lots of conflicting arguments on the web on the Java vs C# debate and I'll do a proper writeup myself when exams are done (there are going to be some pretty good posts in 4 weeks!). We all know Microsoft has always had an interest in Java, or seen it as a large threat. Their answer? C#. From what I have seen of C# it is very good, Java/ C++ like syntax and extensive XML capabilities, as well as all the features the .net framework provides. C# has gained huge industry recognition as can be seen with the many companies/ workshops porting existing applications to C# and the large number of C# programming jobs available.

Over the holiday break I'm going to purchase a book and start having a go! I still really like Java programming and find Java to be as capable as C++ in many situations, as well as its cross platform support, and the non Microsoft workshops obviously are usually more Linux, open source friendly which is important to me. I would like to specialise in Java at a high level some day.

Songbird

April 29, 2006

Ive just download Songbird and have been playing with it a little, havn't used it enough for a review or anything yet but first impressions are good 🙂 What interested me most though, was that it is programmed using XUL and the Mozilla engine. Songbird is a good example of this technology, the concept of using XML, ccs and javascript (many of the technologies that bring as AJAX) to define an interface. It is also cross platform which I like as well as open source, which I like even more!

Songbird can be found at Songbirdnest.com.

I'm thinking of doing either an image format or sound format comparison as well, for example comparing tiff, png, jpg in terms of compression, support(image programs, browsers) I think that will be quite interesting!