Profil de CharlesCharlie's PlacePhotosBlogListesPlus Outils Aide

Blog


13 mai

XML Basics Quiz

Here's a quiz on some basic XML . Try to answer these as if they are job interview questions... because they are!
 
1. What is the difference between "well formed" XML and "valid" XML?
2. Describe what an XML parser is.
3. What is a library of XML? Name some common libraries.
4. A common convention of xml documents is to include a section at the very beginning, before the repeating data. What of kind elements are contained in that first section and what is it often called? 
5. What are the repeating data elements often called?
6. What criteria should you use when determining rather to use an atttibute to carry element data or a child element?
 
6 mai

Welcome to XML Schemas

Welcome or welcome back as the case may be :-) Tonight is our first class on the XML schema and the XML XSD or Schema Defintion language. I will also give a refresher course/intro course for any students who have somehow missed the basics of XML. Remember html is just a bad,bad subset (library) of xml :-). As always don't forget to check this blog for tips, updates, code samples and quizzes. I'll also post much of our daily code output in the skydrive. If anyone has trouble acccessing the skydrive be sure and let me know so that I can kick live site to let you in. I'm also posting some additional book recommendations for those of you interested in further exploring the topic and/or enhancing your professional library.
Later,
Charlie
29 février

How job postings really work

 
For those of you looking for a job :-)
 
 
dilbert2008073346229[1]
 
 
 
28 février

Intermediate Quiz 1

1. What is a Javascript Method and how to you implement one?
2. What is a Javascript function and how do you implement one?
3. What is an example of an event handler?
4. Create a simple function that displays an alert message when called from a button click. 
5, How are parameters passed from a handler to a function. To illustrate write a simple function using parameters to display an alert.
6. What is the DOM?
7. What DOM method do you use to get a reference to an element with an id?
8. What DOM method do you use to get a reference to a collection of elements using the element name?
9. What Javascript control structure can you use to go through a DOM collections items?
10. Why is Captain Crunch Cereal important in the history of Hackers? (There's a genuine answer to this- look it up!)
22 février

This Weekends Homework Example

I've published an example of one way of creating the class weekend homework on my Brinkster page. Here's the link to the main page so you can get an idea of what I'm looking for http://www40.brinkster.com/ces614/Examples/ .  The link to the leftNav and the Offset Center examples is actually working so you can see how I created the link back to the home page. What these pages look like is entirely up to you though. We'll be taking a look at your brinkster pages on next Tues evenings class so please have them completed by then. Also don't forget to put a link from your blog to your brinkster pages!
See you tonight :-)
Charlie
20 février

Answers Quiz 1

1. Sir Tim Berners Lee
2. SGML
3. The client creates a request for a resource and sends it using a URL. The server receives the request copies the resource and sends it back as part of a response.
4. The browser is responsible for creatint the request and sending it.
5. The web server (IIS Apache , Tomcat etc.) is responsible for listening for any requests (usually to port 80) and the responding to that request.
6. Uniform resource locator
7. Multi part internet mail extension. The "mail extension" part isn't relevent anymore. It's an encoding scheme (from text) that tells the application what type of document it's receiving/sending and how to encode or decode it.
8. Text, HTML and XML
9. Usually a file (text, html xml doc etc.)
10. Element open and close tags must have the same case, All attributes must be quoted. All tags must have a close tag, or use the shortcut close slash.
11. Inside the doc <head> and <body>. The doc itself requires a single root element - <html> .
12. "Red...no Blue-Aaaaaaaaaaaaaaaaghhhhhhh!!!!".
19 février

Class 2 and 3 Quiz

1. What are the 3 types of selectors ?
2. What are 3 different mechanisms for implementing style sheets?
3. What is the single default property that is different between a <div> and a <span>
4. What is a composite selector (hint: it uses a comma)?
5. What is a compound selector?
6. What are the approximate specificity weights of the different kinds of selectors
7. Give an example of a sub-property (hint: uses a hyphen).
8. Explain the difference between absolute, relative (remember ducks in a row) and static positioning.
9. What are some common page level rules that you might apply using the BODY and/or IMG selector.
10. What is the average wind speed velocity of the African swallow (with coconuts and without)?
12 février

