Saturday, July 3, 2021

All about CSS

From book HTML & CSS - Design and Build Websites - Jon Duckett

CSS works by associating rules with HTML elements. These rules govern how the content of specified elements should be displayed. A CSS rule contains two parts: a selector and a declaration.








This rule indicates that all <p> elements should be shown in the Arial typeface.

Selectors indicate which element the rule applies to. The same rule can apply to more than one element if you separate the element names with commas.

Declarations indicate how the elements referred to in the selector should be styled. Declarations are split into two parts (a property and a value), and are separated by a colon.

CSS declarations sit inside curly brackets and each is made up of two parts: a property and a value, separated by a colon. You can specify several properties in one declaration, each separated by a semi-colon.









Selectors































































How CSS rules cascade?

* {
font-family: Arial, Verdana, sans-serif;}
h1 {
font-family: "Courier New", monospace;}
i {
color: green;}
i {
color: red;}
b {
color: pink;}
p b {
color: blue !important;}
p b {
color: violet;}
p#intro {
font-size: 100%;}
p {
font-size: 75%;}

If there are two or more rules that apply to the same element, it is important to understand which will take precedence.

LAST RU LE
If the two selectors are identical, the latter of the two will take precedence. Here you can see the second i selector takes precedence over the first.

SPEC IFICITY
If one selector is more specific than the others, the more specific rule will take precedence over more general ones. In this example 
h1 is more specific than *
p b is more specific than p
p#intro is more specific than p

IMPORTANT
You can add !important after any property value to indicate that it should be considered more important than other rules that apply to the same element.

Inherit

body {
font-family: Arial, Verdana, sans-serif;
color: #665544;
padding: 10px;}
.page {
border: 1px solid #665544;
background-color: #efefef;
padding: inherit;}

If you specify the font-family or color properties on the <body> element, they will apply to most child elements. This is because the value of the font-family property is inherited by child elements. It saves you from having to apply these properties to as many elements (and results in simpler style sheets).

You can compare this with the background-color or border properties; they are not inherited by child elements. If these were inherited by all child elements then the page could look quite messy.

You can force a lot of properties to inherit values from their parent elements by using inherit for the value of the properties. In this example, the <div> element with a class called page inherits the padding
size from the CSS rule that applies to the <body> element

Colors
/* color name */
h1 {
color: DarkCyan;}
/* hex code */
h2 {
color: #ee3e80;}
/* rgb value */
p {
color: rgb(100,100,90);}

BackGround Color
body {
background-color: rgb(200,200,200);}
h1 {
background-color: DarkCyan;}
h2 {
background-color: #ee3e80;}
p {
background-color: white;}

Opacity
p.one {
background-color: rgb(0,0,0);
opacity: 0.5;}
p.two {
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.5);}

HSL & HSLA
body {
background-color: #C8C8C8;
background-color: hsl(0,0%,78%);}
p {
background-color: #ffffff;
background-color: hsla(0,100%,100%,0.5);}


TEXT





















































@font-face allows you to use a font, even if it is not installed on the computer of the person browsing, by allowing you to specify a path to a copy of the font, which will be downloaded if it is not on the user's machine.

@font-face {
font-family: 'ChunkFiveRegular';
src: url('fonts/chunkfive.eot');}
h1, h2 {
font-family: ChunkFiveRegular, Georgia, serif;}

font size
body {
font-family: Arial, Verdana, sans-serif;
font-size: 12px;}
h1 {
font-size: 200%;}
h2 {
font-size: 1.3em;}

Font-Weight
.credits {
font-weight: bold;}

Font-Style
.credits {
font-style: italic;}

Case
h1 {
text-transform: uppercase;}
h2 {
text-transform: lowercase;}
.credits {
text-transform: capitalize;}

UnderLines & Strike
.credits {
text-decoration: underline;}
a {
text-decoration: none;}

Leading
p {
line-height: 1.4em;}

Leading (pronounced ledding) is a term typographers use for the vertical space between lines of text. In a typeface, the part of a letter that drops beneath the baseline is called a descender, while the highest point of a letter is called the ascender. Leading is measured from the bottom of the descender on one line to the top of the ascender on the next.

In CSS, the line-height property sets the height of an entire line of text, so the difference between the fontsize and the line-height is equivalent to the leading (as shown in the diagram above).

Increasing the line-height makes the vertical gap between lines of text larger.

Letter & Word Spacing
h1, h2 {
text-transform: uppercase;
letter-spacing: 0.2em;}
.credits {
font-weight: bold;
word-spacing: 1em;}

Alignment
h1 {
text-align: left;}
p {
text-align: justify;}
.credits {
text-align: right;}

Vertical Alignment
#six-months {
vertical-align: text-top;}
#one-year {
vertical-align: baseline;}
#two-years {
vertical-align: text-bottom;}

