# Tuesday, December 10, 2013

Thumbs Up Wine Finder provides information on countless types of wines. The app provides wine reviews, which wines are available in your local supermarket, what wines are appropriate for various meals and occasions and the ability to search by type and price of wine.

This app is ideal for people like me who don’t know a great deal about selecting wine, but it could also add value for those who know wines but are looking for more information or for some ideas of what to buy and server.

Screenshot.270526.100000[1]

You can download Thumbs Up Wine Finder at http://apps.microsoft.com/windows/en-us/app/thumbs-up-winefinder/a6d01b26-96df-46b9-9739-bbba03b0a722.

If you have written or know of a Windows 8 app you would like to see featured here, please contact me at dgiard@microsoft.com.

Tuesday, December 10, 2013 5:00:01 PM (GMT Standard Time, UTC+00:00)
# Monday, December 9, 2013
Monday, December 9, 2013 1:31:27 PM (GMT Standard Time, UTC+00:00)
# Sunday, December 8, 2013

NOTE: If you are unfamiliar with Cascading Style Sheets, please check out my earlier article on the basics of CSS.

Cascading Style Sheets (CSS) have been around for years. They contain styling information to apply to a web page and they are a recommended way to separate content from layout. The Worldwide Web Consortium (W3C) released a new set of CSS recommendations – known as “CSS3” – at about the same time they released the HTML3 recommendations, so these two specification sets are often spoken of together. CSS3 adds a number of new and useful selectors, selector filters, and styles to provide more flexibility in styling web pages.

VALIDATION

CSS3 adds a number of filters to refine selector criteria. Some of these support valid and invalid input.

For example, if a web page contains an input textbox with the “required” attribute, that textbox is invalid until the user types something into it. We can specify a different style for valid versus invalid input, using the “:valid” and “:invalid” selection filters, as shown below

input:invalid {
    border:3px solid red;
 }
 input:valid {
    border:3px solid gray;
 }
…
<input type=“textid=“FirstNamename=“FirstNamerequired> 

In the example above, the “FirstName” textbox displays with a red border until the user types text into it.

FONTS

Font types are controlled by the “font-family” style. This style accepts a list of preferred fonts for the selection.  In earlier CSS versions, a list was necessary because browsers were unable to display a font unless it was physically installed on the user’s machine. If you wanted to display text using an unusual font, you had to either convince each user to install this font locally, or convert the stylized font text to a picture.

With CSS3, you can use the “@font-face” declaration to define a server-side font; then, point the font-family style to that font. This gives far more flexibility and control when applying fonts to text.

The syntax is

@font-face {
 font-family: FriendlyFontName;
 src: url('fontname.woff') format('woff');
}
selector {
 font-family: FriendlyFontName;
} 

WOFF is a common file format that contains font information. An example (using the desyrel font, found at fontsquirrel.com), is listed below:

@font-face 
   {
    font-family: desyrel;
    src: url('desyrel-webfont.woff') format('woff');
   }
   .wreckless 
   {
    font-family: desyrel, Arial;
    font-size: 30pt;
   } 

The style above assumes that the desyrel-webfont.woff file is in the same folder as the web page being accessed. The results would look something like this:

image

TEXT SHADOWS

Text shadows were nearly impossible to achieve with earlier version of CSS. Again, developers had to resort to pictures of text. But with CSS3, the “text-shadow” style accomplishes this. This style accepts 4 arguments: for the horizontal offset (positive values to the right), vertical offset (positive values down), blur (higher numbers cause blurrier shadows), and color of the shadow. The following example causes a gray dropshadow below and to the right of the text in Div1:

   #Div1 
   {
    text-shadow: 30pt 25pt 15px gray;
   } 

Here is sample text with that style applied:

image

RESIZE

With the CSS3 “resize” style, you can declaratively allow users to resize an object by dragging its edges. The style takes the following parameters

resize: The direction to allow resizing (none, horizontal, vertical, or both)

overflow: Always “auto”

max-width: (optional) The maximum width to which a user may resize the object

max-height: (optional) The maximum height to which a user may resize the object

The following example allows users to resize Div1 horizontally to a maximum width of 600 pixels and vertically as much as they want.