Web Foundation- Quiz

Here are some questions from last nights class.
1. Who created the original html specification?
2. What is the language specification that html is derived from?
3. Describe the Client - Server interaction
4. What software on the client is responsible for sending the request?
5. What software on the server is responsible for un- encoding the request and sending the response?
6. What does URL stand for?
7. What is a mime type?
8. What are the 3 mime types commonly used?
9. What is a resource?
10. What are 3 major differences between html and xhtml.
11. What are the 2 required structural elements for a html document?
12. What is your favorite color? ( Ihad to throw an easy one in there somewhere :-))
 
 
11 février

Welcome to the Web Development Program at Strategy

Welcome new students and auditors to the web development program here at Strategy. This blog is a way of staying in touch and up to date on the class homework assignments and shared resources as well as networking with me and the other students. There are several ways of using this tool but probably the most effective is to create a live id/ and or a live email and then send a request to me to add you to my friends list. This will allow you to see my Skydrive files where I share the class code. If you prefer you can also use the Rss link on the main page and an RSS reader to subscribe to the 'Strategy' feed and whenever I add an article or resource the feed will automatically update. I also encourage you to add the other students to your friends list as they are often your best resource for answering questions about the classwork outside of class time since I'm often unavailable. By the way, if you do have questions about the class work please post them as a comment in the questbook at the top of the page so that other students can get the benefit of an answer. I don't often have a chance to reply individually. Also don't forget to check this page often as I frequently post solutions to the home work here as well as career tips and job postings that I might come across :-). I would also encourage each of you to create your own blog/website, afterall - you have to use it to know it!
 
Good luck, I'm looking forward to exploring the web with each of you!
Charlie Smith
14 janvier

Update to Create Articles- including fixes

Hello all! I've fixed the issue where links, headers and image tags were being inserted (encoded) as escaped characters (&gt; instead of > etc.) I used a .Net utility class called Http.Decode. I then discovered that using "innerText" to set the text into the XML was actually recreating the encoding! So I inserted the decoded text as "innerXML" instead. I left the text as it was for the Abstract text since I don't want images or headers etc. actually appearing in the abstract. You can follow my changes and a few other fixes by looking at the comments I added in the CreateArticle.aspx.cs file. You can also see what the Labs will be for Tues.
See everyone on Tues!
Charlie
26 décembre

Homework assignment- Answer now posted in Strategy Files

I just posted the answer for the Homework for last weeks class. The assignment was to create a comma separated list of multiple authors if there were more than one author per article. I modified the Articles.xslt file to apply a match to "Author" and then check to see if there more than the current one. If there is it adds a comma and a space. Question: How would you do the same thing that I did using a for loop instead? Hint, you wouldn't need an additional "apply template".

New stuff for students

FYI everyone, as promised I added the answers to the CSS questions I posted last month. As you can tell the questions are rather open ended. That's deliberate so that I can hear a little bit about how the interviewee walks mentally through the question. I also added a CSS coding standards doc to the class folder in both .doc format and .mht which is viewable in a browser. I hope everyone had a great Holiday :-)
14 décembre

CSS and Javascript questions-Posted Potential Answers!

Here are some questions an interviewer might ask- class feel free to add comments and questions that you've been asked as well!
 

CSS Interview Questions

1. What are the different types of CSS selectors?

#ID .Class and Element Name selectors

2. Describe to me the different ways in which CSS can be used to control flow and layout in a page.

You may use the :

1. Normal document flow (static left to right - top to bottom) with margins, widths,  floats and padding.

2. Absolute positioning where the element selected get its position reference from the nearest positioned parent element or the page itself. Elements may be stacked on top of one another.

3. relative positioning where the element selected get it's position reference from either it's previous sibling element or the nearest positioned parent element (or the page itself)