Indent
h1 {
background-image: url("images/logo.gif");
background-repeat: no-repeat;
text-indent: -9999px;}
.credits {
text-indent: 20px;}

Drop Shadow
p.one {
background-color: #eeeeee;
color: #666666;
text-shadow: 1px 1px 0px #000000;}
p.two {
background-color: #dddddd;
color: #666666;
text-shadow: 1px 1px 3px #666666;}
p.three {
background-color: #cccccc;
color: #ffffff;
text-shadow: 2px 2px 7px #111111;}
p.four {
background-color: #bbbbbb;
color: #cccccc;
text-shadow: -1px -2px #666666;}
p.five {
background-color: #aaaaaa;
color: #ffffff;
text-shadow: -1px -1px #666666;}

First Letter Or Line
p.intro:first-letter {
font-size: 200%;}
p.intro:first-line {
font-weight: bold;}


Styling Links
a:link {
color: deeppink;
text-decoration: none;}
a:visited {
color: black;}
a:hover {
color: deeppink;
text-decoration: underline;}
a:active {
color: darkcyan;}

Responding To Users
input {
padding: 6px 12px 6px 12px;
border: 1px solid #665544;
color: #ffffff;}
input.submit:hover {
background-color: #665544;}
input.submit:active {
background-color: chocolate;}
input.text {
color: #cccccc;}
input.text:focus {
color: #665544;}

Attribute Selectors












































Box Dimention
div.box {
height: 300px;
width: 300px;
background-color: #bbbbaa;}
p {
height: 75%;
width: 75%;
background-color: #0088dd;}

Limiting Width
td.description {
min-width: 450px;
max-width: 650px;
text-align: left;
padding: 5px;
margin: 0px;}

Limiting Height
h2, p {
width: 400px;
font-size: 90%;
line-height: 1.2em;}
h2 {
color: #0088dd;
border-bottom: 1px solid #0088dd;}
p {
min-height: 10px;
max-height: 30px;}

Overflowing Content
p.one {
overflow: hidden;}
p.two {
overflow: scroll;}


The overflow property tells the browser what to do if the content contained within a box is larger than the box itself. It can have one of two values:
hidden
This property simply hides any extra content that does not fit in the box.
scroll
This property adds a scrollbar to the box so that users can scroll to see the missing content.

Border Margin & Padding
The border-width property is used to control the width of a border. The value of this property can either be given in pixels or using one of the following values:
thin
medium
thick


(You cannot use percentages with this property.)
You can control the individual size of borders using four separate properties:
border-top-width
border-right-width
border-bottom-width
border-left-width

You can also specify different widths for the four border values in one property, like so:
border-width: 2px 1px 1px 2px;
The values here appear in
clockwise order: top, right, bottom, left.

p.one {
border-width: 2px;}
p.two {
border-width: thick;}
p.three {
border-width: 1px 4px 12px 4px;}

Border Style
p.one {border-style: solid;}
p.two {border-style: dotted;}
p.three {border-style: dashed;}
p.four {border-style: double;}
p.five {border-style: groove;}
p.six {border-style: ridge;}
p.seven {border-style: inset;}
p.eight {border-style: outset;}

You can individually change the styles of different borders using:
border-top-style
border-left-style
border-right-style
border-bottom-style

Border Color
p.one {
border-color: #0088dd;}
p.two {
border-color: #bbbbaa #111111 #ee3e80 #0088dd;}

ShortHand
p {
width: 250px;
border: 3px dotted #0088dd;}

Padding
p {
width: 275px;
border: 2px solid #0088dd;}
p.example {
padding: 10px;}

Margin
p {
width: 200px;
border: 2px solid #0088dd;
padding: 10px;}
p.example {
margin: 20px;}

Please note: If the width of a box is specified then the margin is added to the width of the box.
You can specify values for each side of a box using:
margin-top
margin-right
margin-bottom
margin-left

You can also use the shorthand
(where the values are in clockwise order: top, right, bottom, left):
margin: 1px 2px 3px 4px;
Sometimes you might see the following, which means that the left and right margins should be 10 pixels and the top and bottom margins should be 20 pixels:
margin: 10px 20px;
(This same shorthand shown above can also be applied to padding.)


Centering Content
body {
text-align: center;}
p {
width: 300px;
padding: 50px;
border: 20px solid #0088dd;}
p.example {
margin: 10px auto 10px auto;
text-align: left;}

If you want to center a box onvthe page (or center it inside the element that it sits in), you can set the left-margin and right-margin to auto.
In order to center a box on the page, you need to set a width for the box (otherwise it will take up the full width of the page).
Once you have specified the width of the box, setting the left and right margins to auto will make the browser put an equal gap on each side of the box. This centers the box on the page (or within the element that the box sits inside).
In order for this to work in older browsers (particularly IE6), the element that the box sits inside should have a text-align property with its value set to center.
The text-align property is inherited by child elements. You therefore also need to specify the text-align property on the centered box if you do not want the text inside it to be centered.

Change INLINE / BLOCK
The display property allows you to turn an inline element into a block-level element or vice versa, and can also be used to hide an element from the page.
The values this property can take are:
inline
This causes a block-level element to act like an inline element.
block
This causes an inline element to act like a block-level element.
inline-block
This causes a block-level element to flow like an inline element, while retaining other features of a block-level element.
none
This hides an element from the page. 
In this case, the element acts as though it is not on the page at all (although a user could still see the content of the box if they used the view source option in their browser).

If you use this property, it is important to note that inline boxes are not supposed to create block-level elements

In this example you can see a list. Each item in the list is usually treated as a block-level element, but the rule for the <li> elements indicates that they should be treated as inline elements, which means they will sit alongside each other rather than appearing on new lines.

This technique is often used to create navigation for a site, and in this example a margin has been added to the right of each of the items to separate them out. The rule that applies to the <li> element whose class is coming-soon has been hidden as if it were not in the page at all.

Hiding Boxes
The visibility property allows you to hide boxes from users but It leaves a space where the element would have been.
This property can take two
values:
hidden
This hides the element.
visible
This shows the element.

If the visibility of an element is set to hidden, a blank space will appear in its place. If you do not want a blank space to appear, then you should use the display property with a value of none instead (as covered on the previous page).

li {
display: inline;
margin-right: 10px;}
li.coming-soon {
visibility: hidden;}

Border Images






























































































Head First HTML5 Programming - Day 1 - 07/03/2021

How to convert old HTML to HTML5?

1. Following is HTML4.0 DocType

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Head First Lounge</title>
<link type="text/css" rel="stylesheet" href="lounge.css">
<script type="text/javascript" src="lounge.js"></script>
</head>
<body>
<h1>Welcome to Head First Lounge</h1>
<p>
<img src="drinks.gif" alt="Drinks">
</p>
<p>
Join us any evening for refreshing <a href="elixirs.html">elixirs</a>,
conversation and maybe a game or two of Tap Tap Revolution.
Wireless access is always provided; BYOWS (Bring Your Own Web Server).
</p>
</body>
</html>

If you look at the markup highlighted in orange - it belongs to HTML 4.0. This doctype tell the browser the type of document it is.

And HTML5 doc type is as below
<!doctype html>

It's not only for HTML5 - but for all future versions of it.

2. Following is an example of Meta Tag of HTML4 vs HTML5

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta charset="utf-8">

3. Link attribute. - HTML4 vs HTML5

<link type="text/css" rel="stylesheet" href="lounge.css">

To upgrade this for HTML5, we just need to remove the type attribute. Why?
Because CSS has been declared the standard, and default, style for HTML5. So,
after we remove the type attribute, the new link looks like this:

<link rel="stylesheet" href="lounge.css">

4. Script Tag

With HTML5, JavaScript is now the standard and default scripting language, so you can
remove the type attribute from your script tags too. Here’s what the new
script tag looks like without the type attribute:
<script src="lounge.js"></script>
Or if you have some inline code, you can just write your script like this:
<script>
var youRock = true;
</script>
 

Exercise 1 - JS

var drink = "Energy Drink";
var lyrics = "";
var cans = 99;
while (cans > 0) {
lyrics = lyrics + cans + " cans of "
+ drink + " on the wall <br>";
lyrics = lyrics + cans + " cans of "
+ drink + "<br>";
lyrics = lyrics + "Take one down, pass it around,<br>";
if (cans > 1) {
lyrics = lyrics + (cans-1) + " cans of "
+ drink + " on the wall <br>";
}
else {
lyrics = lyrics + "No more cans of "
+ drink + " on the wall <br>";
}
cans = cans - 1;
}
document.write(lyrics);

Here, document.write will write actually into HTML page.

I get that we built up the entire lyrics to the
song, but what exactly did the document.write do
and how did the text get in the document?
A: Well, document.write takes a string of text and
inserts it into the document; in fact, it outputs the string
precisely where the script tag is located. So, in this
case document.write outputs the string right into the
body of the page.
You’re soon going to see more sophisticated ways to
alter the text of a live document with JavaScript, but
this example should give you a flavor of how code can
dynamically change a page.


Instead if I use console.log(lyrics) - it will write everything into console instead of html page.

JavaScript

alert("Mandar") -- this will open a alert message in browser.

You can add JavaScript in 3 ways into your html page
Place your script inline, in the <head> element.
The most common way to add code to your pages is to put a <script> element in the head of your page. When you add JavaScript in the <head> element, it is executed as soon as the browser parses the head (which it does first!), before it has parsed the rest of the page.

Add your script by referencing a separate JavaScript file.
You can also link to a separate file containing JavaScript code. Put the URL of the file in the src attribute of the opening <script> tag and make sure you close the script element with </script>. If you’re linking to a file in the same directory, you can just use the name of the file.


<head>
    <script>
        statement
    </script>
    <script src=”mycode.js”>
    </script>
</head>

<body>
    <script>
        statement
        statement
    </script>
</body>


Add your code in the body of the document, either inline or as a link to a separate file

Or, you can put your code right in the body of your HTML. Again, enclose your JavaScript code in the <script> element (or reference a separate file in the src attribute). JavaScript in the body of your
page is executed when the browser parses the body (which it does, typically, top down).

To interact with HTML DOM elements, you can use javascript's method getElementById("")
var planet = document.getElementById("greenplanet");

Here, document represent entire page of a browser and contains complete DOM, so we can ask to do things like find an element with specific id

planet.innerHTML = "Red Alert: hit by phaser fire!";

We can use innerHTML property of element to change the content of the element. 

Most of the time it makes sense to start executing your JavaScript code after the page is fully loaded. The reason? Well, if you don’t wait until the page has loaded, then the DOM won’t be fully created when your code executes. In our case, the JavaScript is executing when the browser first loads the head of the page, and before the rest of the page has loaded, and so the DOM hasn’t been fully created yet. And, if the DOM isn’t created, then the <p id="greenplanet"> element doesn’t exist yet!

So what happens? The call to get the element with an id of greenplanet isn’t going to return anything because there is no matching element, and so the browser just keeps moving on and renders the page anyway after your code has run. So you’ll see the page rendered, but the text in the green planet won’t be altered by the code.

What we need is a way to tell the browser “run my code after you’ve fully loaded in the page and created the DOM.”

To tell the browser to wait before executing code we are going to use following code

<script>
function init() {
var planet = document.getElementById("greenplanet");
planet.innerHTML = "Red Alert: hit by phaser fire!";
}
window.onload = init;
</script>

Get Elements from DOM
Of course you already know this because we’ve been using document.getElementById, but there are other ways to get elements as well; in fact, you can use tag names, class names and attributes to retrieve not just one element, but a whole set of elements (say all elements in the class “on_sale”). And you can get form values the user has typed in, like the text of an input element.

Create or add elements to the DOM.
You can create new elements and you can also add those elements to the DOM. Of course, any changes you make to the DOM will show up immediately as the DOM is rendered by the browser (which is a good thing!).

Remove elements from the DOM.
You can also remove elements from the DOM by taking a parent element and removing any of its children. Again, you’ll see the element removed in your browser window as soon as it is deleted from the DOM.


Get and set the attributes of elements
So far you’ve accessed only the text content of an element, but you can access attributes as well. For instance, you might want to know what an element’s class is, and then change the class it belongs to on the fly.

Property Vs Attribute
Attribute is something which you can initialize and change; however property you can not initialize or change.

Create a new HTML element
var li = document.createElement("li");

Add an attribute value to new element
li.innerHTML = songName;

To locally store elements in browser 

Keep following code in separate JS file e.g.store.js

function save(item) {
    var playlistArray = getStoreArray("playlist");
    playlistArray.push(item);
    localStorage.setItem("playlist", JSON.stringify(playlistArray));
}

function loadPlaylist() {
    var playlistArray = getSavedSongs();
    var ul = document.getElementById("playlist");
    if (playlistArray != null) {
        for (var i = 0; i < playlistArray.length; i++) {
            var li = document.createElement("li");
            li.innerHTML = playlistArray[i];
            ul.appendChild(li);
        }
    }
}

function getSavedSongs() {
    return getStoreArray("playlist");
}

function getStoreArray(key) {
    var playlistArray = localStorage.getItem(key);
    if (playlistArray == null || playlistArray == "”) {
        playlistArray = new Array();
    }
    else {
        playlistArray = JSON.parse(playlistArray);
    }
    return playlistArray;
}


add this store.js file in your main html file
<script src="store.js"></script>

Call function inside store.js as below

function init() {
    var button = document.getElementById("addButton");
    button.onclick = handleButtonClick;
    loadPlaylist();
}


function handleButtonClick() {
    var textInput = document.getElementById("songTextInput");
    var songName = textInput.value;
    var li = document.createElement("li");
    li.innerHTML = songName;
    var ul = document.getElementById("list");
    ul.appendChild(li);
    save(songName);
}

Parameter Vs Arguments
. When you define a function you can define it with one or more parameters
function cook(degrees, mode, duration) {
// your code here
}
. When you call a function, you call it with arguments:
cook(425.0, "bake", 45);

You define a function with parameters, you call a function with arguments

the variables you define outside a function are globally scoped, and the function variables are locally scoped

Globals live as long as the page. A global variable begins life when its JavaScript is loaded
into the page. But, your global variable’s life ends when the page goes away. Even if you reload the
same page, all your global variables are destroyed and then recreated in the newly loaded page.

Local variables typically disappear when your function ends. Local variables are created when your function is first called and live until the function returns (with a value or not). That said, you can take the values of your local variables and return them from the function before the variables meet their digital maker.

You “shadow” your global.
Here’s what that means: say you have a global variable beanCounter and you then declare a function, like this

var beanCounter = 10;
function getNumberOfItems(ordertype) {
var beanCounter = 0;
if (ordertype == "order") {
// do some stuff with beanCounter...
}
return beanCounter;
}

When you do this, any references to beanCounter within the function refer to the local variable and not the global. So we say the global variable is in the shadow of the local variable (in other words we can’t see it because the local version is in our way).

functions are also values

function addOne(num) {
return num + 1;
}
var plusOne = addOne;
var result = plusOne(1);

your function can be anonymous

function(num) {
    return num + 1;
}
var f = function(num) {
    return num + 1;
}
var result = f(1);
alert(result);

functions as values

So what’s the big deal? Why is this useful? Well, the important thing isn’t so much that we can assign a function to a variable, that’s just our way of showing you that a function actually is a value. And you know you can store values in variables or arrays, you can pass them as arguments to functions, or as we’ll soon see, you can assign them to the properties of objects. But, rather than talking you through how anonymous functions are useful, let’s just look at one of the many ways using functions as values starts to get interesting

function init() {
alert("you rule!");
}
window.onload = init;

or

window.onload = function() {
alert("you rule!");
}

How to create an object in JavaScript
So we’ve got a object with some properties; how do we create this using JavaScript? Here’s how:

var fido = {
name: "Fido",
weight: 40,
breed: "Mixed",
loves: ["walks", "fetching balls"]
};

Access objects properties
dot notation - fido.weight
[] notation - fido["weight"]


Change property values
fido.weight = 27;
fido.breed = "Chawalla/Great Dane mix";
fido.loves.push("chewing bones");

Enumerate all an object’s properties
var prop;
for (prop in fido) {
    alert("Fido has a " + prop + " property ");
    if (prop == "name") {
        alert("This is " + fido[prop]);
    }
}

object’s array
var likes = fido.loves;
var likesString = "Fido likes";
for (var i = 0; i < likes.length; i++) {
    likesString += " " + likes[i];
}
alert(likesString);

Pass an object to a function
function bark(dog) {
    if (dog.weight > 25) {
        alert("WOOF");
    } else {
        alert("yip");
    }
}

To add a property to an object
fido.age = 5

To delete a property to an object
delete fido.age


passing objects to functions
When an object is assigned to a variable, the variable is given a reference to the object. It doesn’t “hold” the object itself

So, when you call a function and pass it an object, you’re passing the object reference—not the object itself, just a “pointer” to it. A copy of the reference is passed into the parameter, which then points to the original object

So, what does this all mean? Well, when you change a property of the object, you’re changing the property in the original object, not a copy, and so, you’ll see all the changes you make to an object within and outside of your function

When an object has a function in it, we say that object has a method.
var fido = {
    name: "Fido",    
    weight: 40,
    breed: "Mixed",
    loves: ["walks", "fetching balls"]
    bark: function() {
        alert("Woof woof!");
    }
};

calling method of an object
fido.bark()


Make a constructor ()

function Dog(name, breed, weight) {
    this.name = name;
    this.breed = breed;
    this.weight = weight;
    this.bark = function() {
        if (this.weight > 25) {
            alert(this.name + " says Woof!");
            } else {
            alert(this.name + " says Yip!");
        }
    };
}

Calling constructor
var fido = new Dog("Fido", "Mixed", 38);
var tiny = new Dog("Tiny", "Chawalla", 8);
var clifford = new Dog("Clifford", "Bloodhound", 65);

window object
When you’re writing code for the browser, the window object is always going to be part of your life. The window object represents both the global environment for your JavaScript programs and the main window of your app, and as such, it contains many core properties and methods. Let’s take a look at it:

Window is the global object. 
It may seem a little weird, but the window object acts as your global environment, so the names of any
properties or methods from window are resolved even if you don’t prepend them with window.
In addition, any global variables you define are also put into the window namespace, so you can reference them as window.myvariable.

window -- Object
-- Object Properties
location
status
onload
document
-- Object Methods
alert
prompt
open
close
setTimeout
setInterval


document -- Object
-- Object Properties
domain
title
URL
-- Object Methods
getElementById
getElementsByTagName
getElementsByClassName
createElement



p --Object
-- Object Properties
innerHTML
childElementCount
firstChild
-- Object Methods
appendChild
insertBefore
setAttribute
getAttribute























Sunday, November 8, 2020

Azure Fundamentals Preparation.....

 On 11/08 - Registered for Microsoft Azure Virtual Training from link https://www.microsoft.com/en-ie/training-days?activetab=0%3aprimaryr4

Microsoft Azure Virtual Training Day: Fundamentals Part 1
13:00 PM (GMT+01:00) Brussels, Copenhagen, Madrid, Paris
25 November 2020
Click to add the virtual training day to your calendar


Microsoft Azure Virtual Training Day: Fundamentals Part 2
13:00 PM (GMT+01:00) Brussels, Copenhagen, Madrid, Paris
26 November 2020


This will give me free exam voucher..


Few training videos are as follows


https://www.youtube.com/watch?v=NKEFWyqJ5XA&t=6822s


https://docs.microsoft.com/en-us/learn/certifications/azure-fundamentals


Certification details for Microsoft are as follows

https://docs.microsoft.com/en-us/learn/certifications/


Attended both training sessions on 25 & 26 and recorded them as below

https://youtu.be/uLtbge8L4sg

https://youtu.be/Txa2SGfDtnM


Voice in first video is not recorded correctly, but still its Okay.


On 27 Nov, morning, I received a "Thank you for attending" email from Microsoft, wherein they had mentioned that free exam voucher will be available in 5-6 business days, however, I was able to register it free of cost on 27-Nov itself.


As mentioned in email, I had to first create a profile on https://www.microsoft.com/en-us/learning/dashboard.aspx, once I do that, I need to click on "Schedule an Exam" -- I did that from https://home.pearsonvue.com/ .. everything you have to do inside microsoft learning portal itself.

Once you choose Pearsonvue, you will be redirected to another page, wherein it will ask your details - moment you fill that, on next link it will automatically authenticate you as you had appeared for above training, and asked you to avail those points for free exam.


 Following are links for Dumps

https://pupuweb.com/microsoft-azure-fundamentals-az900-actual-exam-question-answer-dumps/27/#:~:text=Correct%20Answer%3A%20A.-,Yes.,Service%20Level%20Agreement%20(SLA).

https://www.examtopics.com/discussions/microsoft/view/7886-exam-az-900-topic-1-question-113-discussion/

https://quizlet.com/411185185/az-900-exam-prep-flash-cards/

https://www.dumpscollection.net/dumps/AZ-900/

https://www.testpreptraining.com/microsoft-azure-fundamentals-az-900-free-practice-test

Friday, July 3, 2020

Web Design Course -- Udemy

--07/03
Downloaded http://brackets.io/ -- but better to go for Visual Studio

Course by -- Jonas Schmedtmann
YouTube -- https://www.youtube.com/channel/UCNsU-y15AwmU2Q8QTQJG1jw
ChatRoom -- https://discord.com/invite/0ocsLcmnIZqxMSYD
Resource -- http://codingheroes.io/resources/
Twitter -- https://twitter.com/jonasschmedtman

First Project
download -- https://drive.google.com/file/d/0B-L1rGXV4PtMNVFkQlhIenZLbm8/view

To create dummy text
https://www.blindtextgenerator.com/lorem-ipsum

Tags
<strong>bold</strong>
<em>Emphasize</em>
<u>Underlined</u>
<br>break
<img src="" alt="alternative text">
<a href="" target="_blank">To open in new tab use target attri</a> -- this is not only web url but also images u can specify in href attri




Tuesday, February 18, 2020

Running Python Web-Servers

There are basically 2 ways which I have learned so far
1. You can run internal python web server
     python.exe -m http.server <8888> --port number is optional.. default is 8000

2. Using Flash web server, and to run that simply call python.exe <python file of flash>. please see below

PS C:\Mandar\Projects\RaterMigration\IhExpressToCogitateRater> python.exe app.py
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 629-182-235
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [30/May/2020 18:11:37] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2020 18:11:37] "GET /static/css/styles.css HTTP/1.1" 404 -
127.0.0.1 - - [30/May/2020 18:11:38] "GET /static/img/favicon.ico HTTP/1.1" 404 -

Thursday, February 13, 2020

Flask & Model Connection

import os
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.xception import (
    Xception, preprocess_input, decode_predictions)
from tensorflow.keras.models import load_model
UPLOAD_FOLDER = '.'
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
    
# Refactor above steps into reusable function
def predict(image_path):
    # Load the Xception model
    # https://keras.io/applications/#xception
    model = load_model('xception.h5')
    # Default Image Size for Xception
    image_size = (299, 299)
    """Use Xception to label image"""
    img = image.load_img(image_path, target_size=image_size)
    x = image.img_to_array(img)
    x = np.expand_dims(x, axis=0)
    x = preprocess_input(x)
    
    predictions = model.predict(x)
    #plt.imshow(img)
    
    result = decode_predictions(predictions, top=3)[0]
    print('Predicted:', result)
    return result
def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
def classify(filename):
    result = predict(filename)
    #os.remove(filename)
    strTable = '<table>'
    for r in result:
        strTable += '<tr>'
        strTable += '<td>' + str(r[1]) + '</td>'
        strTable += '<td>' + str(r[2]) + '</td>'
        strTable += '</tr>'
    strTable += '</table>'
    strHTML = f'Successfully uploaded {filename} <BR><BR> Prediction results:<BR> {strTable}'
    os.remove(filename)
    return strHTML
@app.route('/', methods=['GET', 'POST'])
def upload_file():
    if request.method == 'POST':
        # check if the post request has the file part
        if 'file' not in request.files:
            flash('No file part')
            return redirect(request.url)
        file = request.files['file']
        # if user does not select file, browser also
        # submit an empty part without filename
        if file.filename == '':
            flash('No selected file')
            return redirect(request.url)
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            #return redirect(url_for('classify',filename=filename))
            return classify(filename)
    return '''
    <!doctype html>
    <title>Upload new File</title>
    <h1>Upload new File</h1>
    <form method=post enctype=multipart/form-data>
      <input type=file name=file>
      <input type=submit value=Upload>
    </form>
    '''
if __name__ == "__main__":
    
    app.run(debug=True)

All about CSS

From book HTML & CSS - Design and Build Websites - Jon Duckett CSS works by associating rules with HTML elements. These rules govern how...