#Div1{    
    resize: both;
    overflow: auto; 
    max-width: 600px; 
} 

ROUNDED CORNERS

A few years ago, everyone rushed to add rounded corners to their web layouts. The problem was that this was difficult to do with the CSS of the time. With CSS3, it is straightforward to round the corners of an object using the new “border-radius” style and its derivatives.

Border-radius style rounds all 4 corners of an object; while “border-top-left-radius”, “border-bottom-left-radius”, “border-top-right-radius”, and “border-bottom-right-radius” styles each rounds only a single corner of an object. Increase the parameter value to provide more curvature to the object corners.

The following example, rounds the two left corners of Div1.

#Div1 {
  border-top-left-radius:2em;
  border-bottom-left-radius:2em;
} 

The results are something like the object below

image

CONCLUSION

In this article, we covered a few of the new styles introduced in CSS3. In the next article, we will demonstrate a few more CSS3 features.

HTML5 | Web
Sunday, December 8, 2013 9:18:00 PM (GMT Standard Time, UTC+00:00)
# Saturday, December 7, 2013

The <input> tag has been around a long time and supports a number of values for the “type” attribute (“text”, “checkbox”, “hidden”, etc.) HTML5 adds a number of new allowed values to the input type attribute. These are designed to capture specific types of input data. Allowed values are

  • color
  • date
  • datetime
  • datetime-local
  • email
  • month
  • number
  • range
  • search
  • tel
  • time
  • url
  • week

For example, if you want the user to enter a color value, use the following markup:

<input type="color" name="MyColor">

In Chrome, this markup renders a button that, when clicked, displays the following popup, allowing users to select the color of their choice.

image

Some browsers render different controls for these input types. For example, Chrome renders a popup calendar for the date type and a color picker for the color type. Browsers that don’t support custom controls simply render a textbox.

Even if no special control is rendered, the behavior of these objects is affected by the type value. Two properties – valid and invalid – were added to input tags in HTML5 and these property values change depending on the input type value and the data entered by the user. For example, if a user attempts to enter text into a <input type=“number”> control, the valid property will be set to false and the invalid property will be set to true. You can access this property either through JavaScript or through CSS, which is a good way to provide visual cues that a user has not correctly completed a form.

The new Input types are a great way to make it easier for users to input data into your forms; to restrict user input based on the expected data use; and to validate form input.

HTML5 | Web
Saturday, December 7, 2013 9:06:00 PM (GMT Standard Time, UTC+00:00)
# Friday, December 6, 2013

Two of my favourite new attributes to input tags are “autofocus” and “placeholder”.

AUTOFOCUS

The “autofocus” attribute causes the cursor to advance to a control when the page loads. This serves as a great convenience to the user, who can begin entering data into a form immediately. Previously, I would write JavaScript to accomplish this. Obviously, you should have only one “autofocus” attribute on a page. Below is an example:

<input type="text" 
    name="First" 
    autofocus  />

PLACEHOLDER

The “placeholder” attribute displays text within a control without modifying the value of that control. Placeholder text disappears when a user starts typing in an input control. This is useful for offering helpful advice about what to enter in a textbox. Below is an example of an INPUT tag with the PLACEHOLDER attribute set.

<input type="text" 
    name="First" 
    placeholder="Enter First Name"  />

In Internet Explorer 11, the markup above renders like the image below:

image

In some browsers (such as IE 11), the placeholder text disappears as soon as the user selects the input element; in other browsers, the text remains until the user begins typing.

In all cases, the placeholder text is never submitted with the form values. It is only for display.

CONCLUSION

In this article, we reviewed how to use two new attributes introduced in HTML 5.

HTML5 | Web
Friday, December 6, 2013 8:55:00 PM (GMT Standard Time, UTC+00:00)
# Thursday, December 5, 2013

HTML5 introduced a few new tags to the markup language. Below is a partial list of these tags:

  • article
  • aside
  • audio
  • canvas
  • command
  • datalist
  • details
  • embed
  • figure
  • figcaption
  • footer
  • header
  • hgroup
  • keygen
  • mark
  • meter
  • nav
  • output
  • progress
  • rp
  • rt
  • section
  • source
  • summary
  • time
  • video
  • wbr