3. Describe to me the differences between absolute and relative positioning

See question 2 above

4. What is a float and how do you restore normal document flow once a float has been set.

You may use a clear property on a subsequent element to allow the page to resume the normal element layout and flow

5. What is selector specificity?

Specificity is used by the CSS rendering engine to determine which property has precedence when there are conflicts between rules. The more specific selectors a rule uses the more likely it is that that rule will override another that it directly conflicts with.

6. What are the approximate specificity weights for the different selectors?

#id = 100

.class = 10

element name = 1

5. If you have a common css file for several sites that sets a width on an div element using an id describe what selectors you could use to override this rule. Assume that the overriding rule would be placed in a  latter file.

 
If the html looked like this:
<div id="containerDiv">
   <div id="myDiv" class="someClass">
        <span>Hello</span>
    </div>
</div>
and the original CSS looked like this:
#myDiv
{
   color:green;
}

I have several choices if I want to override the green color for the word "Hello" on specific pages.

1. The high specificity weight solution:

#containerDiv #myDiv.someClass SPAN
{
   color:red;
}
2. The simpler solution:
 
#myDiv SPAN
{
   color:red;
}
 

JavaScript/DOM Questions

  1. How would I go about accessing a DIV in the page and changing the class name of the 4 spans inside it.
 First you need to get a reference to the DIV (assuming it had an ID) using the DOM method document.getElementById("someDiv"). Then using that reference you could retrieve a collection of spans in that div by using the getElementsByTagName("SPAN") method against whatever variable you had assigned to someDiv. You can then loop through that collection with a for loop and for each element (usually using the "i" variable) you could set the .className property to whatever you want.
7 décembre

Homework solution for Thurs. Class

I just uploaded the solution for the last assignment. This was adding a "add to cart" button that displayed the item id. I added back in the link from the xml doc to the xslt to make displaying the results a little easier. After adding the xsl element "button" and the "onclick" attribute I then added stylesheet rules for the button and a height property for the item list.  Good luck! I hope everyone succeeds in getting this to work :-)
5 décembre

XSLT Homework solution

I've added new versions of both the xml and xslt files containing a possible solution to the homework. The problem was adding thumbnail album images to our cd descriptions. Here are the steps I used.
1. After creating an images folder in the same location as the xml and xslt files I downloaded appropriately sized album cover images (approx 118 x 118). In the CD xml file I added a <ImgThumb> element to the <CD> node containing the image name of the album image for that CD.
2. In the xslt file inside the cd for-each loop just after the xsl:sorts I added a xsl:element named  "img".
3. I gave that element an xsl:attribute named "src"
4. The text inside the src attribute is "images/" followed by the xsl:value-of selected for "ImgThumb".
5. This outputs html that looks like this: <img src="images/image1.jpg"/>
6. I then used stylesheets to float the image right and the button left.
7. I also added some width to the cdlist list items so that the subheads and the rest of the data didn't wrap weirdly.
 
Thats about it! See everyone in class tommorrow :-)
1 décembre

XSLT Solution for Fridays Class

For those of you that are paying attention :-) I've uploaded a solution to the CDCatalog homework in my shared folder "Strategy Classes" If you need it...
29 novembre

Marathon Thoughts- Seattle 2007

  I begin... waiting for the start with odd thoughts and serenities intermixed with moments of distress and determination my steam breath churning in the cold. We surge out of the start chute, a sheer mass of churning high tech fabric and humanity as we head downtown and up the on ramp to I-90.

  Mile 4 is crossing the bridge and watching the leaders flowing back toward me already, their knees lifted striding smooth and slick. I wonder what it would be like to run that fast that far. On the bridge: people run with me, then pass me chatting, completely unaware of what is to come, running easily and too fast.

  Runnin' in Da' Hood (I90 bridge)

