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 .
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;
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 */
14. /* div element containing the Show
Solution
button */
article div {
clear: left;
float: left;
width: 600px;
margin-top: 10px;
text-align: center;
}
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',
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;
}
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
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;
}
}
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
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 ) {
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' );
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.
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() {
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;
};
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;
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",
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 {
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++) {