Let’s look at a few of these new tags.

FOOTER, HEADER, ARTICLE, and ASIDE

The Footer, Header, Article, and Aside tags do not affect the page rendering. Instead, they are used to organize the content of a page, making it clear which parts belong together.

The Header and Footer tags should contain summary information about the page and the site. These typically belong at the top and bottom of a page, but you will need to add styling to make this happen.

The Article tag is for a blog or newspaper-style site that contains multiple, distinct stories or articles. Enclose each story with the Article tag to distinguish it from other stories on the page. Within each article, you can specify a quote from that article or HTML that relates to that article. Do so by surrounding this HTML with the Aside tag. An example is shown below.

<article>
    <h1>Breaking News</h1>
    <p>The quick brown fox jumps over the lazy dog</p>
    <aside>
        <h1>Side Note</h1>
        <p>Oh, by the way</p>
    </aside>
</article> 

These tags are examples of semantic markup, which was discussed in Part 1 of this series.

FIGURE AND FIGCAPTION

The <figure> tag is designed to enclose a picture, diagram, code-listing, or other content that stands apart from the body of a document.

The <figcaption> tag is contained within a <figure> tag and contains a caption to describe that figure. There should be at most one figcaption for each figure.

The sample below:

<figure> 
    <img src="babelfish.png"> 
    <figcaption> 
        The mysterious babelfish
    </figcaption> 
</figure> 

would render something like below:

image 

WBR

When a browser is resized or when a web page is viewed at different resolutions, by default, the text on the page wraps to accommodate the new boundaries. Sometimes, this wrapping can make the text look awkward, particular when a long word is involved. The <wbr> tag can help this by splitting a word at the appropriate point.

The <wbr> tag should be inserted in the middle of a long word to indicate where it should be broken, in case it needs to move to a new line.

VIDEO AND AUDIO

In the past, the only way to render multimedia in a browser was to use a plug-in, such as Flash or Silverlight. With HTML5, we now have the <audio> and <video> tags to play multimedia files natively, without the need for an external plug-in.

We can identify the media source using the src attribute in the following example:

<video src=”MyVideo.avi> 

or we can identify multiple video sources by enclosing <source> tags within an <audio> or <video> tag, as in this example:

<video>
    <source src="yyy.mp4" />
    <source src="yyy.ogv" />
    <source src="yyy.webm" />
 </video> 

Supplying multiple media formats is advised if you want your media file to play on multiple platforms. Since there is no universal audio or video format for all platforms, it’s a good idea to encode your multimedia files into different formats for different clients. The browser will try each format in order until it finds a supported one.

Some other useful attributes of the audio and video tags are

  • controls - When present, this attribute adds a set of controls on the page, allowing the user to start, pause, and change volume. This attribute needs no value.
  • loop - When present, this attribute causes the media file to replay after it finishes. This attribute needs no value.
HTML5 | Web
Thursday, December 5, 2013 9:40:00 PM (GMT Standard Time, UTC+00:00)
# Wednesday, December 4, 2013

HTML5 IS BIG

When I think of HTML5, I’m reminded of a quote about space by one of my favourite authors –Douglas Adams. “Space,” says Adams, “is big. Really big. I mean, you may think it’s a long way down to the chemist’s but that’s just peanuts to space.” And the reason this quote reminds me of HTML5 is because HTML 5 is big. Really big. I mean you may think it’s a long way… Well, you get the idea.

The point is that HTML5 is not just one thing. HTML5 is new tags and new attribute to existing tags and new allowed values for existing attributes and new rules about tags and attributes; It’s also a rich set of new JavaScript APIs to enhance your applications; In addition, a new version of Cascading Style Sheets (CSS3) , while not technically part of HTML5, was released at the same time also by the W3C, so we often discuss CSS3 along with HTML5 and I will do so in this paper.

HTML5 is a set of guidelines released by the World Wide Web Consortium (the “W3C” for short) with input from the most popular browser manufacturers, such as Microsoft, Google, the Mozilla Foundation, and Apple.