Next I enter the Mercer Island tunnel, the echoing strangeness of hundreds of slapping feet in an enclosed space, the unwordly flourescent lighting seems to strobe in the shadows. Then back toward Seattle and the litter of discarded sweats hats gloves and other clothing left on the bridge as the sun breaks the Lake Washington fog and the course warms up.

  North on on Lake Washington boulevard  spectators wave and cheer at each intersection. Volunteers block the streets from traffic and encourage the runnners as they thin out and begin to realize the depth of their undertaking.  The flush of excitement pales with the realization that we are not even halfway yet. Hitting the turn around at the point of Seward park I feel elated that I am slighly ahead of mark and still running strong at 13.1. We run back along Lake Washington through shadows and sun the lake on the right sparkling and calm.  I Find a few individuals at about the same pace to ensure that I don't lose too many steps coming out of the water stops. It's too big of a tempatation to linger and slow.

   Mile 16 - thank God for GU but my pace slips a little bit in pyschcological anticipation of the hills to come. Spectators with megaphones shout encouragement and bring a small smile. The first hill between 19 and 20 is steep but somehow I run up it and even pass a few people. I recover on the long flat in preparation for the Galer st. Gauntlet a super steep turn followed by a 3/4 mile long ascent. Surprisingly I only need to walk the steep 300 meters or so and I run (slowly) the rest. Downhill through the Arboretum I let gravity flow me  feeling the added speed roll through my legs and hips. 

Smooth and slow at mile 19

  Then comes the turn up Interlaken boulevard and the hills roller costering through Interlaken Park between miles 22 and 23. I begin slowly reeling in runners that had been in front of me for hours. The hill training must have done some good after all. The volunteer at the trail turnoff sees me "3.2 miles left" he says with an encouraging smile and clap. I can stand almost anything for 3.2 miles. Trying to pick up my pace, my feet falling faster my breath tighter and higher, I feel the fatigue spread up and through my legs, thighs, and back. If I finish this I tell myself I will never run fast or run hills again. I wonder what it would be like to run a Marathon where it was easy at mile 23. Loud fast rock music from loudspeakers on Delmar at the aid station, make me smile- a great attempt to motivate us in the last miles.

  Along the freeway, a bake shop with a half dozen women offer trays of croissants and pastries to the runners. What a great aid station but who could possible eat a muffin now? Okay 2 miles, I can do anything for 2  measly miles - 22  + minutes or so, no prolem. I promise myself I will never run this far again if I can just keep my pace for 22 more minutes.

  I refuse to death march shuffle the last 1.5 miles. I will collapse first, I swear. I slide my knees forward forcing a smooth toe off even though it is uncomfortable- no actually it's outright painful. A slow annoying draining pain. It now feels that I have been running forever. Somewhere I begin to feel that I will run forever and never stop. I feel the tug of the imaginary string that I use in training. It runs through my sternum pulling my strides straight toward the finish line.

  Up the last small hill at Republic. How did 40 feet in eleveation become Everest? Slowing slightly as my legs reach their last legs. 3/4 of a mile, 8 minutes. I can do anything for 8 minutes. I again bargain with myself. I will never ever run a single mile again if I can just pick my pace up until the finish line. Turning the corner at Dexter I hear a volunteer "Congratulations on your race". I then realize that I only have 3 minutes left. I also realize that I could crawl to the finish from here. But I won't, because I can do anything for 3 minutes. Then I can stop and never do this again. 

  Somehow from some where unknown I feel an upwelling of determination, stubborness, whatever, and I pick my pace up as I stride uphill through the Mercer underpass just before the turn onto 4th. As I make the turn I hear my name and see my wife step into the street -a splash of beautiful pink encouragment. My son and his girfriend also- all yelling and holding signs. I can't see them very well through my fatigue but my spirit lifts and I hope I don't look like I'm shuffling as I make the turn onto the artificial turf of the stadium.  I tell my legs to pump and I begin my final sprint as I see someone in front of me that might be in my age group. The last 30 yards I hear my son yelling "GO Charlie!!!". How the hell did he get there from the corner? Oh yeah, he's ten times faster than me.

