SlideShare a Scribd company logo
1 of 113
ALKATAN 1
Google Car
As we know the trends are being influenced in our modern
world with respect to the advancement of technology in our
society accordingly. The perceptions of consumers related to
cars are widely influenced because of the continuous increase of
our daily life expense. This paper is about the Google self
driving car which is a project by Google that engages rising
technology for self driving cars. The cars exploit a blend of
technologies, together with radar sensors on the front side,
movie cameras intended at the adjacent area, a variety of other
sensors and synthetic intellect software that aids in guiding.
There have been no mishaps while the cars were managed by the
computer. The system makes at the speed boundary, it has
stored in its ways and keeps its space from other automobiles by
means of its system of sensors. The system offers an override
that permits a human driver to keep control of the vehicle by
moving on the brake or rotating the wheel. As the thought of a
Google Car was initiated, the appraisals have been polarized.
Here is abundance of optimistic remarks about Google Car.
Google’s firm and huge database, particularly data on maps is
very much praised and trusted to be practical and necessary in
advancement of the self driving car. In this paper, the
discussions have been made about testing and troubleshooting,
finalizing and Users' manual about the Google driverless car
project.
It has been produced prototypes of a self driving car already by
Google. However, actually advertising them and locating them
on the way is another story. The organization recognizes that at
the present time, mobile networks are not prepared to deal
vehicles. The major carriers hardly have sufficient ranges to
serve their human clients, however work is in progress to get
used to the white space range for machine-to-machine
associations. In the United States of America, Google is
a manager of a database of white space, meaning that it adds to
list tools that is to be employed on the white space range. On
the other hand, Google may have to discover other alternatives
for its associated cars. The white space range is most
excellently matched for signals that have extended range and
inferior frequency than those that convey voice and facts over
mobile networks. The majority M2M signals do not require to
be conveyed constant at increase speeds. However, those of a
self driving car might be a significant immunity. The car also
contains other sensors, which comprise: four radars, located on
the face and back bumpers, that facilitate the car to "observe"
distant enough to be intelligent to take care of fast traffic on
freeways; a movie camera, placed close to the back-view mirror,
that senses traffic luminosities and a GPS, inertial calculation
unit, and wheel encoder, that find out the car's position and
keep follow on its activities (Martha DeGrasse, 2013).
For Road testing, the project team has prepared a test task force
of ten cars at least, consisting of three Lexus RX450h,
six Toyota Prius and an Audi TT. Each carried by one of a
dozen drivers in the driver's seat with flawless driving
confirmations and in the traveler seat of passenger by one of the
engineers of Google. The car was crossing Lombard Street in
San Francisco, renowned for its abrupt hairpin twist turns and
by city traffic. The cars have passed over the Golden Gate
Bridge and in the region of Lake Tahoe. The speed limit of the
system drives has saved on its records and keeps its space from
other automobiles using its sensor system. The system presents
an override that permits a human driver to get control of the
vehicle by turning the wheel or stepping on the brake, parallel
to cruise manage systems found in a lot of cars already as today.
Google placed a YouTube video demonstrating Steve Mahan, a
resident of Morgan Hill California, being taken on a journey in
its self-driving car, Toyota Prius on March 28, 2012. Mahan
states in the video, “95 % of my visualizing ability are gone;
I'm well past officially sightless". In the report of the video on
YouTube, it is found that the cautiously planned route gets him
from his residence to a drive through café, then to the shop
about dry cleaning, and lastly back to home. The team stated
that they have finished in excess of 300,000 self-directed
driving miles (500 000 km) free of accident, characteristically
have about a dozen cars on the highway at any specified time,
and are opening to test them with solo drivers rather than in
Paris in August 2012. Permitting self driving cars as of
September 2012, Three U.S. states that are Nevada, Florida, and
California have passed laws (Erico Guizzo, 2011).
For finalizing its new attempt, Google has been discussion to
the main auto-parts organizations, such as Magna International
and Continental AG, to produce a car under the directions of
Google Company. Presently as supply-chain Corporation
Foxconn aids Apple and other hardware organizations to build
computers and phones, these organizations offer parts to large
automakers and assist them bring together automobiles.
Google’s look for a producer demonstrates how cars could
develop into the newest part of the hardware business to be
commoditized, much like mobile devices and computers have.
Those devices have the bodies are now prepared with an
extensive collection of economical suppliers, while the apps and
software that carry on them have increased in significance.
Whether Google will advance and associate with an agreement
producer to construct a car to its requirements remains
indistinct. The organization is still looking for to partner with
renowned automakers, one of the people recognizable with the
attempt. However, the effort like “do-it-yourself” is typical
Google characteristics.
The organization intends its own laptops and phones, in big part
to support accessible hardware makers to pursue its escort and
accept fresh features of its operating system of Android mobile
and Chrome software in recent years. Google’s present, small
task force of self-driving automobiles which are Toyotas
retrofitted with movie cameras, feelers, radars, and Google’s
unique software, worth around $150,000 a piece, according one
person recognizable with the theme. Google has been
functioning hard to lesser the price by designing some hardware
parts on its own. The economic dangers interpret why the task is
established in Google X, the R&D lab beside Google’s
headquarters. Google X focuses on what CEO Larry Page calls
“moon shots,” or high-risk tasks that could have large-scale
payouts if they succeed. Inevitably, there will be political and
regulatory obstacles too. Google has been employed to confirm
self-driving vehicles will be formally legalized in the U.S. It
before spearheading legislation in Nevada, California, Florida
and Washington DC that permits for authorizing and checking
autonomous vehicles on public roads (Amir Efrati, 2013).
The user manual of the Google driverless car has not so defined
yet. In its most comprehensive answer yet to trials with self-
driving vehicles by Google Inc., The National Highway Traffic
Safety Administration said states should need drivers of
prototype self-driving vehicles to get additional teaching and
exceptional permits to display they can securely function the
vehicles on public roads. For now, the bureau states shouldn't
permit procedure of self-driving vehicles on public streets
except for checking purposes. The NHTSA, although, alerted
states contrary to enforcing too numerous exact guidelines on an
expertise that is developing rapidly. At a latest commerce
seminar, bosses said that by 2020 they anticipated buyers will
be adept to purchase vehicles proposing restricted self-driving
capability, and that by 2025 completely autonomous vehicles
could be accessible in important numbers (Joseph B., 2013).
Several states, encompassing California, Florida and Nevada,
have passed regulations permitting procedure of self-driving
vehicles for checking reasons on public streets. Overall, the
article displays controllers are keen to encourage the study of
self-driving vehicles, which they said have the promise to
decrease main street misfortunes and killings, and to constrain
fossil-fuel emissions. "We believe there's large potential," said
Deputy NHTSA Administrator David Friedman in an interview.
The NHTSA guidelines, he said, are directed at suggesting
states on how to double-check that still mostly untested
autonomous vehicles can coexist securely with other vehicles on
the road. Among the matters, Mr. Friedman said, is how many
alert drivers require of a difficulty that needs them to retake the
controls of a vehicle that has been going by car itself. Mr.
Friedman said the guidelines furthermore are directed at
clarifying up the disarray over how the government outlooks
distinct kinds of self-driving technology. The article summaries
five grades of automation, from "Level 0" vehicles in which
drivers are absolutely in command at all times, through Level-3
"limited automation" vehicles that can propel themselves
utilizing laser or radar sensors to stay in a roadway and hold a
protected expanse from other cars. These vehicles can still need
a person going by car to take a scribe from time to time.
NHTSA recounts "Level 4" as "full self going by car
automation"—a vehicle that can come to a place travelled to
without any going by car by the passenger. Google's self-
driving vehicles, which use laser sensors and mapping
expertise, are demonstrations of Level 3 vehicles, Mr. Friedman
said (Joseph B., 2013).
The NHTSA guidelines are voluntary, and no one of the
suggestions would probable halt checking by Google or vehicle
makers. Google didn't exactly commentary on the details of the
guidelines. "We are inserting autonomous vehicle expertise to
advance people's inhabits by producing going by car safer, more
delightful, and more efficient," the business side. The
development of self-driving expertise is being spurred by some
forces. Researchers are progressively worried by clues that the
major origin of mortal main street misfortunes isn't defective
vehicles, but awful driving. A latest NHTSA study of smash
into facts and numbers discovered that just 1% of drivers in the
experiment directed the brakes at full force before a collision
(Joseph B., 2013).
In conclusion, we must say that in our present scenario the
advancement of technology by the wonders of science has been
completely acquired peoples around the globe, prior to this the
great hike of a hybrid car was a major trend of peoples but
presenting the concept of modern trend that is the Google self
driving car is going to be most successful. The various surveys
executed in the major area of our communities reflect the high
demand of this product prior to the actual launch of this project
which is a wonderful, having marvelous design, testing and
troubleshooting in a right way, planning for great finalizing, but
still working on its user manual system which is not yet clear.
Moreover according to the recent reports the demand of Google
car has already captured the market with advance booking of
more than a thousand users till date. According to the estimated
plan for this project, just after the launch of Google car it would
be one of the highest selling cars in the entire automobile sector
acquiring the majority of the market.
References
1. Martha DeGrasse, Google said to move driverless car into
fast lane, rcrwireless.com, 26 August 2013, web. Retrieved 20
November 2013 from
http://www.rcrwireless.com/article/20130826/devices/google-
reportedly-fast-tracks-driverless-car/
2. Erico Guizzo, How Google's Self-Driving Car Works,
spectrum.ieee.org, 18 Oct 2011, web. Retrieved 20 November
2013 from
http://spectrum.ieee.org/automaton/robotics/artificial-
intelligence/how-google-self-driving-car-works
3. Amir Efrati, Exclusive: Google Designing Its Own Self-
Driving Car, Considers ‘Robo Taxi’, jessicalessin.com, August
23, 2013, web. Retrieved 20 November 2013 from
http://jessicalessin.com/2013/08/23/exclusive-google-designing-
its-own-self-driving-car-considers-robo-taxi-2/
4. Joseph B., Self-Driving Cars Spark New Guidelines,
online.wsj.com, May 30, 2013, web. Retrieved 20 November
2013 from
http://online.wsj.com/news/articles/SB100014241278873237282
04578515081578077890
case4/headmenu.jpg
case4/kglogo.jpg
case4/kgstyles.css
/*
New Perspectives on HTML5, CSS and JavaScript
Tutorial 13
Case Problem 4
The Word Search Style Sheet
Filename: kgstyles.css
Supporting Files:
*/
/* Display HTML5 structural elements as blocks */
article, aside, figure, figcaption, footer, hgroup, header,
section, nav {
display: block;
}
/* Set the default page element styles */
body {
margin: 0px;
}
body * {
font-family: Verdana, Geneva, sans-serif;
font-size: 100%;
font-weight: inherit;
line-height: 1.2em;
margin: 0px;
padding: 0px;
text-decoration: none;
vertical-align: baseline;
}
/* Styles for the main page section */
section {
position: absolute;
margin: 0px auto;
width: 100%;
}
header img {
margin-top: 10px;
margin-left: 54px;
}
#links {
position: absolute;
left: 0px;
top: 102px;
}
/* Styles for the main article */
article {
position: absolute;
left: 213px;
top: 106px;
}
article img {
position: absolute;
top: 0px;
left: 0px;
}
article #h1img {
position: absolute;
top: 48px;
left: 129px;
}
/* Word search table placement */
figure#wordTable {
float: left;
margin-top: 150px;
width: 600px;
}
/* Placement of the aside element containing the list of hidden
words */
aside {
float: left;
width: 220px;
margin-top: 150px;
margin-left: 10px;
}
aside h1 {
font-size: 24px;
letter-spacing: 5px;
margin: 0px 0px 20px 0px;
}
aside p {
font-size: 14px;
margin: 10px 0px;
}
/* div element containing the Show
Solution
button */
article div {
clear: left;
float: left;
width: 600px;
margin-top: 10px;
text-align: center;
}
article div input {
width: 150px;
font-size: 14px;
height: 30px;
}
case4/links.jpg
case4/modernizr-1.5.js
/*!
* Modernizr JavaScript library 1.5
* http://www.modernizr.com/
*
* Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
* Dual-licensed under the BSD and MIT licenses.
* http://www.modernizr.com/license/
*
* Featuring major contributions by
* Paul Irish - http://paulirish.com
*/
/*
* LicenseModernizr is available under the MIT and BSD
licenses:
* MIT License
* Copyright (c) 2009–2010 Faruk Ate?
* Permission is hereby granted, free of charge, to any person
obtaining a copy
* of this software and associated documentation files (the
"Software"), to deal
* in the Software without restriction, including without
limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell
* copies of the Software, and to permit persons to whom the
Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall
be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* BSD License
* Copyright (c) 2010, Faruk Ate?
* All rights reserved.
* Redistribution and use in source and binary forms, with or
without
* modification, are permitted provided that the following
conditions are met:
* * Redistributions of source code must retain the above
copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
copyright
* notice, this list of conditions and the following disclaimer in
the
* documentation and/or other materials provided with the
distribution.
* * Neither the name of the Organization nor the
* names of its contributors may be used to endorse or promote
products
* derived from this software without specific prior written
permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT
HOLDER BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
/*
* Modernizr is a script that will detect native CSS3 and
HTML5 features
* available in the current UA and provide an object containing
all
* features with a true/false value, depending on whether the
UA has
* native support for it or not.
*
* In addition to that, Modernizr will add classes to the <html>
* element of the page, one for each cutting-edge feature. If the
UA
* supports it, a class like "cssgradients" will be added. If not,
* the class name will be "no-cssgradients". This allows for
simple
* if-conditionals in CSS styling, making it easily to have fine
* control over the look and feel of your website.
*
* @author Faruk Ates
* @copyright (c) 2009-2010 Faruk Ates.
*
* @contributor Paul Irish
* @contributor Ben Alman
*/
window.Modernizr = (function(window,doc,undefined){
var version = '1.5',
ret = {},
/**
* enableHTML5 is a private property for advanced use only.
If enabled,
* it will make Modernizr.init() run through a brief while()
loop in
* which it will create all HTML5 elements in the DOM to
allow for
* styling them in Internet Explorer, which does not
recognize any
* non-HTML4 elements unless created in the DOM this way.
*
* enableHTML5 is ON by default.
*/
enableHTML5 = true,
/**
* fontfaceCheckDelay is the ms delay before the @font-face
test is
* checked a second time. This is neccessary because both
Gecko and
* WebKit do not load data: URI font data synchronously.
* https://bugzilla.mozilla.org/show_bug.cgi?id=512566
* The check will be done again at fontfaceCheckDelay*2 and
then
* a fourth time at window's load event.
* If you need to query for @font-face support, send a
callback to:
* Modernizr._fontfaceready(fn);
* The callback is passed the boolean value of
Modernizr.fontface
*/
fontfaceCheckDelay = 75,
docElement = doc.documentElement,
/**
* Create our "modernizr" element that we do most feature
tests on.
*/
mod = 'modernizr',
m = doc.createElement( mod ),
m_style = m.style,
/**
* Create the input element for various Web Forms feature
tests.
*/
f = doc.createElement( 'input' ),
// Reused strings, stored here to allow better minification
canvas = 'canvas',
canvastext = 'canvastext',
rgba = 'rgba',
hsla = 'hsla',
multiplebgs = 'multiplebgs',
backgroundsize = 'backgroundsize',
borderimage = 'borderimage',
borderradius = 'borderradius',
boxshadow = 'boxshadow',
opacity = 'opacity',
cssanimations = 'cssanimations',
csscolumns = 'csscolumns',
cssgradients = 'cssgradients',
cssreflections = 'cssreflections',
csstransforms = 'csstransforms',
csstransforms3d = 'csstransforms3d',
csstransitions = 'csstransitions',
fontface = 'fontface',
geolocation = 'geolocation',
video = 'video',
audio = 'audio',
input = 'input',
inputtypes = input + 'types',
// inputtypes is an object of its own containing individual
tests for
// various new input types, such as search, range, datetime,
etc.
svg = 'svg',
smil = 'smil',
svgclippaths = svg+'clippaths',
background = 'background',
backgroundColor = background + 'Color',
canPlayType = 'canPlayType',
// FF gets really angry if you name local variables as these,
but camelCased.
localstorage = 'localStorage',
sessionstorage = 'sessionStorage',
applicationcache = 'applicationCache',
webWorkers = 'webworkers',
hashchange = 'hashchange',
crosswindowmessaging = 'crosswindowmessaging',
historymanagement = 'historymanagement',
draganddrop = 'draganddrop',
websqldatabase = 'websqldatabase',
indexedDB = 'indexedDB',
websockets = 'websockets',
smile = ':)',
// IE7 gets mad if you name a local variable `toString`
tostring = Object.prototype.toString,
// list of property values to set for css tests. see ticket #21
prefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
tests = {},
inputs = {},
attrs = {},
classes = [],
/**
* isEventSupported determines if a given element supports
the given event
* function from
http://yura.thinkweb2.com/isEventSupported/
*/
isEventSupported = (function(){
var TAGNAMES = {
'select':'input','change':'input',
'submit':'form','reset':'form',
'error':'img','load':'img','abort':'img'
},
cache = { };
function isEventSupported(eventName, element) {
var canCache = (arguments.length == 1);
// only return cached result when no element is given
if (canCache && cache[eventName]) {
return cache[eventName];
}
element = element ||
document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
// When using `setAttribute`, IE skips "unload", WebKit
skips "unload" and "resize"
// `in` "catches" those
var isSupported = (eventName in element);
if (!isSupported && element.setAttribute) {
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] ==
'function';
}
element = null;
return canCache ? (cache[eventName] = isSupported) :
isSupported;
}
return isEventSupported;
})();
var _hasOwnProperty = ({}).hasOwnProperty,
hasOwnProperty;
if (typeof _hasOwnProperty !== 'undefined' && typeof
_hasOwnProperty.call !== 'undefined') {
hasOwnProperty = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProperty = function (object, property) { /* yes, this
can give false positives/negatives, but most of the time we don't
care about those */
return ((property in object) && typeof
object.constructor.prototype[property] === 'undefined');
};
}
/**
* set_css applies given styles to the Modernizr DOM node.
*/
function set_css( str ) {
m_style.cssText = str;
}
/**
* set_css_all extrapolates all vendor-specific css strings.
*/
function set_css_all( str1, str2 ) {
return set_css(prefixes.join(str1 + ';') + ( str2 || '' ));
}
/**
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return (''+str).indexOf( substr ) !== -1;
}
/**
* test_props is a generic CSS / DOM property test; if a
browser supports
* a certain property, it won't return undefined for it.
* A supported CSS property returns empty string when its
not yet set.
*/
function test_props( props, callback ) {
for ( var i in props ) {
if ( m_style[ props[i] ] !== undefined && ( !callback ||
callback( props[i], m ) ) ) {
return true;
}
}
}
/**
* test_props_all tests a list of DOM properties we want to
check against.
* We specify literally ALL possible (known and/or likely)
properties on
* the element including the non-vendor prefixed one, for
forward-
* compatibility.
*/
function test_props_all( prop, callback ) {
var uc_prop = prop.charAt(0).toUpperCase() +
prop.substr(1),
// following spec is to expose vendor-specific style
properties as:
// elem.style.WebkitBorderRadius
// and the following would be incorrect:
// elem.style.webkitBorderRadius
// Webkit and Mozilla are nice enough to ghost their
properties in the lowercase
// version but Opera does not.
// see more here:
http://github.com/Modernizr/Modernizr/issues/issue/21
props = [
prop,
'Webkit' + uc_prop,
'Moz' + uc_prop,
'O' + uc_prop,
'ms' + uc_prop,
'Khtml' + uc_prop
];
return !!test_props( props, callback );
}
/**
* Tests
*/
tests[canvas] = function() {
return !!doc.createElement( canvas ).getContext;
};
tests[canvastext] = function() {
return !!(tests[canvas]() && typeof doc.createElement(
canvas ).getContext('2d').fillText == 'function');
};
/**
* The Modernizr.touch test only indicates if the browser
supports
* touch events, which does not necessarily reflect a
touchscreen
* device, as evidenced by tablets running Windows 7 or,
alas,
* the Palm Pre / WebOS (touch) phones.
* Additionally, chrome used to lie about its support on this,
but that
* has since been recitifed: http://crbug.com/36415
* Because there is no way to reliably detect Chrome's false
positive
* without UA sniffing we have removed this test from
Modernizr. We
* hope to add it in after Chrome 5 has been sunsetted.
* See also
http://github.com/Modernizr/Modernizr/issues#issue/84
tests[touch] = function() {
return !!('ontouchstart' in window);
};
*/
/**
* geolocation tests for the new Geolocation API
specification.
* This test is a standards compliant-only test; for more
complete
* testing, including a Google Gears fallback, please see:
* http://code.google.com/p/geo-location-javascript/
* or view a fallback solution using google's geo API:
* http://gist.github.com/366184
*/
tests[geolocation] = function() {
return !!navigator.geolocation;
};
tests[crosswindowmessaging] = function() {
return !!window.postMessage;
};
tests[websqldatabase] = function() {
var result = !!window.openDatabase;
if (result){
try {
result = !!openDatabase("testdb", "1.0", "html5 test db",
200000);
} catch(err) {
result = false;
}
}
return result;
};
tests[indexedDB] = function(){
return !!window[indexedDB];
};
// documentMode logic from YUI to filter out IE8 Compat
Mode
// which false positives.
tests[hashchange] = function() {
return isEventSupported(hashchange, window) && (
document.documentMode === undefined ||
document.documentMode > 7 );
};
tests[historymanagement] = function() {
return !!(window.history && history.pushState);
};
tests[draganddrop] = function() {
return isEventSupported('drag')
&& isEventSupported('dragstart')
&& isEventSupported('dragenter')
&& isEventSupported('dragover')
&& isEventSupported('dragleave')
&& isEventSupported('dragend')
&& isEventSupported('drop');
};
tests[websockets] = function(){
return ('WebSocket' in window);
};
// http://css-tricks.com/rgba-browser-support/
tests[rgba] = function() {
// Set an rgba() color and check the returned value
set_css( background + '-color:rgba(150,255,150,.5)' );
return contains( m_style[backgroundColor], rgba );
};
tests[hsla] = function() {
// Same as rgba(), in fact, browsers re-map hsla() to rgba()
internally
set_css( background + '-color:hsla(120,40%,100%,.5)' );
return contains( m_style[backgroundColor], rgba );
};
tests[multiplebgs] = function() {
// Setting multiple images AND a color on the background
shorthand property
// and then querying the style.background property value
for the number of
// occurrences of "url(" is a reliable method for detecting
ACTUAL support for this!
set_css( background + ':url(//:),url(//:),red url(//:)' );
// If the UA supports multiple backgrounds, there should
be three occurrences
// of the string "url(" in the return value for
elem_style.background
return new
RegExp("(urls*(.*?){3}").test(m_style[background]);
};
// In testing support for a given CSS property, it's legit to
test:
// elem.style[styleName] !== undefined
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.
// We'll take advantage of this quick test and skip setting a
style
// on our modernizr element, but instead just testing
undefined vs
// empty string.
// The legacy set_css_all calls will remain in the source
// (however, commented) in for clarity, yet functionally they
are
// no longer needed.
tests[backgroundsize] = function() {
return test_props_all( background + 'Size' );
};
tests[borderimage] = function() {
// set_css_all( 'border-image:url(m.png) 1 1 stretch' );
return test_props_all( 'borderImage' );
};
// super comprehensive table about all the unique
implementations of
// border-radius: http://muddledramblings.com/table-of-css3-
border-radius-compliance
tests[borderradius] = function() {
// set_css_all( 'border-radius:10px' );
return test_props_all( 'borderRadius', '', function( prop ) {
return contains( prop, 'orderRadius' );
});
};
tests[boxshadow] = function() {
// set_css_all( 'box-shadow:#000 1px 1px 3px' );
return test_props_all( 'boxShadow' );
};
tests[opacity] = function() {
// Browsers that actually have CSS Opacity implemented
have done so
// according to spec, which means their return values are
within the
// range of [0.0,1.0] - including the leading zero.
set_css_all( 'opacity:.5' );
return contains( m_style[opacity], '0.5' );
};
tests[cssanimations] = function() {
// set_css_all( 'animation:"animate" 2s ease 2',
'position:relative' );
return test_props_all( 'animationName' );
};
tests[csscolumns] = function() {
// set_css_all( 'column-count:3' );
return test_props_all( 'columnCount' );
};
tests[cssgradients] = function() {
/**
* For CSS Gradients syntax, please see:
* http://webkit.org/blog/175/introducing-css-gradients/
* https://developer.mozilla.org/en/CSS/-moz-linear-
gradient
* https://developer.mozilla.org/en/CSS/-moz-radial-
gradient
* http://dev.w3.org/csswg/css3-images/#gradients-
*/
var str1 = background + '-image:',
str2 = 'gradient(linear,left top,right
bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';
set_css(
(str1 + prefixes.join(str2 + str1) + prefixes.join(str3 +
str1)).slice(0,-str1.length)
);
return contains( m_style.backgroundImage, 'gradient' );
};
tests[cssreflections] = function() {
// set_css_all( 'box-reflect:right 1px' );
return test_props_all( 'boxReflect' );
};
tests[csstransforms] = function() {
// set_css_all( 'transform:rotate(3deg)' );
return !!test_props([ 'transformProperty',
'WebkitTransform', 'MozTransform', 'OTransform',
'msTransform' ]);
};
tests[csstransforms3d] = function() {
// set_css_all( 'perspective:500' );
var ret = !!test_props([ 'perspectiveProperty',
'WebkitPerspective', 'MozPerspective', 'OPerspective',
'msPerspective' ]);
// webkit has 3d transforms disabled for chrome, though
// it works fine in safari on leopard and snow leopard
// as a result, it 'recognizes' the syntax and throws a false
positive
// thus we must do a more thorough check:
if (ret){
var st = document.createElement('style'),
div = doc.createElement('div');
// webkit allows this media query to succeed only if the
feature is enabled.
// "@media (transform-3d),(-o-transform-3d),(-moz-
transform-3d),(-ms-transform-3d),(-webkit-transform-
3d),(modernizr){#modernizr{height:3px}}"
st.textContent = '@media ('+prefixes.join('transform-
3d),(')+'modernizr){#modernizr{height:3px}}';
doc.getElementsByTagName('head')[0].appendChild(st);
div.id = 'modernizr';
docElement.appendChild(div);
ret = div.offsetHeight === 3;
st.parentNode.removeChild(st);
div.parentNode.removeChild(div);
}
return ret;
};
tests[csstransitions] = function() {
// set_css_all( 'transition:all .5s linear' );
return test_props_all( 'transitionProperty' );
};
// @font-face detection routine created by Paul Irish -
paulirish.com
// Merged into Modernizr with approval. Read more about
Paul's work here:
// http://paulirish.com/2009/font-face-feature-detection/
tests[fontface] = function(){
var fontret;
if
(/*@[email protected](@_jscript_version>=5)[email protected]
@*/0) fontret = true;
else {
// Create variables for dedicated @font-face test
var st = doc.createElement('style'),
spn = doc.createElement('span'),
size, isFakeBody = false, body = doc.body,
callback, isCallbackCalled;
// The following is a font-face + glyph definition for the .
character:
st.textContent = "@font-face{font-
family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAA
AwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJA
AAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAA
AACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQA
AAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAA
AABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANg
AAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACH
gAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesA
MwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAA
AAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAA
AAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAA
AK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZX
AwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAA
AAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB
AAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDA
AAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoA
AwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC8
8sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCq
v1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0
BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaA
ZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAA
AAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8Q
DxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAA
ADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAA
AAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAA
AAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKg
AqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQ
AAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAA
AQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAA
AAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKAR
sAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBA
kAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr
0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAk
ABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb
3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJl
bGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBG
b250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZ
WFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJ
hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYW
VjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3Jn
ZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJ
hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0Vm
Vyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQg
b2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9P
RkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5A
CAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAH
MAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHU
AbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbw
BmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAA
gAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAE
wAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGU
AbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQ
AgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiA
GEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyAC
AALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHI
AYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGI
AZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGU
AdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAM
gAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAA
gADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBj
ADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAg
AHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgA
EwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGI
AYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAI
AAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBh
AEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByA
GkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEw
AAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAA
AAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==
')}";
doc.getElementsByTagName('head')[0].appendChild(st);
// we don't use `serif` and we don't use `monospace`
//
http://github.com/Modernizr/Modernizr/issues/closed#issue/39
//
http://neugierig.org/software/chromium/notes/2009/09/monospa
ce-fonts-workaround.html
spn.setAttribute('style','font:99px
_,arial,helvetica;position:absolute;visibility:hidden');
if (!body){
body =
docElement.appendChild(doc.createElement(fontface));
isFakeBody = true;
}
// the data-uri'd font only has the . glyph; which is 3
pixels wide.
spn.innerHTML = '........';
spn.id = 'fonttest';
body.appendChild(spn);
size = spn.offsetWidth*spn.offsetHeight;
spn.style.font = '99px testfont,_,arial,helvetica';
// needed for the CSSFontFaceRule false positives (ff3,
chrome, op9)
fontret = size !== spn.offsetWidth*spn.offsetHeight;
function delayedCheck(){
if (!body.parentNode) return;
fontret = ret[fontface] = size !==
spn.offsetWidth*spn.offsetHeight;
docElement.className =
docElement.className.replace(/(no-)?fontfaceb/,'') + (fontret ?
' ' : ' no-') + fontface;
}
setTimeout(delayedCheck,fontfaceCheckDelay);
setTimeout(delayedCheck,fontfaceCheckDelay*2);
addEventListener('load',function(){
delayedCheck();
(isCallbackCalled = true) && callback &&
callback(fontret);
setTimeout(function(){
if (!isFakeBody) body = spn;
body.parentNode.removeChild(body);
st.parentNode.removeChild(st);
}, 50);
},false);
}
// allow for a callback
ret._fontfaceready = function(fn){
(isCallbackCalled || fontret) ? fn(fontret) : (callback =
fn);
}
return fontret || size !== spn.offsetWidth;
};
// These tests evaluate support of the video/audio elements,
as well as
// testing what types of content they support.
//
// we're using the Boolean constructor here, so that we can
extend the value
// e.g. Modernizr.video // true
// Modernizr.video.ogg // 'probably'
//
// codec values from :
http://github.com/NielsLeenheer/html5test/blob/9106a8/index.ht
ml#L845
// thx to NielsLeenheer and zcorpan
tests[video] = function() {
var elem = doc.createElement(video),
bool = !!elem[canPlayType];
if (bool){
bool = new Boolean(bool);
bool.ogg = elem[canPlayType]('video/ogg;
codecs="theora"');
bool.h264 = elem[canPlayType]('video/mp4;
codecs="avc1.42E01E"');
bool.webm = elem[canPlayType]('video/webm;
codecs="vp8, vorbis"');
}
return bool;
};
tests[audio] = function() {
var elem = doc.createElement(audio),
bool = !!elem[canPlayType];
if (bool){
bool = new Boolean(bool);
bool.ogg = elem[canPlayType]('audio/ogg;
codecs="vorbis"');
bool.mp3 = elem[canPlayType]('audio/mpeg;');
// mimetypes accepted:
//
https://developer.mozilla.org/En/Media_formats_supported_by_
the_audio_and_video_elements
// http://bit.ly/iphoneoscodecs
bool.wav = elem[canPlayType]('audio/wav;
codecs="1"');
bool.m4a = elem[canPlayType]('audio/x-m4a;') ||
elem[canPlayType]('audio/aac;');
}
return bool;
};
// both localStorage and sessionStorage are
// tested in this method because otherwise Firefox will
// throw an error:
https://bugzilla.mozilla.org/show_bug.cgi?id=365772
// if cookies are disabled
// FWIW miller device resolves to [object Storage] in all
supporting browsers
// except for IE who does [object Object]
// IE8 Compat mode supports these features completely:
// http://www.quirksmode.org/dom/html5.html
tests[localstorage] = function() {
return ('localStorage' in window) &&
window[localstorage] !== null;
};
tests[sessionstorage] = function() {
// try/catch required for pissy FF behavior
try {
return ('sessionStorage' in window) &&
window[sessionstorage] !== null;
} catch(e){
return false;
}
};
tests[webWorkers] = function () {
return !!window.Worker;
};
tests[applicationcache] = function() {
var cache = window[applicationcache];
return !!(cache && (typeof cache.status != 'undefined')
&& (typeof cache.update == 'function') && (typeof
cache.swapCache == 'function'));
};
// thanks to Erik Dahlstrom
tests[svg] = function(){
return !!doc.createElementNS && !!doc.createElementNS(
"http://www.w3.org/2000/svg", "svg").createSVGRect;
};
// thanks to F1lt3r and lucideer
// http://github.com/Modernizr/Modernizr/issues#issue/35
tests[smil] = function(){
return !!doc.createElementNS &&
/SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or
g/2000/svg','animate')));
};
tests[svgclippaths] = function(){
// returns a false positive in saf 3.2?
return !!doc.createElementNS &&
/SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or
g/2000/svg','clipPath')));
};
// input features and input types go directly onto the ret
object, bypassing the tests loop.
// hold this guy to execute in a moment.
function webforms(){
// Run through HTML5's new input attributes to see if the
UA understands any.
// We're using f which is the <input> element created early
on
// Mike Taylr has created a comprehensive resource for
testing these attributes
// when applied to all input types:
// http://miketaylr.com/code/input-type-attr.html
// spec: http://www.whatwg.org/specs/web-apps/current-
work/multipage/the-input-element.html#input-type-attr-
summary
ret[input] = (function(props) {
for (var i = 0,len=props.length;i<len;i++) {
attrs[ props[i] ] = !!(props[i] in f);
}
return attrs;
})('autocomplete autofocus list placeholder max min
multiple pattern required step'.split(' '));
// Run through HTML5's new input types to see if the UA
understands any.
// This is put behind the tests runloop because it doesn't
return a
// true/false like all the other tests; instead, it returns an
object
// containing each input type with its corresponding
true/false value
// Big thx to @miketaylr for the html5 forms expertise.
http://miketaylr.com/
ret[inputtypes] = (function(props) {
for (var i = 0,bool,len=props.length;i<len;i++) {
f.setAttribute('type', props[i]);
bool = f.type !== 'text';
// chrome likes to falsely purport support, so we feed
it a textual value
// if that doesnt succeed then we know there's a
custom UI
if (bool){
f.value = smile;
/* Safari 4 is allowing the smiley as a value, and
incorrecty failing..
the test fixes for webkit only, but breaks Opera..
if (/range/.test(f.type)){
bool =
test_props_all('appearance',function(prop,m){ return
m_style[prop] !== 'textfield' })
}
*/
if (/tel|search/.test(f.type)){
// spec doesnt define any special parsing or
detectable UI
// behaviors so we pass these through as true
} else if (/url|email/.test(f.type)) {
// real url and email support comes with prebaked
validation.
bool = f.checkValidity && f.checkValidity() ===
false;
} else {
bool = f.value != smile;
}
}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time
datetime-local number range color'.split(' '));
}
// end of test definitions
// Run through all tests and detect their support in the current
UA.
// todo: hypothetically we could be doing an array of tests
and use a basic loop here.
for ( var feature in tests ) {
if ( hasOwnProperty( tests, feature ) ) {
// run the test, throw the return value into the
Modernizr,
// then based on that boolean, define an appropriate
className
// and push it into an array of classes we'll join later.
classes.push( ( ( ret[ feature.toLowerCase() ] = tests[
feature ]() ) ? '' : 'no-' ) + feature.toLowerCase() );
}
}
// input tests need to run.
if (!ret[input]) webforms();
/**
* Addtest allows the user to define their own feature tests
* the result will be added onto the Modernizr object,
* as well as an appropriate className set on the html
element
*
* @param feature - String naming the feature
* @param test - Function returning true if feature is
supported, false if not
*/
ret.addTest = function (feature, test) {
feature = feature.toLowerCase();
if (ret[ feature ]) {
return; // quit if you're trying to overwrite an existing test
}
test = !!(test());
docElement.className += ' ' + (test ? '' : 'no-') + feature;
ret[ feature ] = test;
return ret; // allow chaining.
};
/**
* Reset m.style.cssText to nothing to reduce memory
footprint.
*/
set_css( '' );
m = f = null;
// Enable HTML 5 elements for styling in IE.
// fyi: jscript version does not reflect trident version
// therefore ie9 in ie7 mode will still have a jScript v.9
if ( enableHTML5 && (function(){ var elem =
doc.createElement("div");
elem.innerHTML = "<elem></elem>";
return elem.childNodes.length !== 1;
})()) {
// iepp v1.5.1 MIT @jon_neal
http://code.google.com/p/ie-print-protector/
(function(p,e){function
q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var
c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q(
a,b)}}function s(a,b){for(var c=new
RegExp("b("+m+")b(?!.*[;}])","gi"),d=function(k){return".ie
pp_"+k},h=-
1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].css
Text.replace(c,d))}}function t(){for(var
a,b=e.getElementsByTagName("*"),c,d,h=new
RegExp("^"+m+"$","i"),k=-
1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=ne
w
RegExp("^s*<"+d+"(.*)/"+d+">s*$","i");i.innerHTML=a.o
uterHTML.replace(/r|n/g,"
").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<s
pan$1/span>");c=i.childNodes[0];c.className+="
iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[
0])}s(e.styleSheets,"all")}function u(){for(var a=-
1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1
]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var
r=e.documentElement,i=e.createDocumentFragment(),g={},m="
abbr|article|aside|audio|canvas|command|datalist|details|figure|fi
gcaption|footer|header|hgroup|keygen|mark|meter|nav|output|pro
gress|section|source|summary|time|video",n=m.split("|"),f=[],o=
-
1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j
](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforepri
nt",t);p.attachEvent("onafterprint",u)})(this,doc);
}
// Assign private properties to the return object with prefix
ret._enableHTML5 = enableHTML5;
ret._version = version;
// Remove "no-js" class from <html> element, if it exists:
docElement.className=docElement.className.replace(/bno-
jsb/,'') + ' js';
// Add the new classes to the <html> element.
docElement.className += ' ' + classes.join( ' ' );
return ret;
})(this,this.document);
case4/title.jpg
case4/words.js
/*
New Perspectives on HTML5, CSS, and JavaScript
Tutorial 13
Case Problem 4
Variables
=========
puzzleTitle
Name of the word search puzzle
wordList
Array of hidden puzzle words
letterGrid
Multi-dimensional array of letters in the hidden puzzle
wordGrid
Multi-dimensional array specifying the location of hidden
words in the puzzle where the # symbol marks the location
of each letter
*/
var puzzleTitle = "Astronomy";
var wordList = ["CALLISTO", "CERES", "CHARON",
"EARTH", "EUROPA",
"DEMOS", "GANYMEDE", "IO", "JUPITER",
"MARS",
"MERCURY", "MOON", "NEPTUNE", "PHOBOS",
"PLUTO",
"SATURN", "SOL", "TITAN", "URANUS",
"VENUS"];
var letterGrid =
[
["R","K","M","F","T","S","N","Y","L","R","J","S","O","B","O"
,"H","P","Y","X","D","N","A","G","Z","N"],
["T","E","A","A","E","E","U","E","F","N","K","M","T","H","E
","B","V","K","W","U","S","K","N","D","I"],
["S","L","A","R","L","K","P","L","P","O","L","C","A","J","J","
A","Q","D","X","A","S","R","A","M","P"],
["Z","J","E","R","E","Y","R","I","P","N","N","A","B","H","I","
Z","X","O","N","M","M","R","A","T","P"],
["P","C","S","G","T","I","C","L","Y","M","S","L","U","Q","D",
"M","H","N","D","G","K","K","W","W","C"],
["O","A","W","M","W","H","N","V","A","M","T","L","E","R","
Y","R","D","Z","T","L","Z","C","C","C","Q"],
["D","K","N","B","G","H","R","X","S","V","N","I","U","D","A
","F","B","V","O","P","U","J","Z","H","M"],
["G","W","V","Y","S","B","D","A","Q","B","D","S","D","B","
A","N","P","S","X","D","S","Q","W","T","N"],
["P","D","D","T","V","Y","W","C","E","H","Z","T","C","Z","C
","N","U","F","T","B","F","X","H","M","S"],
["D","U","N","P","A","I","E","D","P","A","R","O","U","Q","Q"
,"E","H","S","Q","H","X","T","D","V","M"],
["X","R","H","O","W","D","E","F","W","E","U","P","K","W","
R","P","W","O","V","U","Y","F","B","B","D"],
["V","H","D","J","V","M","U","K","T","X","E","R","V","U","V
","P","R","T","W","B","M","I","A","E","M"],
["U","C","T","K","Y","Q","C","I","X","J","R","E","B","D","R",
"P","Z","K","P","W","I","G","P","M","G"],
["S","Z","K","N","W","A","P","I","L","V","W","S","V","E","N
","U","S","F","N","F","L","J","O","C","M"],
["E","O","A","G","K","U","T","I","Y","T","M","V","Z","U","W
","W","S","A","T","U","R","N","R","E","D"],
["Z","G","J","N","J","Z","W","Y","G","S","O","V","G","M","Z
","R","T","I","T","A","N","S","U","Y","U"],
["C","E","Z","R","D","U","Q","P","U","R","O","R","Z","T","I",
"I","D","B","Z","S","V","F","E","R","V"],
["N","N","L","W","E","P","F","W","A","R","N","U","F","D","B
","V","K","F","X","D","I","V","R","U","T"],
["D","U","B","N","T","N","A","F","W","J","R","J","D","W","G
","A","W","R","C","L","Y","K","I","C","N"],
["S","T","U","J","O","K","Q","D","Y","D","M","R","S","C","X
","S","F","W","I","G","Q","D","B","R","Z"],
["B","P","W","S","A","R","O","I","D","L","Z","T","C","Q","S",
"M","U","C","P","M","J","S","S","E","R"],
["J","E","E","H","I","H","A","C","N","D","Q","P","L","U","T",
"O","S","N","X","J","K","G","C","M","J"],
["Z","N","C","S","I","H","D","H","S","R","Z","J","U","N","E",
"O","J","T","Y","X","A","C","V","S","Z"],
["Q","X","S","Y","L","M","C","L","C","F","Z","K","Z","K","F"
,"T","L","N","N","P","K","J","V","Q","K"],
["C","N","Q","O","L","I","F","N","D","C","P","S","S","R","B",
"S","Q","O","B","D","E","M","O","S","Q"]
]
var wordGrid =
[
[" "," "," "," "," ","#"," "," "," "," "," ","#","#","#","#","#","#","
"," "," "," "," "," "," "," "],
[" ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," ","
"," "," "," "," "," "," "],
[" "," ","#","#"," "," "," "," "," "," "," ","#"," "," "," "," "," ","
"," "," ","#","#","#","#"," "],
[" "," ","#","#"," "," "," "," "," "," "," ","#"," "," "," "," "," ","
"," "," "," "," "," "," "," "],
[" ","#"," "," ","#"," "," "," "," "," "," ","#","#"," "," "," "," ","
"," "," "," "," "," "," "," "],
[" "," "," "," "," ","#"," "," "," "," "," ","#"," ","#"," "," "," ","
"," ","#"," "," "," "," "," "],
[" "," "," "," "," "," "," "," "," "," "," ","#"," "," ","#"," "," ","
","#"," "," "," "," "," "," "],
[" "," "," "," "," "," "," "," "," "," "," ","#"," "," "," ","#","
","#"," "," "," "," "," "," "," "],
[" "," "," "," "," "," "," "," ","#"," "," ","#"," "," "," "," ","#","
"," "," "," "," "," "," "," "],
[" "," "," "," "," "," "," ","#"," "," ","#","#"," "," "," "," ","
","#"," "," "," "," "," "," "," "],
[" "," "," "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," ","
"," "," "," "," "," "," "],
[" "," "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," "," ","
"," "," "," ","#"," "," "],
[" "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," ","
"," "," "," ","#"," "," "],
[" "," "," ","#"," "," ","#"," "," "," "," "," ","#","#","#","#","#","
"," "," "," "," ","#"," "," "],
[" "," ","#"," "," ","#"," "," "," "," ","#"," "," "," "," ","
","#","#","#","#","#","#","#"," "," "],
[" ","#"," "," ","#"," "," "," "," "," ","#"," "," "," "," ","
","#","#","#","#","#"," ","#","#"," "],
[" ","#"," "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," ","
"," "," "," ","#","#"," "],
[" ","#"," "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," ","
"," "," "," "," ","#"," "],
[" ","#"," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
"," "," "," "," ","#"," "],
[" ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," ","
"," "," "," "," ","#"," "],
[" ","#"," "," "," ","#","#","#"," "," "," "," "," "," "," "," "," ","
"," "," "," "," "," ","#"," "],
[" ","#"," "," "," "," ","#"," "," "," "," ","#","#","#","#","#"," ","
"," "," "," "," "," ","#"," "],
[" ","#"," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," ","
"," "," "," "," "," "," "],
[" "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," ","
"," "," "," "," "," "," "],
[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
","#","#","#","#","#"," "]
]
case4/wordsearch.css
/*
New Perspectives on HTML5, CSS and JavaScript
Tutorial 13
Case Problem 4
The Word Search Table Style Sheet
Filename: wordsearch.css
Supporting Files:
*/
/* Default styles for the Word Search Table */
table#wordsearchtable {
border: 1px solid black;
border-collapse;
width: 600px;
}
/* Styles for cells within the Word Search Table */
table#wordsearchtable td {
width: 20px;
height: 20px;
line-height: 20px;
border: 1px solid transparent;
text-align: center;
vertical-align: middle;
font-size: 12px;
cursor: pointer;
}
/* Styles for unordered list of hidden words */
ul#wordsearchlist {
margin-left: 20px;
padding-left: 0px;
list-style-type: none;
}
ul#wordsearchlist li {
font-size: 12px;
line-height: 1.8em;
cursor: pointer;
}
case4/wordsearch.htmAstronomy
Click the letters in the grid that match the words listed
below. When you find a word, strike it out from the
list
by clicking the entry.
case4/wordsearch.js
/*
New Perspectives on HTML5, CSS, and JavaScript
Tutorial 13
Case Problem 4
Author:
Date:
Function List
=============
drawWordSearch(letters, words)
Function to create a Web table containing hidden words
where
letters is a multi-dimensional array containing the grid of
letters and words is a multi-dimensional array specifying
the location of the hidden words in the puzzle
*/
function drawWordSearch(letters, words) {
var rowSize = letters.length;
var colSize = letters[0].length;
var htmlCode = "<table id='wordsearchtable'>";
for (var i = 0; i < rowSize; i++) {
htmlCode += "<tr>";
for (var j = 0; j < colSize; j++) {
if (words[i][j] == " ") {
htmlCode += "<td>";
} else {
htmlCode += "<td class='wordCell'>";
}
htmlCode += letters[i][j];
htmlCode += "</td>";
}
htmlCode += "</tr>";
}
htmlCode += "</table>";
return htmlCode;
}

More Related Content

Similar to ALKATAN 1Google CarAs we know the trends are being influence.docx

Google self driving car technology
Google self driving car technology Google self driving car technology
Google self driving car technology suraj bhatta
 
Autonomous or self driving cars
Autonomous or self driving carsAutonomous or self driving cars
Autonomous or self driving carsSandeep Nayak
 
Autonomous Vehicles (from FC&S) by Christine G. Barlow
Autonomous Vehicles (from FC&S) by Christine G. BarlowAutonomous Vehicles (from FC&S) by Christine G. Barlow
Autonomous Vehicles (from FC&S) by Christine G. BarlowNationalUnderwriter
 
Google driverless car with working
Google driverless car with workingGoogle driverless car with working
Google driverless car with workingPiyush tyagi
 
Can automakers catch up with google in driverless cars (Financial Times)
Can automakers catch up with google in driverless cars  (Financial Times)Can automakers catch up with google in driverless cars  (Financial Times)
Can automakers catch up with google in driverless cars (Financial Times)optimalplustlmmarketing
 
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...Altimeter, a Prophet Company
 
Las432 team f-autonomouscar
Las432 team f-autonomouscarLas432 team f-autonomouscar
Las432 team f-autonomouscarbrentzipkin
 
GOOGLE'S AUTONOMUS CAR
GOOGLE'S AUTONOMUS CARGOOGLE'S AUTONOMUS CAR
GOOGLE'S AUTONOMUS CARjolsnaj
 
Autonomus cars Article
Autonomus cars ArticleAutonomus cars Article
Autonomus cars ArticleTamanna Rahman
 
Intelligent Vehicles
Intelligent VehiclesIntelligent Vehicles
Intelligent Vehiclesanakarenbm
 
Hi all, I just need a conclusion add to this paper. Can anyone help .docx
Hi all, I just need a conclusion add to this paper. Can anyone help .docxHi all, I just need a conclusion add to this paper. Can anyone help .docx
Hi all, I just need a conclusion add to this paper. Can anyone help .docxtrappiteboni
 
The Connected Vehicle: Viewing the Road Ahead
The Connected Vehicle: Viewing the Road AheadThe Connected Vehicle: Viewing the Road Ahead
The Connected Vehicle: Viewing the Road AheadAccenture Insurance
 
Smart phones, big data & your car
Smart phones, big data & your carSmart phones, big data & your car
Smart phones, big data & your carNash Ogden
 
The Legal Implications of Autonomous Vehicles
The Legal Implications of Autonomous VehiclesThe Legal Implications of Autonomous Vehicles
The Legal Implications of Autonomous VehiclesDaniel Thompson
 

Similar to ALKATAN 1Google CarAs we know the trends are being influence.docx (20)

Google self driving car technology
Google self driving car technology Google self driving car technology
Google self driving car technology
 
Autonomous or self driving cars
Autonomous or self driving carsAutonomous or self driving cars
Autonomous or self driving cars
 
Autonomous Vehicles (from FC&S) by Christine G. Barlow
Autonomous Vehicles (from FC&S) by Christine G. BarlowAutonomous Vehicles (from FC&S) by Christine G. Barlow
Autonomous Vehicles (from FC&S) by Christine G. Barlow
 
Google driverless car with working
Google driverless car with workingGoogle driverless car with working
Google driverless car with working
 
18_Connectivity
18_Connectivity18_Connectivity
18_Connectivity
 
Can automakers catch up with google in driverless cars (Financial Times)
Can automakers catch up with google in driverless cars  (Financial Times)Can automakers catch up with google in driverless cars  (Financial Times)
Can automakers catch up with google in driverless cars (Financial Times)
 
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...
The Race to 2021: The State of Autonomous Vehicles and a "Who's Who" of Indus...
 
Las432 team f-autonomouscar
Las432 team f-autonomouscarLas432 team f-autonomouscar
Las432 team f-autonomouscar
 
Nbtb mmc4300
Nbtb mmc4300Nbtb mmc4300
Nbtb mmc4300
 
GOOGLE'S AUTONOMUS CAR
GOOGLE'S AUTONOMUS CARGOOGLE'S AUTONOMUS CAR
GOOGLE'S AUTONOMUS CAR
 
Autonomous car
Autonomous car Autonomous car
Autonomous car
 
Autonomus cars Article
Autonomus cars ArticleAutonomus cars Article
Autonomus cars Article
 
Intelligent Vehicles
Intelligent VehiclesIntelligent Vehicles
Intelligent Vehicles
 
Google's Driverless Car
Google's Driverless CarGoogle's Driverless Car
Google's Driverless Car
 
sr5108
sr5108sr5108
sr5108
 
Hi all, I just need a conclusion add to this paper. Can anyone help .docx
Hi all, I just need a conclusion add to this paper. Can anyone help .docxHi all, I just need a conclusion add to this paper. Can anyone help .docx
Hi all, I just need a conclusion add to this paper. Can anyone help .docx
 
The Connected Vehicle: Viewing the Road Ahead
The Connected Vehicle: Viewing the Road AheadThe Connected Vehicle: Viewing the Road Ahead
The Connected Vehicle: Viewing the Road Ahead
 
Smart phones, big data & your car
Smart phones, big data & your carSmart phones, big data & your car
Smart phones, big data & your car
 
The Legal Implications of Autonomous Vehicles
The Legal Implications of Autonomous VehiclesThe Legal Implications of Autonomous Vehicles
The Legal Implications of Autonomous Vehicles
 
Robotics
RoboticsRobotics
Robotics
 

More from galerussel59292

Assessment 4 Instructions Health Promotion Plan Presentation.docx
Assessment 4 Instructions Health Promotion Plan Presentation.docxAssessment 4 Instructions Health Promotion Plan Presentation.docx
Assessment 4 Instructions Health Promotion Plan Presentation.docxgalerussel59292
 
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docx
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docxAssessment 4 Instructions Remote Collaboration and Evidence-Based C.docx
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docxgalerussel59292
 
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docx
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docxAssessment 4Cost Savings AnalysisOverviewPrepare a spreads.docx
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docxgalerussel59292
 
Assessment 4 Instructions Final Care Coordination Plan .docx
Assessment 4 Instructions Final Care Coordination Plan .docxAssessment 4 Instructions Final Care Coordination Plan .docx
Assessment 4 Instructions Final Care Coordination Plan .docxgalerussel59292
 
Assessment 3PRINTPatient Discharge Care Planning .docx
Assessment 3PRINTPatient Discharge Care Planning    .docxAssessment 3PRINTPatient Discharge Care Planning    .docx
Assessment 3PRINTPatient Discharge Care Planning .docxgalerussel59292
 
Assessment 4 ContextRecall that null hypothesis tests are of.docx
Assessment 4 ContextRecall that null hypothesis tests are of.docxAssessment 4 ContextRecall that null hypothesis tests are of.docx
Assessment 4 ContextRecall that null hypothesis tests are of.docxgalerussel59292
 
Assessment 3PRINTLetter to the Editor Population Health P.docx
Assessment 3PRINTLetter to the Editor Population Health P.docxAssessment 3PRINTLetter to the Editor Population Health P.docx
Assessment 3PRINTLetter to the Editor Population Health P.docxgalerussel59292
 
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docx
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docxAssessment 3 Instructions Disaster Recovery PlanDevelop a d.docx
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docxgalerussel59292
 
Assessment 3 Instructions Professional Product     Develop a .docx
Assessment 3 Instructions Professional Product     Develop a .docxAssessment 3 Instructions Professional Product     Develop a .docx
Assessment 3 Instructions Professional Product     Develop a .docxgalerussel59292
 
Assessment 3 Instructions Care Coordination Presentation to Colleag.docx
Assessment 3 Instructions Care Coordination Presentation to Colleag.docxAssessment 3 Instructions Care Coordination Presentation to Colleag.docx
Assessment 3 Instructions Care Coordination Presentation to Colleag.docxgalerussel59292
 
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docx
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docxAssessment 3Essay TIPSSWK405 The taskEssayWhen.docx
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docxgalerussel59292
 
Assessment 3 Health Assessment ProfessionalCommunication.docx
Assessment 3 Health Assessment ProfessionalCommunication.docxAssessment 3 Health Assessment ProfessionalCommunication.docx
Assessment 3 Health Assessment ProfessionalCommunication.docxgalerussel59292
 
Assessment 3Disaster Plan With Guidelines for Implementation .docx
Assessment 3Disaster Plan With Guidelines for Implementation .docxAssessment 3Disaster Plan With Guidelines for Implementation .docx
Assessment 3Disaster Plan With Guidelines for Implementation .docxgalerussel59292
 
Assessment 3 ContextYou will review the theory, logic, and a.docx
Assessment 3 ContextYou will review the theory, logic, and a.docxAssessment 3 ContextYou will review the theory, logic, and a.docx
Assessment 3 ContextYou will review the theory, logic, and a.docxgalerussel59292
 
Assessment 2Quality Improvement Proposal Overview .docx
Assessment 2Quality Improvement Proposal    Overview .docxAssessment 2Quality Improvement Proposal    Overview .docx
Assessment 2Quality Improvement Proposal Overview .docxgalerussel59292
 
Assessment 2by Jaquetta StevensSubmission dat e 14 - O.docx
Assessment 2by Jaquetta StevensSubmission dat e  14 - O.docxAssessment 2by Jaquetta StevensSubmission dat e  14 - O.docx
Assessment 2by Jaquetta StevensSubmission dat e 14 - O.docxgalerussel59292
 
Assessment 2PRINTBiopsychosocial Population Health Policy .docx
Assessment 2PRINTBiopsychosocial Population Health Policy .docxAssessment 2PRINTBiopsychosocial Population Health Policy .docx
Assessment 2PRINTBiopsychosocial Population Health Policy .docxgalerussel59292
 
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docx
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docxAssessment 2 Instructions Ethical and Policy Factors in Care Coordi.docx
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docxgalerussel59292
 
Assessment 2-Analysing factual  texts This assignment re.docx
Assessment 2-Analysing factual  texts This assignment re.docxAssessment 2-Analysing factual  texts This assignment re.docx
Assessment 2-Analysing factual  texts This assignment re.docxgalerussel59292
 
Assessment 2DescriptionFocusEssayValue50Due D.docx
Assessment 2DescriptionFocusEssayValue50Due D.docxAssessment 2DescriptionFocusEssayValue50Due D.docx
Assessment 2DescriptionFocusEssayValue50Due D.docxgalerussel59292
 

More from galerussel59292 (20)

Assessment 4 Instructions Health Promotion Plan Presentation.docx
Assessment 4 Instructions Health Promotion Plan Presentation.docxAssessment 4 Instructions Health Promotion Plan Presentation.docx
Assessment 4 Instructions Health Promotion Plan Presentation.docx
 
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docx
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docxAssessment 4 Instructions Remote Collaboration and Evidence-Based C.docx
Assessment 4 Instructions Remote Collaboration and Evidence-Based C.docx
 
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docx
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docxAssessment 4Cost Savings AnalysisOverviewPrepare a spreads.docx
Assessment 4Cost Savings AnalysisOverviewPrepare a spreads.docx
 
Assessment 4 Instructions Final Care Coordination Plan .docx
Assessment 4 Instructions Final Care Coordination Plan .docxAssessment 4 Instructions Final Care Coordination Plan .docx
Assessment 4 Instructions Final Care Coordination Plan .docx
 
Assessment 3PRINTPatient Discharge Care Planning .docx
Assessment 3PRINTPatient Discharge Care Planning    .docxAssessment 3PRINTPatient Discharge Care Planning    .docx
Assessment 3PRINTPatient Discharge Care Planning .docx
 
Assessment 4 ContextRecall that null hypothesis tests are of.docx
Assessment 4 ContextRecall that null hypothesis tests are of.docxAssessment 4 ContextRecall that null hypothesis tests are of.docx
Assessment 4 ContextRecall that null hypothesis tests are of.docx
 
Assessment 3PRINTLetter to the Editor Population Health P.docx
Assessment 3PRINTLetter to the Editor Population Health P.docxAssessment 3PRINTLetter to the Editor Population Health P.docx
Assessment 3PRINTLetter to the Editor Population Health P.docx
 
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docx
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docxAssessment 3 Instructions Disaster Recovery PlanDevelop a d.docx
Assessment 3 Instructions Disaster Recovery PlanDevelop a d.docx
 
Assessment 3 Instructions Professional Product     Develop a .docx
Assessment 3 Instructions Professional Product     Develop a .docxAssessment 3 Instructions Professional Product     Develop a .docx
Assessment 3 Instructions Professional Product     Develop a .docx
 
Assessment 3 Instructions Care Coordination Presentation to Colleag.docx
Assessment 3 Instructions Care Coordination Presentation to Colleag.docxAssessment 3 Instructions Care Coordination Presentation to Colleag.docx
Assessment 3 Instructions Care Coordination Presentation to Colleag.docx
 
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docx
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docxAssessment 3Essay TIPSSWK405 The taskEssayWhen.docx
Assessment 3Essay TIPSSWK405 The taskEssayWhen.docx
 
Assessment 3 Health Assessment ProfessionalCommunication.docx
Assessment 3 Health Assessment ProfessionalCommunication.docxAssessment 3 Health Assessment ProfessionalCommunication.docx
Assessment 3 Health Assessment ProfessionalCommunication.docx
 
Assessment 3Disaster Plan With Guidelines for Implementation .docx
Assessment 3Disaster Plan With Guidelines for Implementation .docxAssessment 3Disaster Plan With Guidelines for Implementation .docx
Assessment 3Disaster Plan With Guidelines for Implementation .docx
 
Assessment 3 ContextYou will review the theory, logic, and a.docx
Assessment 3 ContextYou will review the theory, logic, and a.docxAssessment 3 ContextYou will review the theory, logic, and a.docx
Assessment 3 ContextYou will review the theory, logic, and a.docx
 
Assessment 2Quality Improvement Proposal Overview .docx
Assessment 2Quality Improvement Proposal    Overview .docxAssessment 2Quality Improvement Proposal    Overview .docx
Assessment 2Quality Improvement Proposal Overview .docx
 
Assessment 2by Jaquetta StevensSubmission dat e 14 - O.docx
Assessment 2by Jaquetta StevensSubmission dat e  14 - O.docxAssessment 2by Jaquetta StevensSubmission dat e  14 - O.docx
Assessment 2by Jaquetta StevensSubmission dat e 14 - O.docx
 
Assessment 2PRINTBiopsychosocial Population Health Policy .docx
Assessment 2PRINTBiopsychosocial Population Health Policy .docxAssessment 2PRINTBiopsychosocial Population Health Policy .docx
Assessment 2PRINTBiopsychosocial Population Health Policy .docx
 
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docx
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docxAssessment 2 Instructions Ethical and Policy Factors in Care Coordi.docx
Assessment 2 Instructions Ethical and Policy Factors in Care Coordi.docx
 
Assessment 2-Analysing factual  texts This assignment re.docx
Assessment 2-Analysing factual  texts This assignment re.docxAssessment 2-Analysing factual  texts This assignment re.docx
Assessment 2-Analysing factual  texts This assignment re.docx
 
Assessment 2DescriptionFocusEssayValue50Due D.docx
Assessment 2DescriptionFocusEssayValue50Due D.docxAssessment 2DescriptionFocusEssayValue50Due D.docx
Assessment 2DescriptionFocusEssayValue50Due D.docx
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

ALKATAN 1Google CarAs we know the trends are being influence.docx

  • 1. ALKATAN 1 Google Car As we know the trends are being influenced in our modern world with respect to the advancement of technology in our society accordingly. The perceptions of consumers related to cars are widely influenced because of the continuous increase of our daily life expense. This paper is about the Google self driving car which is a project by Google that engages rising technology for self driving cars. The cars exploit a blend of technologies, together with radar sensors on the front side, movie cameras intended at the adjacent area, a variety of other sensors and synthetic intellect software that aids in guiding. There have been no mishaps while the cars were managed by the computer. The system makes at the speed boundary, it has stored in its ways and keeps its space from other automobiles by means of its system of sensors. The system offers an override that permits a human driver to keep control of the vehicle by moving on the brake or rotating the wheel. As the thought of a Google Car was initiated, the appraisals have been polarized. Here is abundance of optimistic remarks about Google Car. Google’s firm and huge database, particularly data on maps is very much praised and trusted to be practical and necessary in advancement of the self driving car. In this paper, the discussions have been made about testing and troubleshooting, finalizing and Users' manual about the Google driverless car project. It has been produced prototypes of a self driving car already by Google. However, actually advertising them and locating them on the way is another story. The organization recognizes that at the present time, mobile networks are not prepared to deal vehicles. The major carriers hardly have sufficient ranges to serve their human clients, however work is in progress to get used to the white space range for machine-to-machine
  • 2. associations. In the United States of America, Google is a manager of a database of white space, meaning that it adds to list tools that is to be employed on the white space range. On the other hand, Google may have to discover other alternatives for its associated cars. The white space range is most excellently matched for signals that have extended range and inferior frequency than those that convey voice and facts over mobile networks. The majority M2M signals do not require to be conveyed constant at increase speeds. However, those of a self driving car might be a significant immunity. The car also contains other sensors, which comprise: four radars, located on the face and back bumpers, that facilitate the car to "observe" distant enough to be intelligent to take care of fast traffic on freeways; a movie camera, placed close to the back-view mirror, that senses traffic luminosities and a GPS, inertial calculation unit, and wheel encoder, that find out the car's position and keep follow on its activities (Martha DeGrasse, 2013). For Road testing, the project team has prepared a test task force of ten cars at least, consisting of three Lexus RX450h, six Toyota Prius and an Audi TT. Each carried by one of a dozen drivers in the driver's seat with flawless driving confirmations and in the traveler seat of passenger by one of the engineers of Google. The car was crossing Lombard Street in San Francisco, renowned for its abrupt hairpin twist turns and by city traffic. The cars have passed over the Golden Gate Bridge and in the region of Lake Tahoe. The speed limit of the system drives has saved on its records and keeps its space from other automobiles using its sensor system. The system presents an override that permits a human driver to get control of the vehicle by turning the wheel or stepping on the brake, parallel to cruise manage systems found in a lot of cars already as today. Google placed a YouTube video demonstrating Steve Mahan, a resident of Morgan Hill California, being taken on a journey in its self-driving car, Toyota Prius on March 28, 2012. Mahan states in the video, “95 % of my visualizing ability are gone; I'm well past officially sightless". In the report of the video on
  • 3. YouTube, it is found that the cautiously planned route gets him from his residence to a drive through café, then to the shop about dry cleaning, and lastly back to home. The team stated that they have finished in excess of 300,000 self-directed driving miles (500 000 km) free of accident, characteristically have about a dozen cars on the highway at any specified time, and are opening to test them with solo drivers rather than in Paris in August 2012. Permitting self driving cars as of September 2012, Three U.S. states that are Nevada, Florida, and California have passed laws (Erico Guizzo, 2011). For finalizing its new attempt, Google has been discussion to the main auto-parts organizations, such as Magna International and Continental AG, to produce a car under the directions of Google Company. Presently as supply-chain Corporation Foxconn aids Apple and other hardware organizations to build computers and phones, these organizations offer parts to large automakers and assist them bring together automobiles. Google’s look for a producer demonstrates how cars could develop into the newest part of the hardware business to be commoditized, much like mobile devices and computers have. Those devices have the bodies are now prepared with an extensive collection of economical suppliers, while the apps and software that carry on them have increased in significance. Whether Google will advance and associate with an agreement producer to construct a car to its requirements remains indistinct. The organization is still looking for to partner with renowned automakers, one of the people recognizable with the attempt. However, the effort like “do-it-yourself” is typical Google characteristics. The organization intends its own laptops and phones, in big part to support accessible hardware makers to pursue its escort and accept fresh features of its operating system of Android mobile and Chrome software in recent years. Google’s present, small task force of self-driving automobiles which are Toyotas retrofitted with movie cameras, feelers, radars, and Google’s unique software, worth around $150,000 a piece, according one
  • 4. person recognizable with the theme. Google has been functioning hard to lesser the price by designing some hardware parts on its own. The economic dangers interpret why the task is established in Google X, the R&D lab beside Google’s headquarters. Google X focuses on what CEO Larry Page calls “moon shots,” or high-risk tasks that could have large-scale payouts if they succeed. Inevitably, there will be political and regulatory obstacles too. Google has been employed to confirm self-driving vehicles will be formally legalized in the U.S. It before spearheading legislation in Nevada, California, Florida and Washington DC that permits for authorizing and checking autonomous vehicles on public roads (Amir Efrati, 2013). The user manual of the Google driverless car has not so defined yet. In its most comprehensive answer yet to trials with self- driving vehicles by Google Inc., The National Highway Traffic Safety Administration said states should need drivers of prototype self-driving vehicles to get additional teaching and exceptional permits to display they can securely function the vehicles on public roads. For now, the bureau states shouldn't permit procedure of self-driving vehicles on public streets except for checking purposes. The NHTSA, although, alerted states contrary to enforcing too numerous exact guidelines on an expertise that is developing rapidly. At a latest commerce seminar, bosses said that by 2020 they anticipated buyers will be adept to purchase vehicles proposing restricted self-driving capability, and that by 2025 completely autonomous vehicles could be accessible in important numbers (Joseph B., 2013). Several states, encompassing California, Florida and Nevada, have passed regulations permitting procedure of self-driving vehicles for checking reasons on public streets. Overall, the article displays controllers are keen to encourage the study of self-driving vehicles, which they said have the promise to decrease main street misfortunes and killings, and to constrain fossil-fuel emissions. "We believe there's large potential," said Deputy NHTSA Administrator David Friedman in an interview. The NHTSA guidelines, he said, are directed at suggesting
  • 5. states on how to double-check that still mostly untested autonomous vehicles can coexist securely with other vehicles on the road. Among the matters, Mr. Friedman said, is how many alert drivers require of a difficulty that needs them to retake the controls of a vehicle that has been going by car itself. Mr. Friedman said the guidelines furthermore are directed at clarifying up the disarray over how the government outlooks distinct kinds of self-driving technology. The article summaries five grades of automation, from "Level 0" vehicles in which drivers are absolutely in command at all times, through Level-3 "limited automation" vehicles that can propel themselves utilizing laser or radar sensors to stay in a roadway and hold a protected expanse from other cars. These vehicles can still need a person going by car to take a scribe from time to time. NHTSA recounts "Level 4" as "full self going by car automation"—a vehicle that can come to a place travelled to without any going by car by the passenger. Google's self- driving vehicles, which use laser sensors and mapping expertise, are demonstrations of Level 3 vehicles, Mr. Friedman said (Joseph B., 2013). The NHTSA guidelines are voluntary, and no one of the suggestions would probable halt checking by Google or vehicle makers. Google didn't exactly commentary on the details of the guidelines. "We are inserting autonomous vehicle expertise to advance people's inhabits by producing going by car safer, more delightful, and more efficient," the business side. The development of self-driving expertise is being spurred by some forces. Researchers are progressively worried by clues that the major origin of mortal main street misfortunes isn't defective vehicles, but awful driving. A latest NHTSA study of smash into facts and numbers discovered that just 1% of drivers in the experiment directed the brakes at full force before a collision (Joseph B., 2013). In conclusion, we must say that in our present scenario the advancement of technology by the wonders of science has been completely acquired peoples around the globe, prior to this the
  • 6. great hike of a hybrid car was a major trend of peoples but presenting the concept of modern trend that is the Google self driving car is going to be most successful. The various surveys executed in the major area of our communities reflect the high demand of this product prior to the actual launch of this project which is a wonderful, having marvelous design, testing and troubleshooting in a right way, planning for great finalizing, but still working on its user manual system which is not yet clear. Moreover according to the recent reports the demand of Google car has already captured the market with advance booking of more than a thousand users till date. According to the estimated plan for this project, just after the launch of Google car it would be one of the highest selling cars in the entire automobile sector acquiring the majority of the market. References 1. Martha DeGrasse, Google said to move driverless car into fast lane, rcrwireless.com, 26 August 2013, web. Retrieved 20 November 2013 from http://www.rcrwireless.com/article/20130826/devices/google- reportedly-fast-tracks-driverless-car/ 2. Erico Guizzo, How Google's Self-Driving Car Works, spectrum.ieee.org, 18 Oct 2011, web. Retrieved 20 November 2013 from http://spectrum.ieee.org/automaton/robotics/artificial- intelligence/how-google-self-driving-car-works 3. Amir Efrati, Exclusive: Google Designing Its Own Self- Driving Car, Considers ‘Robo Taxi’, jessicalessin.com, August 23, 2013, web. Retrieved 20 November 2013 from http://jessicalessin.com/2013/08/23/exclusive-google-designing-
  • 7. its-own-self-driving-car-considers-robo-taxi-2/ 4. Joseph B., Self-Driving Cars Spark New Guidelines, online.wsj.com, May 30, 2013, web. Retrieved 20 November 2013 from http://online.wsj.com/news/articles/SB100014241278873237282 04578515081578077890 case4/headmenu.jpg case4/kglogo.jpg case4/kgstyles.css /* New Perspectives on HTML5, CSS and JavaScript Tutorial 13 Case Problem 4 The Word Search Style Sheet Filename: kgstyles.css
  • 8. Supporting Files: */ /* Display HTML5 structural elements as blocks */ article, aside, figure, figcaption, footer, hgroup, header, section, nav { display: block; } /* Set the default page element styles */ body { margin: 0px; }
  • 9. body * { font-family: Verdana, Geneva, sans-serif; font-size: 100%; font-weight: inherit; line-height: 1.2em; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline; } /* Styles for the main page section */ section { position: absolute;
  • 10. margin: 0px auto; width: 100%; } header img { margin-top: 10px; margin-left: 54px; } #links { position: absolute; left: 0px; top: 102px; }
  • 11. /* Styles for the main article */ article { position: absolute; left: 213px; top: 106px; } article img { position: absolute; top: 0px; left: 0px; } article #h1img { position: absolute; top: 48px; left: 129px;
  • 12. } /* Word search table placement */ figure#wordTable { float: left; margin-top: 150px; width: 600px; } /* Placement of the aside element containing the list of hidden words */
  • 13. aside { float: left; width: 220px; margin-top: 150px; margin-left: 10px; } aside h1 { font-size: 24px; letter-spacing: 5px; margin: 0px 0px 20px 0px; } aside p { font-size: 14px; margin: 10px 0px; }
  • 14. /* div element containing the Show Solution button */ article div { clear: left; float: left; width: 600px; margin-top: 10px; text-align: center; }
  • 15. article div input { width: 150px; font-size: 14px; height: 30px; } case4/links.jpg case4/modernizr-1.5.js /*! * Modernizr JavaScript library 1.5 * http://www.modernizr.com/ * * Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
  • 16. * Dual-licensed under the BSD and MIT licenses. * http://www.modernizr.com/license/ * * Featuring major contributions by * Paul Irish - http://paulirish.com */ /* * LicenseModernizr is available under the MIT and BSD licenses: * MIT License * Copyright (c) 2009–2010 Faruk Ate?
  • 17. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software.
  • 18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * BSD License
  • 19. * Copyright (c) 2010, Faruk Ate? * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution.
  • 20. * * Neither the name of the Organization nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  • 21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Modernizr is a script that will detect native CSS3 and HTML5 features
  • 22. * available in the current UA and provide an object containing all * features with a true/false value, depending on whether the UA has * native support for it or not. * * In addition to that, Modernizr will add classes to the <html> * element of the page, one for each cutting-edge feature. If the UA * supports it, a class like "cssgradients" will be added. If not, * the class name will be "no-cssgradients". This allows for simple * if-conditionals in CSS styling, making it easily to have fine * control over the look and feel of your website. *
  • 23. * @author Faruk Ates * @copyright (c) 2009-2010 Faruk Ates. * * @contributor Paul Irish * @contributor Ben Alman */ window.Modernizr = (function(window,doc,undefined){ var version = '1.5', ret = {},
  • 24. /** * enableHTML5 is a private property for advanced use only. If enabled, * it will make Modernizr.init() run through a brief while() loop in * which it will create all HTML5 elements in the DOM to allow for * styling them in Internet Explorer, which does not recognize any * non-HTML4 elements unless created in the DOM this way. * * enableHTML5 is ON by default. */ enableHTML5 = true,
  • 25. /** * fontfaceCheckDelay is the ms delay before the @font-face test is * checked a second time. This is neccessary because both Gecko and * WebKit do not load data: URI font data synchronously. * https://bugzilla.mozilla.org/show_bug.cgi?id=512566 * The check will be done again at fontfaceCheckDelay*2 and then * a fourth time at window's load event. * If you need to query for @font-face support, send a callback to:
  • 26. * Modernizr._fontfaceready(fn); * The callback is passed the boolean value of Modernizr.fontface */ fontfaceCheckDelay = 75, docElement = doc.documentElement, /** * Create our "modernizr" element that we do most feature tests on. */ mod = 'modernizr',
  • 27. m = doc.createElement( mod ), m_style = m.style, /** * Create the input element for various Web Forms feature tests. */ f = doc.createElement( 'input' ), // Reused strings, stored here to allow better minification canvas = 'canvas', canvastext = 'canvastext',
  • 28. rgba = 'rgba', hsla = 'hsla', multiplebgs = 'multiplebgs', backgroundsize = 'backgroundsize', borderimage = 'borderimage', borderradius = 'borderradius', boxshadow = 'boxshadow', opacity = 'opacity', cssanimations = 'cssanimations', csscolumns = 'csscolumns', cssgradients = 'cssgradients', cssreflections = 'cssreflections',
  • 29. csstransforms = 'csstransforms', csstransforms3d = 'csstransforms3d', csstransitions = 'csstransitions', fontface = 'fontface', geolocation = 'geolocation', video = 'video', audio = 'audio', input = 'input', inputtypes = input + 'types', // inputtypes is an object of its own containing individual tests for // various new input types, such as search, range, datetime, etc.
  • 30. svg = 'svg', smil = 'smil', svgclippaths = svg+'clippaths', background = 'background', backgroundColor = background + 'Color', canPlayType = 'canPlayType', // FF gets really angry if you name local variables as these, but camelCased. localstorage = 'localStorage', sessionstorage = 'sessionStorage', applicationcache = 'applicationCache',
  • 31. webWorkers = 'webworkers', hashchange = 'hashchange', crosswindowmessaging = 'crosswindowmessaging', historymanagement = 'historymanagement', draganddrop = 'draganddrop', websqldatabase = 'websqldatabase', indexedDB = 'indexedDB', websockets = 'websockets', smile = ':)', // IE7 gets mad if you name a local variable `toString`
  • 32. tostring = Object.prototype.toString, // list of property values to set for css tests. see ticket #21 prefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '), tests = {}, inputs = {}, attrs = {}, classes = [], /** * isEventSupported determines if a given element supports
  • 33. the given event * function from http://yura.thinkweb2.com/isEventSupported/ */ isEventSupported = (function(){ var TAGNAMES = { 'select':'input','change':'input', 'submit':'form','reset':'form', 'error':'img','load':'img','abort':'img' }, cache = { };
  • 34. function isEventSupported(eventName, element) { var canCache = (arguments.length == 1); // only return cached result when no element is given if (canCache && cache[eventName]) { return cache[eventName]; } element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize"
  • 35. // `in` "catches" those var isSupported = (eventName in element); if (!isSupported && element.setAttribute) { element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] == 'function'; } element = null; return canCache ? (cache[eventName] = isSupported) : isSupported; }
  • 36. return isEventSupported; })(); var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; if (typeof _hasOwnProperty !== 'undefined' && typeof _hasOwnProperty.call !== 'undefined') { hasOwnProperty = function (object, property) { return _hasOwnProperty.call(object, property); }; } else {
  • 37. hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ return ((property in object) && typeof object.constructor.prototype[property] === 'undefined'); }; } /** * set_css applies given styles to the Modernizr DOM node. */ function set_css( str ) { m_style.cssText = str; }
  • 38. /** * set_css_all extrapolates all vendor-specific css strings. */ function set_css_all( str1, str2 ) { return set_css(prefixes.join(str1 + ';') + ( str2 || '' )); } /** * contains returns a boolean for if substr is found within str. */ function contains( str, substr ) {
  • 39. return (''+str).indexOf( substr ) !== -1; } /** * test_props is a generic CSS / DOM property test; if a browser supports * a certain property, it won't return undefined for it. * A supported CSS property returns empty string when its not yet set. */ function test_props( props, callback ) { for ( var i in props ) { if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) {
  • 40. return true; } } } /** * test_props_all tests a list of DOM properties we want to check against. * We specify literally ALL possible (known and/or likely) properties on * the element including the non-vendor prefixed one, for forward- * compatibility. */
  • 41. function test_props_all( prop, callback ) { var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1), // following spec is to expose vendor-specific style properties as: // elem.style.WebkitBorderRadius // and the following would be incorrect: // elem.style.webkitBorderRadius // Webkit and Mozilla are nice enough to ghost their properties in the lowercase // version but Opera does not. // see more here: http://github.com/Modernizr/Modernizr/issues/issue/21
  • 42. props = [ prop, 'Webkit' + uc_prop, 'Moz' + uc_prop, 'O' + uc_prop, 'ms' + uc_prop, 'Khtml' + uc_prop ]; return !!test_props( props, callback ); }
  • 43. /** * Tests */ tests[canvas] = function() { return !!doc.createElement( canvas ).getContext; }; tests[canvastext] = function() { return !!(tests[canvas]() && typeof doc.createElement( canvas ).getContext('2d').fillText == 'function'); };
  • 44. /** * The Modernizr.touch test only indicates if the browser supports * touch events, which does not necessarily reflect a touchscreen * device, as evidenced by tablets running Windows 7 or, alas, * the Palm Pre / WebOS (touch) phones. * Additionally, chrome used to lie about its support on this, but that * has since been recitifed: http://crbug.com/36415 * Because there is no way to reliably detect Chrome's false positive * without UA sniffing we have removed this test from Modernizr. We
  • 45. * hope to add it in after Chrome 5 has been sunsetted. * See also http://github.com/Modernizr/Modernizr/issues#issue/84 tests[touch] = function() { return !!('ontouchstart' in window); }; */ /** * geolocation tests for the new Geolocation API
  • 46. specification. * This test is a standards compliant-only test; for more complete * testing, including a Google Gears fallback, please see: * http://code.google.com/p/geo-location-javascript/ * or view a fallback solution using google's geo API: * http://gist.github.com/366184 */ tests[geolocation] = function() { return !!navigator.geolocation; }; tests[crosswindowmessaging] = function() {
  • 47. return !!window.postMessage; }; tests[websqldatabase] = function() { var result = !!window.openDatabase; if (result){ try { result = !!openDatabase("testdb", "1.0", "html5 test db", 200000); } catch(err) { result = false; } }
  • 48. return result; }; tests[indexedDB] = function(){ return !!window[indexedDB]; }; // documentMode logic from YUI to filter out IE8 Compat Mode // which false positives. tests[hashchange] = function() { return isEventSupported(hashchange, window) && ( document.documentMode === undefined || document.documentMode > 7 );
  • 49. }; tests[historymanagement] = function() { return !!(window.history && history.pushState); }; tests[draganddrop] = function() { return isEventSupported('drag') && isEventSupported('dragstart') && isEventSupported('dragenter') && isEventSupported('dragover') && isEventSupported('dragleave') && isEventSupported('dragend')
  • 50. && isEventSupported('drop'); }; tests[websockets] = function(){ return ('WebSocket' in window); }; // http://css-tricks.com/rgba-browser-support/ tests[rgba] = function() { // Set an rgba() color and check the returned value
  • 51. set_css( background + '-color:rgba(150,255,150,.5)' ); return contains( m_style[backgroundColor], rgba ); }; tests[hsla] = function() { // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally set_css( background + '-color:hsla(120,40%,100%,.5)' ); return contains( m_style[backgroundColor], rgba );
  • 52. }; tests[multiplebgs] = function() { // Setting multiple images AND a color on the background shorthand property // and then querying the style.background property value for the number of // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! set_css( background + ':url(//:),url(//:),red url(//:)' ); // If the UA supports multiple backgrounds, there should be three occurrences // of the string "url(" in the return value for
  • 53. elem_style.background return new RegExp("(urls*(.*?){3}").test(m_style[background]); }; // In testing support for a given CSS property, it's legit to test: // elem.style[styleName] !== undefined // If the property is supported it will return an empty string, // if unsupported it will return undefined. // We'll take advantage of this quick test and skip setting a style
  • 54. // on our modernizr element, but instead just testing undefined vs // empty string. // The legacy set_css_all calls will remain in the source // (however, commented) in for clarity, yet functionally they are // no longer needed. tests[backgroundsize] = function() { return test_props_all( background + 'Size' ); }; tests[borderimage] = function() {
  • 55. // set_css_all( 'border-image:url(m.png) 1 1 stretch' ); return test_props_all( 'borderImage' ); }; // super comprehensive table about all the unique implementations of // border-radius: http://muddledramblings.com/table-of-css3- border-radius-compliance tests[borderradius] = function() { // set_css_all( 'border-radius:10px' ); return test_props_all( 'borderRadius', '', function( prop ) {
  • 56. return contains( prop, 'orderRadius' ); }); }; tests[boxshadow] = function() { // set_css_all( 'box-shadow:#000 1px 1px 3px' ); return test_props_all( 'boxShadow' ); }; tests[opacity] = function() { // Browsers that actually have CSS Opacity implemented
  • 57. have done so // according to spec, which means their return values are within the // range of [0.0,1.0] - including the leading zero. set_css_all( 'opacity:.5' ); return contains( m_style[opacity], '0.5' ); }; tests[cssanimations] = function() { // set_css_all( 'animation:"animate" 2s ease 2', 'position:relative' );
  • 58. return test_props_all( 'animationName' ); }; tests[csscolumns] = function() { // set_css_all( 'column-count:3' ); return test_props_all( 'columnCount' ); }; tests[cssgradients] = function() { /**
  • 59. * For CSS Gradients syntax, please see: * http://webkit.org/blog/175/introducing-css-gradients/ * https://developer.mozilla.org/en/CSS/-moz-linear- gradient * https://developer.mozilla.org/en/CSS/-moz-radial- gradient * http://dev.w3.org/csswg/css3-images/#gradients- */ var str1 = background + '-image:', str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', str3 = 'linear-gradient(left top,#9f9, white);';
  • 60. set_css( (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0,-str1.length) ); return contains( m_style.backgroundImage, 'gradient' ); }; tests[cssreflections] = function() { // set_css_all( 'box-reflect:right 1px' ); return test_props_all( 'boxReflect' ); };
  • 61. tests[csstransforms] = function() { // set_css_all( 'transform:rotate(3deg)' ); return !!test_props([ 'transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]); }; tests[csstransforms3d] = function() { // set_css_all( 'perspective:500' ); var ret = !!test_props([ 'perspectiveProperty',
  • 62. 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ]); // webkit has 3d transforms disabled for chrome, though // it works fine in safari on leopard and snow leopard // as a result, it 'recognizes' the syntax and throws a false positive // thus we must do a more thorough check: if (ret){ var st = document.createElement('style'), div = doc.createElement('div'); // webkit allows this media query to succeed only if the feature is enabled.
  • 63. // "@media (transform-3d),(-o-transform-3d),(-moz- transform-3d),(-ms-transform-3d),(-webkit-transform- 3d),(modernizr){#modernizr{height:3px}}" st.textContent = '@media ('+prefixes.join('transform- 3d),(')+'modernizr){#modernizr{height:3px}}'; doc.getElementsByTagName('head')[0].appendChild(st); div.id = 'modernizr'; docElement.appendChild(div); ret = div.offsetHeight === 3; st.parentNode.removeChild(st); div.parentNode.removeChild(div); }
  • 64. return ret; }; tests[csstransitions] = function() { // set_css_all( 'transition:all .5s linear' ); return test_props_all( 'transitionProperty' ); }; // @font-face detection routine created by Paul Irish - paulirish.com // Merged into Modernizr with approval. Read more about Paul's work here:
  • 65. // http://paulirish.com/2009/font-face-feature-detection/ tests[fontface] = function(){ var fontret; if (/*@[email protected](@_jscript_version>=5)[email protected] @*/0) fontret = true; else { // Create variables for dedicated @font-face test var st = doc.createElement('style'), spn = doc.createElement('span'),
  • 66. size, isFakeBody = false, body = doc.body, callback, isCallbackCalled; // The following is a font-face + glyph definition for the . character: st.textContent = "@font-face{font- family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAA AwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJA AAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAA AACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQA AAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAA AABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANg AAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACH gAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesA MwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAA AAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAA AAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAA AK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZX AwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAA AAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA
  • 67. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB AAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDA AAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoA AwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC8 8sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCq v1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0 BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaA ZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAA AAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8Q DxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAA ADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAA AAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAA AAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKg AqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQ AAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAA AQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAA AAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKAR sAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBA kAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr 0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAk ABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb 3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJl bGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBG b250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZ WFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJ
  • 68. hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYW VjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3Jn ZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJ hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0Vm Vyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQg b2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9P RkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5A CAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAH MAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHU AbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbw BmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAA gAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAE wAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGU AbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQ AgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiA GEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyAC AALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHI AYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGI AZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGU AdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAM gAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAA gADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBj ADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAg AHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgA EwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGI
  • 69. AYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAI AAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBh AEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByA GkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEw AAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAA AAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ== ')}"; doc.getElementsByTagName('head')[0].appendChild(st); // we don't use `serif` and we don't use `monospace` // http://github.com/Modernizr/Modernizr/issues/closed#issue/39 // http://neugierig.org/software/chromium/notes/2009/09/monospa ce-fonts-workaround.html spn.setAttribute('style','font:99px _,arial,helvetica;position:absolute;visibility:hidden');
  • 70. if (!body){ body = docElement.appendChild(doc.createElement(fontface)); isFakeBody = true; } // the data-uri'd font only has the . glyph; which is 3 pixels wide. spn.innerHTML = '........'; spn.id = 'fonttest'; body.appendChild(spn); size = spn.offsetWidth*spn.offsetHeight;
  • 71. spn.style.font = '99px testfont,_,arial,helvetica'; // needed for the CSSFontFaceRule false positives (ff3, chrome, op9) fontret = size !== spn.offsetWidth*spn.offsetHeight; function delayedCheck(){ if (!body.parentNode) return; fontret = ret[fontface] = size !== spn.offsetWidth*spn.offsetHeight; docElement.className = docElement.className.replace(/(no-)?fontfaceb/,'') + (fontret ? ' ' : ' no-') + fontface; }
  • 72. setTimeout(delayedCheck,fontfaceCheckDelay); setTimeout(delayedCheck,fontfaceCheckDelay*2); addEventListener('load',function(){ delayedCheck(); (isCallbackCalled = true) && callback && callback(fontret); setTimeout(function(){ if (!isFakeBody) body = spn; body.parentNode.removeChild(body); st.parentNode.removeChild(st); }, 50); },false); }
  • 73. // allow for a callback ret._fontfaceready = function(fn){ (isCallbackCalled || fontret) ? fn(fontret) : (callback = fn); } return fontret || size !== spn.offsetWidth; }; // These tests evaluate support of the video/audio elements,
  • 74. as well as // testing what types of content they support. // // we're using the Boolean constructor here, so that we can extend the value // e.g. Modernizr.video // true // Modernizr.video.ogg // 'probably' // // codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.ht ml#L845 // thx to NielsLeenheer and zcorpan tests[video] = function() {
  • 75. var elem = doc.createElement(video), bool = !!elem[canPlayType]; if (bool){ bool = new Boolean(bool); bool.ogg = elem[canPlayType]('video/ogg; codecs="theora"'); bool.h264 = elem[canPlayType]('video/mp4; codecs="avc1.42E01E"'); bool.webm = elem[canPlayType]('video/webm; codecs="vp8, vorbis"'); } return bool; };
  • 76. tests[audio] = function() { var elem = doc.createElement(audio), bool = !!elem[canPlayType]; if (bool){ bool = new Boolean(bool); bool.ogg = elem[canPlayType]('audio/ogg; codecs="vorbis"'); bool.mp3 = elem[canPlayType]('audio/mpeg;'); // mimetypes accepted: // https://developer.mozilla.org/En/Media_formats_supported_by_
  • 77. the_audio_and_video_elements // http://bit.ly/iphoneoscodecs bool.wav = elem[canPlayType]('audio/wav; codecs="1"'); bool.m4a = elem[canPlayType]('audio/x-m4a;') || elem[canPlayType]('audio/aac;'); } return bool; }; // both localStorage and sessionStorage are // tested in this method because otherwise Firefox will // throw an error:
  • 78. https://bugzilla.mozilla.org/show_bug.cgi?id=365772 // if cookies are disabled // FWIW miller device resolves to [object Storage] in all supporting browsers // except for IE who does [object Object] // IE8 Compat mode supports these features completely: // http://www.quirksmode.org/dom/html5.html tests[localstorage] = function() { return ('localStorage' in window) && window[localstorage] !== null; };
  • 79. tests[sessionstorage] = function() { // try/catch required for pissy FF behavior try { return ('sessionStorage' in window) && window[sessionstorage] !== null; } catch(e){ return false; } }; tests[webWorkers] = function () {
  • 80. return !!window.Worker; }; tests[applicationcache] = function() { var cache = window[applicationcache]; return !!(cache && (typeof cache.status != 'undefined') && (typeof cache.update == 'function') && (typeof cache.swapCache == 'function')); }; // thanks to Erik Dahlstrom
  • 81. tests[svg] = function(){ return !!doc.createElementNS && !!doc.createElementNS( "http://www.w3.org/2000/svg", "svg").createSVGRect; }; // thanks to F1lt3r and lucideer // http://github.com/Modernizr/Modernizr/issues#issue/35 tests[smil] = function(){ return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or g/2000/svg','animate'))); }; tests[svgclippaths] = function(){
  • 82. // returns a false positive in saf 3.2? return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or g/2000/svg','clipPath'))); }; // input features and input types go directly onto the ret object, bypassing the tests loop. // hold this guy to execute in a moment. function webforms(){ // Run through HTML5's new input attributes to see if the UA understands any. // We're using f which is the <input> element created early
  • 83. on // Mike Taylr has created a comprehensive resource for testing these attributes // when applied to all input types: // http://miketaylr.com/code/input-type-attr.html // spec: http://www.whatwg.org/specs/web-apps/current- work/multipage/the-input-element.html#input-type-attr- summary ret[input] = (function(props) { for (var i = 0,len=props.length;i<len;i++) { attrs[ props[i] ] = !!(props[i] in f); } return attrs; })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
  • 84. // Run through HTML5's new input types to see if the UA understands any. // This is put behind the tests runloop because it doesn't return a // true/false like all the other tests; instead, it returns an object // containing each input type with its corresponding true/false value // Big thx to @miketaylr for the html5 forms expertise. http://miketaylr.com/ ret[inputtypes] = (function(props) { for (var i = 0,bool,len=props.length;i<len;i++) { f.setAttribute('type', props[i]);
  • 85. bool = f.type !== 'text'; // chrome likes to falsely purport support, so we feed it a textual value // if that doesnt succeed then we know there's a custom UI if (bool){ f.value = smile; /* Safari 4 is allowing the smiley as a value, and incorrecty failing.. the test fixes for webkit only, but breaks Opera.. if (/range/.test(f.type)){
  • 86. bool = test_props_all('appearance',function(prop,m){ return m_style[prop] !== 'textfield' }) } */ if (/tel|search/.test(f.type)){ // spec doesnt define any special parsing or detectable UI // behaviors so we pass these through as true } else if (/url|email/.test(f.type)) { // real url and email support comes with prebaked validation.
  • 87. bool = f.checkValidity && f.checkValidity() === false; } else { bool = f.value != smile; } } inputs[ props[i] ] = !!bool; } return inputs; })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
  • 88. } // end of test definitions // Run through all tests and detect their support in the current UA. // todo: hypothetically we could be doing an array of tests and use a basic loop here. for ( var feature in tests ) { if ( hasOwnProperty( tests, feature ) ) {
  • 89. // run the test, throw the return value into the Modernizr, // then based on that boolean, define an appropriate className // and push it into an array of classes we'll join later. classes.push( ( ( ret[ feature.toLowerCase() ] = tests[ feature ]() ) ? '' : 'no-' ) + feature.toLowerCase() ); } } // input tests need to run. if (!ret[input]) webforms();
  • 90. /** * Addtest allows the user to define their own feature tests * the result will be added onto the Modernizr object, * as well as an appropriate className set on the html element * * @param feature - String naming the feature * @param test - Function returning true if feature is supported, false if not */
  • 91. ret.addTest = function (feature, test) { feature = feature.toLowerCase(); if (ret[ feature ]) { return; // quit if you're trying to overwrite an existing test } test = !!(test()); docElement.className += ' ' + (test ? '' : 'no-') + feature; ret[ feature ] = test; return ret; // allow chaining. };
  • 92. /** * Reset m.style.cssText to nothing to reduce memory footprint. */ set_css( '' ); m = f = null; // Enable HTML 5 elements for styling in IE. // fyi: jscript version does not reflect trident version // therefore ie9 in ie7 mode will still have a jScript v.9 if ( enableHTML5 && (function(){ var elem = doc.createElement("div"); elem.innerHTML = "<elem></elem>"; return elem.childNodes.length !== 1;
  • 93. })()) { // iepp v1.5.1 MIT @jon_neal http://code.google.com/p/ie-print-protector/ (function(p,e){function q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q( a,b)}}function s(a,b){for(var c=new RegExp("b("+m+")b(?!.*[;}])","gi"),d=function(k){return".ie pp_"+k},h=- 1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].css Text.replace(c,d))}}function t(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=- 1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=ne w RegExp("^s*<"+d+"(.*)/"+d+">s*$","i");i.innerHTML=a.o uterHTML.replace(/r|n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<s pan$1/span>");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[ 0])}s(e.styleSheets,"all")}function u(){for(var a=- 1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1 ]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var
  • 95. jsb/,'') + ' js'; // Add the new classes to the <html> element. docElement.className += ' ' + classes.join( ' ' ); return ret; })(this,this.document); case4/title.jpg case4/words.js /* New Perspectives on HTML5, CSS, and JavaScript
  • 96. Tutorial 13 Case Problem 4 Variables ========= puzzleTitle Name of the word search puzzle wordList Array of hidden puzzle words letterGrid
  • 97. Multi-dimensional array of letters in the hidden puzzle wordGrid Multi-dimensional array specifying the location of hidden words in the puzzle where the # symbol marks the location of each letter */ var puzzleTitle = "Astronomy"; var wordList = ["CALLISTO", "CERES", "CHARON", "EARTH", "EUROPA",
  • 98. "DEMOS", "GANYMEDE", "IO", "JUPITER", "MARS", "MERCURY", "MOON", "NEPTUNE", "PHOBOS", "PLUTO", "SATURN", "SOL", "TITAN", "URANUS", "VENUS"]; var letterGrid = [ ["R","K","M","F","T","S","N","Y","L","R","J","S","O","B","O" ,"H","P","Y","X","D","N","A","G","Z","N"], ["T","E","A","A","E","E","U","E","F","N","K","M","T","H","E ","B","V","K","W","U","S","K","N","D","I"], ["S","L","A","R","L","K","P","L","P","O","L","C","A","J","J"," A","Q","D","X","A","S","R","A","M","P"],
  • 99. ["Z","J","E","R","E","Y","R","I","P","N","N","A","B","H","I"," Z","X","O","N","M","M","R","A","T","P"], ["P","C","S","G","T","I","C","L","Y","M","S","L","U","Q","D", "M","H","N","D","G","K","K","W","W","C"], ["O","A","W","M","W","H","N","V","A","M","T","L","E","R"," Y","R","D","Z","T","L","Z","C","C","C","Q"], ["D","K","N","B","G","H","R","X","S","V","N","I","U","D","A ","F","B","V","O","P","U","J","Z","H","M"], ["G","W","V","Y","S","B","D","A","Q","B","D","S","D","B"," A","N","P","S","X","D","S","Q","W","T","N"], ["P","D","D","T","V","Y","W","C","E","H","Z","T","C","Z","C ","N","U","F","T","B","F","X","H","M","S"], ["D","U","N","P","A","I","E","D","P","A","R","O","U","Q","Q" ,"E","H","S","Q","H","X","T","D","V","M"], ["X","R","H","O","W","D","E","F","W","E","U","P","K","W"," R","P","W","O","V","U","Y","F","B","B","D"], ["V","H","D","J","V","M","U","K","T","X","E","R","V","U","V
  • 100. ","P","R","T","W","B","M","I","A","E","M"], ["U","C","T","K","Y","Q","C","I","X","J","R","E","B","D","R", "P","Z","K","P","W","I","G","P","M","G"], ["S","Z","K","N","W","A","P","I","L","V","W","S","V","E","N ","U","S","F","N","F","L","J","O","C","M"], ["E","O","A","G","K","U","T","I","Y","T","M","V","Z","U","W ","W","S","A","T","U","R","N","R","E","D"], ["Z","G","J","N","J","Z","W","Y","G","S","O","V","G","M","Z ","R","T","I","T","A","N","S","U","Y","U"], ["C","E","Z","R","D","U","Q","P","U","R","O","R","Z","T","I", "I","D","B","Z","S","V","F","E","R","V"], ["N","N","L","W","E","P","F","W","A","R","N","U","F","D","B ","V","K","F","X","D","I","V","R","U","T"], ["D","U","B","N","T","N","A","F","W","J","R","J","D","W","G ","A","W","R","C","L","Y","K","I","C","N"], ["S","T","U","J","O","K","Q","D","Y","D","M","R","S","C","X ","S","F","W","I","G","Q","D","B","R","Z"],
  • 102. "," "," "," "," "," "," "," "], [" ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "], [" "," ","#","#"," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," ","#","#","#","#"," "], [" "," ","#","#"," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "], [" ","#"," "," ","#"," "," "," "," "," "," ","#","#"," "," "," "," "," "," "," "," "," "," "," "," "], [" "," "," "," "," ","#"," "," "," "," "," ","#"," ","#"," "," "," "," "," ","#"," "," "," "," "," "], [" "," "," "," "," "," "," "," "," "," "," ","#"," "," ","#"," "," "," ","#"," "," "," "," "," "," "], [" "," "," "," "," "," "," "," "," "," "," ","#"," "," "," ","#"," ","#"," "," "," "," "," "," "," "], [" "," "," "," "," "," "," "," ","#"," "," ","#"," "," "," "," ","#"," "," "," "," "," "," "," "," "],
  • 103. [" "," "," "," "," "," "," ","#"," "," ","#","#"," "," "," "," "," ","#"," "," "," "," "," "," "," "], [" "," "," "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "], [" "," "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," ","#"," "," "], [" "," "," "," ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," ","#"," "," "], [" "," "," ","#"," "," ","#"," "," "," "," "," ","#","#","#","#","#"," "," "," "," "," ","#"," "," "], [" "," ","#"," "," ","#"," "," "," "," ","#"," "," "," "," "," ","#","#","#","#","#","#","#"," "," "], [" ","#"," "," ","#"," "," "," "," "," ","#"," "," "," "," "," ","#","#","#","#","#"," ","#","#"," "], [" ","#"," "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," "," ","#","#"," "],
  • 104. [" ","#"," "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," ","#"," "], [" ","#"," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","#"," "], [" ","#"," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","#"," "], [" ","#"," "," "," ","#","#","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","#"," "], [" ","#"," "," "," "," ","#"," "," "," "," ","#","#","#","#","#"," "," "," "," "," "," "," ","#"," "], [" ","#"," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "], [" "," "," "," "," "," "," "," ","#"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "], [" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","#","#","#","#","#"," "] ]
  • 105. case4/wordsearch.css /* New Perspectives on HTML5, CSS and JavaScript Tutorial 13 Case Problem 4 The Word Search Table Style Sheet Filename: wordsearch.css Supporting Files: */
  • 106. /* Default styles for the Word Search Table */ table#wordsearchtable { border: 1px solid black; border-collapse; width: 600px; } /* Styles for cells within the Word Search Table */ table#wordsearchtable td {
  • 107. width: 20px; height: 20px; line-height: 20px; border: 1px solid transparent; text-align: center; vertical-align: middle; font-size: 12px; cursor: pointer; }
  • 108. /* Styles for unordered list of hidden words */ ul#wordsearchlist { margin-left: 20px; padding-left: 0px; list-style-type: none; } ul#wordsearchlist li { font-size: 12px; line-height: 1.8em; cursor: pointer;
  • 109. } case4/wordsearch.htmAstronomy Click the letters in the grid that match the words listed below. When you find a word, strike it out from the list by clicking the entry. case4/wordsearch.js /* New Perspectives on HTML5, CSS, and JavaScript Tutorial 13 Case Problem 4 Author: Date:
  • 110. Function List ============= drawWordSearch(letters, words) Function to create a Web table containing hidden words where letters is a multi-dimensional array containing the grid of letters and words is a multi-dimensional array specifying the location of the hidden words in the puzzle */
  • 111. function drawWordSearch(letters, words) { var rowSize = letters.length; var colSize = letters[0].length; var htmlCode = "<table id='wordsearchtable'>"; for (var i = 0; i < rowSize; i++) { htmlCode += "<tr>"; for (var j = 0; j < colSize; j++) {
  • 112. if (words[i][j] == " ") { htmlCode += "<td>"; } else { htmlCode += "<td class='wordCell'>"; } htmlCode += letters[i][j]; htmlCode += "</td>"; } htmlCode += "</tr>"; } htmlCode += "</table>";