Jump to content

AbstractApproach

Members
  • Content Count

    25
  • Joined

  • Last visited

Everything posted by AbstractApproach

  1. Why am I not surprised...I still live at home, so I am spared the evils of dorm life (and in turn, presented with a different evil: a 1 hour commute).
  2. XAMP= X (os)+ Apache + MySQL + PHP. XAMP in a generic term which includes both WAMP and LAMP.C++ as a web language is not where it's at. while it is certainly possible to use Managed C++ (which, frankly, isn't even real c++ anymore) under .Net (in fact it's possible to run Cobol under .Net and use it if you like), it was not designed for that purpose, and is thus a bit counterproductive. C# and VB are much better options in this sense.
  3. Microsoft Visual Studio 2005 Professional Edition.Yes it's unconventional, and yes it's expensive, but it is awesome for doing ASP.Net development
  4. I could see this as a neat feature, but I think that the cost of hosting, plus the demands of maintaining this thing would be way beyond the benefits that a few would gain from yet another free web host.While I know its not possible for absolutely everyone, I would recommend that everyone who is serious about doing web development purchase some serverspace somewhere. Save up a bit, and bite the bullet. Space can be had anywhere from $6/month at Powweb for 20gigs + PHP/MySQL/CGI to $3/month at GoDaddy for static pages. $3/month is only $36 for a full year, which is within almost everyone's reach.I remember when I bought my server space, it was a big deal for me (back then it was actually $100/year for 5 gigs at Powweb). I wasn't sure if I'd be able to use my space, if I had wasted money, etc. I've never regretted it, and still have my space (though now it's much cheaper, and I have far more space). I got a free, real domain name, which looks much better than something ending in .tk.Free web hosting is great for making a quick page about something to share with some friends. However, it's limited flexibility makes it all but useless for learning, and its freeness makes it totally unsuitable for business hosting.In any case, given my position, I believe it would a supreme waste of time, effort, and money for this site to attempt to add to the free web space flurry....let's instead let them concentrate on doing what they started this site to do: writing some tutorials, and maintaining the ones they have (which is more than a full time job).//Matt
  5. Right- PHP includes work well, but you have to have server side scripting access.
  6. Ok, well, why not:My name is Matthew Schultz, I am the web designer, developer, engineer, artist, manager, owner, and everything else at Abstract Approach Digital Solutions, which is my little one-man band...err company. I specialize in ASP.Net, especially MSSQL, XML, and C#. I know most (certainly not all, just most of the really important ones) everything else, at least in some part (the last time I made a list, it was too long to post). I've been coding for about 9 years (which is odd considering I'm 18..and also explains why I'm familiar with so many languages/standards), one year of which has been professional (or, at least, for hire). I am a computer science (duh) student at Arizona State University.I'm here mostly to help others out...I do so mostly because it helps me learn things more completely. Nothing is truly mastered until you can teach it to another....and so such is my goal on this forum.I like music, mostly instrumental (of any genre basically), and I dabble in composing with my keyboard (which sucks (I never thought a keyboard could crash, but I was wrong...this one crashes more than IE7 on Windows ME)..almost as bad as most of my music).I also like chess, and played competitively for several years (I stopped because I have more important things to do). I also experiment with algorithmic art, mostly in the form of fractals.So basically I'm a programmer nerd who will lose his eyesight by 30 to his crt (I love my 2048x1536 monitor with nice warm colors...try to get that in an lcd for under $1000...) monitor after staring at it for upwards of 12 hours a day (but hey, I can play both the keyboard and chess blind, so no worries).//Matt
  7. I get most of my information on this particular subject from Wikipedia, with some coming as well from the w3c documents (which I try to avoid reading where possible, since they are very hard to read, but are always fully informative). If you're interested in the subject, the WP article on URI is a very good place to start. They also cover IRI, which I did not..... Thanks, I'll keep that in mind (hopefully my explanations will turn out at least slightly better than the w3c documents).//Matt
  8. Nope. Schema doesn't care about anything but element names. (read my other post Here for more about schemas and what can, cannot, should, and shouldn't be done with them, along with a more theoretical definition of XML).Your solution here, however, is simple: inheritance: <schema xmlns="...schema ns..."> <complexType name="rowType" abstract="true"> <element name="row_id" type="string" /> <element name="row_country_code" type="string /> <!--and all the others (but Neither issuers nor private--> </complexType> <complexType name="issuers_rowType"> <complexContent> <extension base="target:rowType"> <element name="issuers" type="integer"/> </extension> </complexContent> </complexType> <complexType name="private_rowType"> <complexContent> <extension base="target:rowType"> <element name="private" type="integer"/> </extension> </complexContent> </complexType></schema> //Matt
  9. AbstractApproach

    Please Help Me

    It uses sessions. Here's the basic concept:Get user credentials with a form Validate them on the server with server data If validated, track their progress with a session so that pages know which user is which Design pages that only work in the presence of that session. These pages are therefore only accessable if logged in. This is not the place to explain exactly how sessions work, there are plenty of other places which do.
  10. The best way I know of to make color schemes is to use an image, preferably a picture of something in nature, and take at least two and at most five distinct colors from it, then maybe a few shades of each to make up your scheme.Using your image in the page then becomes a good idea, of course.But if you made me choose, with those colors, I'd probably use some sort of high saturation red, maybe something like #fa0105 or something similar.//Matt
  11. That's a fairly big task, and well beyond the scope of a simple explanation of concept. What you're talking about is session management, and you need to make all of the different sessions work together, which means you need to understand the session models for each case, then write something that will transfer them. I'm not sure how much experience exactly you have, but if you're completely new to php, this is a pretty bad intro project; try some simple things like dynamic pages and data accesses first. Work your way through php tutorials (start with the w3cs one, of course), do exmple projects, and learn the ideas of web programming a bit more. While your there, learn the internals of phpBB, especially its session system (which is MySQL based) along with your other systems. Beyond that, if this is mission-critical, I suggest hiring a coder, I'm sure you can find one for a small project like this for fairly cheap.//Matt
  12. Sounds like malware to me (almost always the answer to any IE problem).Might I suggest Firefox (ok, and for completeness Opera also).//Matt
  13. Not much. In general, an IDE is a text editor with features geared towards programmers, ranging from simple context coloring of code to complete development, project managment, source control, build/compile tools, and others.Notepad is a text editor. Visual Studio, Eclipse, and Dreamweavers are IDE's.
  14. yeh true, didn't think of that one....
  15. Your only hope is javascript. What you do is convert the HTML you want to to keep constant throughout pages into javascript by writing it with document.Write(). Turn your code into a function, then put the function in a .js file, include it in the head tag of whatever pages you need the content in. Then just call your function in the document wherever you need the content (instead of directly copying the content). Now, when ever you need to change that content, simply edit your javascript function.//Matt
  16. Depends on exactly what you're trying to do. If you're trying to standardize, say, a header, than the best way to do it is with server-side-include, in your favorite server-side language.If you can't use server-side, you can use javascript to write it into your file, though that becomes annoyingly verbose really fast.//Matt
  17. Going for PHP: Its totally opensource (it runs on apache or IIS) It's more common than ASP (in terms of raw number of websites using it) It's easier to learn from HTML It comes in XAMP (the only really easy to configure server) Most free CMS systems use it MySQL is really easy to use with it. It runs on linux Against PHP: It's butt ugly ($ gets old really fast). It's only for the web (yes technically you can run it on something else, and technically you can run linux on my microwave. But neither is very useful). For .Net It's clean, in 2.0, with partial classes and code-behind separation of code and HTML. It's usually, if well written, a hair faster than comparable PHP. Visual Studio can write around 50% of it for you, saving you months of time. Visual Studio Pwns notepad. C#, VB, and Managed C++ work either in ASP.Net (web) or on your Machine. Against .Net It doesn't run on linux (meh...so ok there's mono, but who's going to trust a major web enterprise with that? I mean besides Novell.) Without Visual Studio, it's really, really hard. As for ASP:ASP and ASP.Net are remotely related, but the relationship is not a really close one. ASP is its own language. ASP.Net simply refers to the idea of IIS running stuff on the CLR to generate pages. You do not have to know ASP to learn ASP.Net, and like aspnetguy, I also discourage it, since it teaches some very, very bad habits (like lack of code separation, and total unmaintainability).MSSQL:M$'s SQL database server. The express edition is free and will do everything that anyone could need unless their company has over 100 employees. Period. Is usually considered faster and more secure than MySQL, though this is not absolutely true. Only runs on windows.SQL has nothing whatsoever with Access databases, which are all but totally outdated and reserved to the role of backwards compatibility support. Do not make anything with them, use either XML or SQL (or Oracle I IIS:M$'s webserver. Comes with windows, however, the new version, IIS6, which is the only one to run .Net 2.0, only comes with server 2003, which bites.//Matt
  18. Mozilla, like most anything else, will use the button of type submit if you hit enter: <input type="password" id="pw"><!--Doesn't work: <input type="button" value="Submit">--><input type="submit" id="btnSubmit" value="Submit"> I'm not sure what it does if you have more than one submit....//Matt
  19. Not quite sure what you are doing here....But to answer at least one of your questions: if you want users to only see the box once, you must set a cookie saying they have seen the box, then check for the cookie on page load before showing the box (likely best to isolate this into a function).The procedure for doing this is in the w3cs tutorial.//Matt
  20. Awesome:yesPossible:noAnd while we're at it, let's show some love to C# and good old ASP.Net.
  21. I do not believe this can be done, nor should it be done. Explanation:In HTML, you have a completely predefined set of tags. There is the HTML tag, the body tag, and the head tag (for starters). Each of those tags represents a real object of unchanging definition. When my browser loads up an HTML file, it reads that file. It finds an HTML tag, and it knows what it is. It finds a head tag, and it knows what it is, and then it finds a body tag, and knows what it is. There is no question for my browser: an HTML tag is one thing, a head tag is another, and both are concretely defined.A tag is defined, by the definition of XML by its name and its name alone. Therefore all tags of name X are assumed to be tags representing the same type of object (a schema, in this example, is used to define the type...).What you are trying to do, I will assume, is to have a long list of somewhat related objects, each of which with the same name. For example, you are trying to do something like this: <?xml version="1.0"?><Toys> <ActionFigure name="Godzilla Action Figure" owner="Timmy"> <Arm/> <Arm/> <Leg/> <Leg/> <Head/> </ActionFigure> <Doll name="Barbie" owner="Sally"> <Arm/> <Arm/> <Leg/> <Leg/> <Head/> <Hair/> </Doll></Toys> <?xml version="1.0"?><schema xmlns="...schema ns..."> <element name="Toys"> <complexType> <sequence minOccurs="0" maxOccurs="unbounded"> <element><!--No Name--> <complexType> <sequence minOccurs="0" maxOccurs="unbounded"> <element><!--No Name--> <complexType /> </element> </sequence> <attribute name="name" type="string"/> <attribute name="owner" type="string"/> </complextype> </element> </complexType> </element> <!--end Toys--> </element></schema> And you might use something like this xpath statement to find all toys which are action figures: /Toys//ActionFigure So why doesn't this work?It all has do do with the definition of XML. Each tag is defined in its type not by its scope, but by its name. The scope of an element is only relevant when trying to find it. It is not relevant when trying to define it. Back to the HTML example, this is why every <a> tag is the same, no matter whether it is a child of a <p> tag, a <span> tag, or even just a straight <body> tag. XML is the same way.In this schema, there is nothing do distinguish either of the unnamed elements, so in effect, we just created an element that cannot be identified in the XML file, has two or more types, and is therefore illegal.///////////////////////////////////////////////////////////////////////////////////////////////////////////There are two correct ways of solving this problem, and which you chose will depend on the situation you find yourself in.The first situation is to define typed names for EACH type you want. The advantage of this is that it is compatible with the current XML and XPath. The schema would look like this: <?xml language="1.0"?><schema xmlns="...schema ns..."> <complexType name="Part" abstract="true"/> <complexType name="Toy" abstract="true"> <sequence minOccurs="0" maxOccurs="unbounded"> <element name="Arm"> <complexContent> <Restriction base="target:Part" /> </complexContent> </element> <element name="Leg"> <complexContent> <Restriction base="target:Part" /> </complexContent> </element> <element name="Head"> <complexContent> <restriction base="target:Part" /> </complexContent> </element> </sequence> <attribute name="owner" type="string"> <attribute name="name" type="string"> <complexType> <element name="Toys"> <complexType> <choice minOccurs="0" maxOccurs="unbounded"> <element name="ActionFigure"> <complexContent> <restriction base="target:Toy"/> </complexContent> </element> <element name="Doll"> <complexContent> <extension base="target:Toy"> <sequence> <element name="Leg"> <complexContent> <restriction base="target:Part" /> </complexContent> </element> </sequence> </extension> </complexContent> </element> </choice> </complexType> </element></schema> This solution works well under two conditions: You have relatively few discrete types All of the discrete types are of your definition. There are no user-defined types. If this is not the case, you will not be able to do this, since either: You will have to spend ages creating a very large (and therefore slow) schema file. You will not be able to account for user-types. /////////////////////////////////////////////////////////////////////////////////////////////////////////The second solution evolves in this case instead of the first. It involves reshaping the XML. Instead of declaring separate discrete types of toys, declare a type toy, and give it an attribute type. This allows for both the declaration of large numbers of types, since at most a type is a one line enum value. It also allows you to leave the type as a user-defined string, giving them the flexibility to declare their own types.While I don't currently have time to add examples of this solution, I will come back later today and add them (hey-I'm a college student-I have to pay tuition somehow, and while answering XML questions is interesting and helpful to me (you never know a subject until you can teach it to someone else...I just learned about abstract types now, in fact), it doesn't help pay for school).You would then search out different types of elements by their type attribute, instead of their name. The XPath statement thus becomes: /Toys//Toy[@type='ActionFigure'] ////////////////////////////////////////////////////////////////////////////////////////////////////////////////Well ok, good luck!//Mattps-yes, I know, another long post, but this one is not long due to completeness but rather due to examples, which are at least easy to skip over.
  22. As robot said, What robot refers to is called the DOM, or Document Object Model.Standard steps for using XML: (there are other ways, but this is the common one)1) Load it in a DOM parser2) Make the DOM parser validate it3) access the DOM (not the XML) to get informationPHP5, .Net, and Java have very good DOM implementations.However, something tells me that's not really your goal. If you're like most, you're actually trying to validate two files that you just wrote while learning XML and trying to see if they are correct. You noticed that the w3c does not host a validator (why they do not is beyond me). The first site I've found that claims to do this is http://www.xmlvalidation.com/. I cannot vouch for its suitability, as I haven't used it, but I claims to work.//Matt
  23. Well, I'll start by defining a schema, and its purpose (or better yet, let w3cs do it): So basically, a schema defines the structure of a document. You must therefore consider the question: When is this objective relevant?One common answer is that is is most likely to be relevant when two or more entities (programs) are likely to access the same data source. In that case, and especially in the case that one or more of the entities is not under your control, it would be of great benefit to have something to tell both programs how to structure the data, just like SQL syntax does, Access DB syntax does, TCP/IP does, etc. Hence the invention of the DTD, and proceeding it, the Schema.Put simply, a schema is needed when the data is likely to be accessed by anything outside of your control. If the XML file you're storing is simply a set of basic program preferences, you likely do not need a schema (I tend to make one anyways, since they are almost always very simple, and Visual Studio's auto generated onces are usually good enough in that case). However, if your XML file is attempting to store data of consequence, such as a list of clients, you would greatly benefit from creating a schema, since your databases would then be more readable and more maintainable due to this schema. It would be easier to write future versions, or integrate other products (on the flip side, it is easier to make compatible competitive products-perhaps you might store your schema inside your program assembly, so as not to make it quite as public-though then again, XML was never the format of choice for storing sensitive data or detailed proprietary formats-note that while there are zillions of proprietary formats, almost none are based on XML. Even the new Office 2007 XML document formats are opensource <insert M$ + opensource joke here>).In addition, by the rules above, any online format requires a schema, since by its nature, your client is out of your control (your client is usually a browser). At the moment, I'm not sure if any browsers are truly capable of using name spaces and getting useful schemas for validation from RDDL resources, but I think at least at some point they will be.///////////////////////////////////////////////////////////////////////////////////////A name space DOES NOT have to be a URL...actually it has to be a URI*, which can technically be most anything, including, most often, a URL. Further confusing the matter, is that while the name space string MUST be of URI form, it is NOT actually considered to be a URI. Why this is, I don't understand, but it is not likely relevant anyways.If your schema is a URL, the question then arises, what should be at the end of that URL. Well, the W3C didn't really think about that one when creating XML namespaces...and so, recently, they have created a standard called RDDL, which is based off of XHTML. RDDL is what they say you should put at the end of a namespace URL, at least right now. RDDL is used to specify locatable URIs for various resources, listed by their types (one of which being an actual schema file). As mentioned above, I'm not sure if any browsers currently do anything intelligent with RDDL files, but, for lack of anything better, they are probably fine to use for now.Keep in mind, however, that URL is not the only option (this confuses many, including myself, until fairly recently). For example, the string, "urn:isbn:0553294385" represents a URI, which in this case, is referenced to a URN**, instead of a URL. An XML file such as:<?xml version="1.0"?><root xmlns="urn:isbn:0553294385"> <item> <subitem></subitem> </item></root> Is a document whose namespace, if absolutely resolved, turns out to refer to a specific version of I, Robot, by Isaac Asimov, published by Bantam Spectra in paperback form. This, of course, turns out to be not particularly useful, as it is unlikely that books would require an XML namespace; but it is perfectly legal nonetheless.///////////////////////////////////////////////////////////////////////////////////////As for validation: the common way to do it is to load it into a DOM (PHP(5) has one, Java has one, and .Net has one) then load its schema and check it that way. However, I assume by your question you don't mean programatic validation but surface validation, similar to the W3C validator for HTML. After a quick search, a site located at http://www.xmlvalidation.com/ appears to have one, but you will have to specify the XML schema location in your document (I forget how, but the w3cs tutorial covers it I believe) and enable external validation on their form.However, from your code: <xs:element name="item" type="xs:string"> <!--ERROR: you just defined the element item above to have the type xs:string. Now you are giving it--> <!--a new complex type. Elements can have only one type.--> <xs:complexType> <xs:sequence> <xs:element name="subitem" type="xs:string"/> </xs:sequence> </xs:complexType></xs:element> Fix is therefore: <xs:element name="item"> <xs:complexType> <xs:sequence> <xs:element name="subitem" type="xs:string"/> </xs:sequence> </xs:complexType></xs:element> In addition, you specified that your schema applies to nodes of namespace 'testSchema' and that they should be qualified (prefixed by a namespace identifier): <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="testSchema" <!--Specifies that your contents should be of NS 'testSchema'--> xmlns="testSchema" <!--Means nothing, since no nodes in the document are in the default NS--> elementFormDefault="qualified" <!--Specifies qualified elements-->> In fact, this schema, while perfectly valid, will not validate anything inside your XML file (remember, an XML file can be validated in whole or in part by any number of schemas greater than zero, usually set up so that each schema validates parts of it. This is part of the whole idea of XML inheritance), since nothing in your file has a qualified namespace of 'testSchema'. To fix this, you might try: <?xml version="1.0"?><ts:root xmlns:ts="testSchema" <!--Now a qualified namespace--> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <!--Still talks about schema validation--> ts:schemaLocation="test.xsd" <!--Changed to refer to the namespace prefix ts.-->> <ts:item> <!--Notice all of the elements are of qualified namespace 'testSchema', as specified by the schema'--> <ts:subitem></ts:subitem> </ts:item></ts:root> If I get anything wrong, let me know, as I'm certainly no stranger to Schema syntax errors....//////////////////////////////////////////////////////////////////////////////////////////////Footnotes:*In XML 1.1, namespaces can be either IRIs OR URIs now. As to what an IRI is, don't ask me, because I do not know, and it is unlikely to be relevant even if I did.**A URN is a naming indicator that can be of many forms. URN's are designed to reference a specific item, where as URLs are intended to reference the address of an instance of an item. For example, the URI "urn:isbn:0-553-29438-5" talks about a version of I, Robot, but tells us nothing about where to find it. In contrast, the URI "http://www.w3cschools.com/" talks about a location on the http network, in this case, the www machine at the domain w3cschools.com. It suggests (but does not declare) that the content found at this location is of HTML form (since that is what HTTP is supposed to be for). It does not, however, describe anything about that resource (in contrast, knowing the syntax of ISBN, we deduce that that the content at the prior URI is of book or similar form, is printed in the US, is of Publisher 553, which by reference in an ISBN database turns out to be Bantam Spectra (and the address of their HQ is given), and Title 29438, which by the same database resolves to I, Robot). A URI can be a URN, a URL, or both, depending on the scheme (often mistakenly called a protocol) used in it.//////////////////////////////////////////////////////////////////////////////////////////And so ends my first post on W3C Schools forum. Hope I might be of help, ask again if not....//Mattps-I do apologize for the length of the post...I have somewhat of an obsessive tendency towards completeness when describing standards, and much of this post is likely to be detailed descriptions of various different aspects of XML standards. However, much of the completeness is in response to common questions I am often asked when describing the standards, and is intended to answer them without me having to reply. Not that answering questions is at all bad, nor is asking them, but the reduction in turn around time is usually positive, since by writing in the completeness, I often save at least one question-response cycle, which means that the reader can now get to coding more quickly, which is hopefully the goal (that's my goal when reading tutorials or forums...). If anyone objects let me know and I'll try to cut it down next time....
×
×
  • Create New...