The browser manufacturers are implementing the HTML5 guidelines at their own pace and in their own order. Due to the enormous scope of HTML5 and the rate at which users tend to upgrade to new browsers, it is unlikely that HTML5 will be on all computers for another decade. Does this mean that HTML5 is irrelevant today? Of course not! Each browser manufacturer is working furiously to implement new features into their browser and encouraging users to upgrade to the latest browser.

You as a developer can start taking advantages of these features today. The challenge, of course, is to build a web application that will use features of new browsers, but still be useable if a user connects with an older browser that does not support the new features. This backwards compatibility is known as “graceful degradation”, meaning that your application downgrades itself gracefully rather than crashing when it encounters a degraded browser. We will talk about ways of making your pages and applications degrade gracefully throughout this paper.

HTML5 GOALS

The W3C had several goals when defining HTML5, including Simplicity, Semantic Markup, and ???

SIMPLICITY

HTML5 is simpler than earlier versions of HTML. For example, the mysterious document declaration at the top of each HTML document has been simplified from

<!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

to 

<!DOCTYPE html>

This new version is simple enough that we actually have a prayer of memorizing it.

The <LINK> and <SCRIPT> tag have been simplified. When was the last time you linked to a stylesheet that was not a CSS stylesheet or added client-side script in a language other than JavaScript? I suspect  attributes and assume every LINK tag points to a CSS stylesheet and every SCRIPT refers to JavaScript? That is what the new HTML5 standard does.

Old New
<link type="text-css" rel="stylesheet" href="MyStyle.css"> <link rel="stylesheet" href="MyStyle.css">
<script type="text/javascript" src="Myscript.js"> <script src="Myscript.js">

SEMANTIC MARKUP

Semantic markup refers to markup that provides meaning to the text it surrounds – meaning beyond simply show to display that text in a browser. This is an important concept as the web evolves from its original goal of a way to store, link, and share documents and pictures of cats.

Semantic markup existed to a lesser extent in earlier versions of HTML. For example, the tags <i> and <em> do the same thing visually when surrounding text: They tilt the top of each letter to the right. However, the <em> tag has some semantic meaning beyond simply telling the browser how to display text. The <em> tag indicates that the reason to italicize the text – With the <em> tag, the marked-up text is italicized to indicate that this text should be emphasized. When one reads the text aloud, one’s voice should rise a little louder or higher to indicate this emphasis. A similar case can be made for the tags <b> and <strong>.

HTML5 | Web
Wednesday, December 4, 2013 9:02:00 PM (GMT Standard Time, UTC+00:00)
# Tuesday, December 3, 2013

If you have written an app for Windows 8 or Windows Phone 8 or if you are about to write an app, you have a chance to win a lot of money.

Modev is sponsoring a contest with $10,000 in prizes!

Some prizes are determined by a panel of judges and some by public voting. Prizes are broken out as follows:

  Judges’ Vote Public Vote
1st Place $2,500 $2,500
2nd Place $1,500 $1,500
3rd Place $1,000 $1,000

In order to qualify, you must complete and submit a new app by December 20, 2013 (I know! I just heard about this myself) and have it approved and in the store by December 31.

Not only is this a chance to win some extra cash, it is also a good way to promote your app.

You can read about the contest here and you can submit your app here!

If you are looking for a reason to finish that app, a chance at free money is a pretty good one.

10KAppContest

Tuesday, December 3, 2013 9:20:02 PM (GMT Standard Time, UTC+00:00)

This week's app is actually 3 apps. And they are more than apps - they 3 short stories and novels with a reader included. Each story was written by Stephen Donald Huff, PhD and each was published by Capital Ideations LLC. 

The apps/books are all free and each is a science fiction story. I read only the sort story "A Paradox of Distance" but I liked Dr. Huff's style and I plan to read the other two. You can download the apps at the links below:

If you have written or know of a Windows 8 app you would like to see featured here, please contact me at dgiard@microsoft.com.

Tuesday, December 3, 2013 4:21:00 PM (GMT Standard Time, UTC+00:00)
# Monday, December 2, 2013
Monday, December 2, 2013 3:05:34 PM (GMT Standard Time, UTC+00:00)