Saturday, March 29, 2008

XML minInclusive and maxInclusive

Problem: I originally built a xsd Schema for a xml file. The element I was designing was a "cpostcode" that has a restriction of 2000-7999. This was my code and then the error.

Original Code

<xsd:element name = "cpostcode">
<xsd:simpletype>
<xsd:mininclusive value = "2000">
<xsd:maxinclusive value = "7999">
</xsd:simpleType>
</xsd:element>
Error was complaining about minInclusive tag.


Solution: A restriction tag is needed for minInclusive and needs a attribute type.

Solution code is as follows
<xsd:element name = "cpostcode">
<xsd:simpletype>
<xsd:restriction base="xsd:integer">
<xsd:mininclusive value = "2000">
<xsd:maxinclusive value = "7999">
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
I added a restriction type with a base of xsd:integer around the minInclusive and maxInclusive tags.

Tuesday, January 22, 2008

ASP Retrieving Login Name

Issue: I wanted to retrieve the user name that is currently logged in using Visual Basics in the ASP.NET Environment. I had used the built in logging in system

Solution: Using the following code retrieves the text need.

HttpContext.current.user.identity.name

Note: Thought was important to Blog due to always referring to it.

Sunday, December 23, 2007

SQL Confusion

Problem: I have learnt SQL using an Oracle database at university and tried to use the keyword sequence when developing SQL for MSSQL.

Solution: MSSQL does not support Sequence and after some research I found a solution from this article:

http://www.pcbuyersguide.co.za/showthread.php?t=4104

The solution is to use this code

CREATE TABLE [dbo].[Customers] (
[pk_ID] [int] IDENTITY (1, 1) NOT NULL ,
[sValue] [char] (10) NULL ,
[sDesc] [char] (10) NULL ,
[iOrd] [numeric](18, 0) NULL
) ON [PRIMARY]
GO
using Identity will allow a start point and to increment each record that is added to the databse.

Monday, December 17, 2007

Icon not appearing in HTML pages using Inernet Explorer

Problem: Icon not appearing when linking an icon to a HTML page in Internet Explorer but appearing in Firefox

Solution: The code below shows what I had used on the a HTML page:

< rel="icon" href="images/intefaces/riskStrategies40x40.ico" type="image/x-icon">


***Note "link" should appear before "rel"***

After some research, this was the code I ended up using:


< rel="icon" href="riskStrategies40x40.ico">

***Note "link" should appear before "rel"***

The icon must be in the root directory and an absolute address. Also the type was deleted. Not sure of the reasoning why it did not work in the first place but does now in both Internet Explorer and Firefox

Tuesday, November 13, 2007

Network Issues at Outdoor Swimming Pool

Situtation: Two computers Networked together for purposes of printing and tending of money through Centaman Systems.


Problem 1: Computers were not talking.

Solution: Not sure what had happened before I had got there but just made sure they were both plugged in and that the network connections were enabled. All worked then.


Problem 2: Centaman was not loading on slave machine, bringing up an error about "Could not find Computer Destination Address".

Solution: Again, not sure what had happened before me but the computer name had been changed and centaman can not change the computer name it looks for. To fix this, I had changed server computer back to what it was looking for and then it worked.

Payment was a Tim Tam Cornetto. Should try it.

Google and Frames Issue

Problem: The ACOHS Risk Strategies website that I am currently working on has dropped positions on Google as well as there is no link on Google to the home page. The site is based on frames and because the link is not directly to the home page, the site looks incomplete.

Solution: I have researched a lot to find a temporary solution for the time being. I have come across this site:

http://searchenginewatch.com/showPage.html?page=2167901

Which gives a guide to implementing a solution. It first speaks about "noFrame" browsers and how to control that. Also speaks about search engines having great difficulty in reading the site. What I have done that has been spoken about in this article is used the line of JavaScript in each page:

< SCRIPT LANGUAGE="JavaScript" >
< !-- if (top == self) self.location.href = "index.html"; // -- >
< / SCRIPT >

What this does is ensures that if the page is loaded and has no frames around it, it will link back to the page with links in it.

Not a complete solution but for now, it will do.

Monday, September 24, 2007

Websystems 2: PHP CGI error

Problem: An CGI error kept occuring when inserting data to the database and could not find the problem

Solution: Missed some simple code

oci_free_statement($stmt);

The statement was not closed which created errors. Fairly simple error but may happen again