Yes it hurts- The Medical Center banner behind me says it all

  I pass the guy in front of me and step on the finish mat a split second after a young guy who comes out of nowhere to beat me literally at the last second. I have a quick flash of a rather uncharitable thought- "I hope I put him through at least a little agony trying to pass me". One step past the finish mat- "Congratulations, are you okay sir?". When did I become a sir? Do I look like I'm dying? Anyway, on with the foil blankie and off to the recovery area. I will never again run, or even exercise again. My life will now be in front of the tv with beer and chips. Yeah that's right chips. I will never run a step again even if chased by a family of ravenous grizzlies...I swear.

Dammit where did he come from?Am I a hundred yet?Hey at least I beat the skinny guyI know my legs are below here somewhere

Last Schema Class- XSLT begining

So we wrapped up the schemas class with a brief foray into regular expressions and patterns. It's amazing how flexible and powerful regular expressions can be in every language that they are a part of. Regular expressions are typically a part of any program that needs to match complex irregular patterns. In the next class "Transformations" we'll see how XPath can also be used to match regular patterns with a hiearchy of xml elements. We will also use regular experssions to find and replace text elements and attributes within the  result tree (this is the document that is created from the transformation). Some other important concepts that we covered are the "choice" element, the decimal , int and float datatypes as well as the min and max Exclusive and Inclusive elements. For the next class we start with what xslt and xsl are, what the primary structures are, and some simple example transformations. If you would like to get ahead there are some great tutorials at w3schools.com for xslt and xpath. I'll post the link under "Resources".
See you on Friday!
28 novembre

My Marathon Tale

 

 

My Marathon Tale
Well I finished the Seattle Marathon on Sunday :-) Happily I was able to beat my goal time of under 5 hours with 4:55:16. This put me at 120 out of 516 for my age group which I'm very satisfied with, although puzzled since it seems strange that there were 394 men my age running the marathon even slow than me - which I didn't think was even possible. I ran my first half just about as planned at 7 minutes faster than a 5 hour pace to allow for the later hills. Fortunately the hills didn't slow me down quite as much as I thought they would, in fact I only walked about 300 meters of the Galer st. hill which is way the steepest of all. I wasn't able to kick quite as long as I had hoped though I did pick up the pace at  the 3 mile mark, I don't think I averaged better than an 11min a mile after that. I was able to kick the last 200 meters and pass a runner in my age group although a young guy sprinted in just a head of me (.4 seconds). I felt pretty good most of the race although my hip flexors (or ITB 's) were bothering me on both sides- the knee brace on my right knee really seemed to help. I also got a pretty bad set of blisters on the end of my second toe - I think my right shoe was too loose. I used both GU and Gatorade and it seemed to be okay, I never felt really energy depleted even though I couldn't keep my pace up between Seward park and Leschi.  I was able to overtake quite a few people on the hills even though I was running slowly. The weather was completely perfect at about 40 degrees and clear. I probably could have run it in short sleeves. I'll post pictures as soon as I get them :-)

XML Schema Wrap Up

Hi Everyone, well tonight is the last class in schema. I hope everyone will take away some useful concepts including why we use schema at all :-)
Remember we need schema for:
1. Internal consistency. Schema can help internal applications to remain consistent with each other.
2. Ensuring that any application relying upon input from external sources receives valid data.
 
Some useful concepts in creating schema are:
1. Only be as restrictive as you must be. Don't neccessarily try to rigidily enforce every aspect of input data.
2. Use reusable sections of schema by refering to them by name. This will make the schema doc more readable and maintainable.
 
Some other concepts that we covered that relate to xml and data in general:
1. Atomicity. Data should be in consistent chunks broken down to the smallest common elements. Remember it's better to build a house out of 2x4's then splinters and logs.
2. Prototype your data structures early and don't be afraid to change them as needed (before you input a boat load of data!).
3. Namespaces are your friend. In schema you can begin to see why namespaces are useful inkeeping tag names and references in order.
 
Take Care - I'm really looking forward to teaching everyone about transforms next!
Charlie