Microsoft Azure Fundamentals: Describe cloud concepts I. Describe cloud computing 

https://learn.microsoft.com/en-us/training/modules/describe-cloud-compute/1-introduction-microsoft-azure-fundamentals

1. Introduction to Microsoft Azure Fundamentals

Microsoft Azure is a cloud computing platform with an ever-expanding set of services to help you build solutions to meet your business goals. Azure services support everything from simple to complex. Azure has simple web services for hosting your business presence in the cloud. Azure also supports running fully virtualized computers managing your custom software solutions. Azure provides a wealth of cloud-based services like remote storage, database hosting, and centralized account management. Azure also offers new capabilities like artificial intelligence (AI) and Internet of Things (IoT) focused services.

In this series, you’ll cover cloud computing basics, be introduced to some of the core services provided by Microsoft Azure, and will learn more about the governance and compliance services that you can use.

2. What is Azure Fundamentals?

Azure Fundamentals is a series of three learning paths that familiarize you with Azure and its many services and features.

Whether you’re interested in compute, networking, or storage services; learning about cloud security best practices; or exploring governance and management options, think of Azure Fundamentals as your curated guide to Azure.

Azure Fundamentals includes interactive exercises that give you hands-on experience with Azure. Many exercises provide a temporary Azure portal environment called the sandbox, which allows you to practice creating cloud resources for free at your own pace.

Technical IT experience isn’t required; however, having general IT knowledge will help you get the most from your learning experience.

Filter in Jsgrid

Wednesday 01/15/2020

JSGRID -FILTER

autoload: true,

filtering: true,

loadData: function(filter) {

var d = $.Deferred();

 

// server-side filtering

$.ajax({

type: “GET”,

url: “/items”,

data: filter,

dataType: “json”

}).done(function(result) {

// client-side filtering

result = $.grep(result, function(item) {

return item.SomeField === filter.SomeField;

});

 

d.resolve(result);

})

 

return d.promise();

}

https://github.com/tabalinas/jsgrid/issues/32

 

https://github.com/tabalinas/jsgrid/blob/master/demos/db.js

How to use materialize autocomplete plugin with ajax?

ajaxAutoComplete({inputId:'autocomplete-input',ajaxUrl:'/search/my-auto-complete-results'})

function ajaxAutoComplete(options)
{

    var defaults = {
        inputId:null,
        ajaxUrl:false,    
        data: {},
        minLength: 3
    };

    options = $.extend(defaults, options);
    var $input = $("#" + options.inputId);


    if (options.ajaxUrl){


        var $autocomplete = $('<ul id="ac" class="autocomplete-content dropdown-content"'
            + 'style="position:absolute"></ul>'),
        $inputDiv = $input.closest('.input-field'),
        request,
        runningRequest = false,
        timeout,
        liSelected;

        if ($inputDiv.length) {
            $inputDiv.append($autocomplete); // Set ul in body
        } else {
            $input.after($autocomplete);
        }

        var highlight = function (string, match) {
            var matchStart = string.toLowerCase().indexOf("" + match.toLowerCase() + ""),
            matchEnd = matchStart + match.length - 1,
            beforeMatch = string.slice(0, matchStart),
            matchText = string.slice(matchStart, matchEnd + 1),
            afterMatch = string.slice(matchEnd + 1);
            string = "<span>" + beforeMatch + "<span class='highlight'>" + 
            matchText + "</span>" + afterMatch + "</span>";
            return string;

        };

        $autocomplete.on('click', 'li', function () {
            $input.val($(this).text().trim());
            $autocomplete.empty();
        });

        $input.on('keyup', function (e) {

            if (timeout) { // comment to remove timeout
                clearTimeout(timeout);
            }

            if (runningRequest) {
                request.abort();
            }

            if (e.which === 13) { // select element with enter key
                liSelected[0].click();
                return;
            }

            // scroll ul with arrow keys
            if (e.which === 40) {   // down arrow
                if (liSelected) {
                    liSelected.removeClass('selected');
                    next = liSelected.next();
                    if (next.length > 0) {
                        liSelected = next.addClass('selected');
                    } else {
                        liSelected = $autocomplete.find('li').eq(0).addClass('selected');
                    }
                } else {
                    liSelected = $autocomplete.find('li').eq(0).addClass('selected');
                }
                return; // stop new AJAX call
            } else if (e.which === 38) { // up arrow
                if (liSelected) {
                    liSelected.removeClass('selected');
                    next = liSelected.prev();
                    if (next.length > 0) {
                        liSelected = next.addClass('selected');
                    } else {
                        liSelected = $autocomplete.find('li').last().addClass('selected');
                    }
                } else {
                    liSelected = $autocomplete.find('li').last().addClass('selected');
                }
                return;
            } 

            // escape these keys
            if (e.which === 9 ||        // tab
                e.which === 16 ||       // shift
                e.which === 17 ||       // ctrl
                e.which === 18 ||       // alt
                e.which === 20 ||       // caps lock
                e.which === 35 ||       // end
                e.which === 36 ||       // home
                e.which === 37 ||       // left arrow
                e.which === 39) {       // right arrow
                return;
            } else if (e.which === 27) { // Esc. Close ul
                $autocomplete.empty();
                return;
            }

            var val = $input.val().toLowerCase();
            $autocomplete.empty();

            if (val.length > options.minLength) {

                timeout = setTimeout(function () { // comment this line to remove timeout
                    runningRequest = true;

                    request = $.ajax({
                        type: 'GET',
                        url: options.ajaxUrl + val,
                        success: function (data) {
                            if (!$.isEmptyObject(data)) { // (or other) check for empty result
                                var appendList = '';
                                for (var key in data) {
                                    if (data.hasOwnProperty(key)) {
                                        var li = '';
                                        if (!!data[key]) { // if image exists as in official docs
                                            li += '<li><img src="' + data[key] + '" class="left">';
                                            li += "<span>" + highlight(key, val) + "</span></li>";
                                        } else {
                                            li += '<li><span>' + highlight(key, val) + '</span></li>';
                                        }
                                        appendList += li;
                                    }
                                }
                                $autocomplete.append(appendList);
                            }else{
                                $autocomplete.append($('<li>No matches</li>'));
                            }
                        },
                        complete: function () {
                            runningRequest = false;
                        }
                    });
                }, 250);        // comment this line to remove timeout
            }
        });

        $(document).click(function () { // close ul if clicked outside
            if (!$(event.target).closest($autocomplete).length) {
                $autocomplete.empty();
            }
        });
    }
}

https://stackoverflow.com/questions/38690307/how-to-use-materialize-autocomplete-plugin-with-ajax

Key code

https://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes

 

Key Code
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
caps lock 20
escape 27
page up 33
page down 34
end 35
home 36
left arrow 37
up arrow 38
right arrow 39
down arrow 40
insert 45
delete 46
0 48
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57
a 65
b 66
c 67
d 68
Key Code
e 69
f 70
g 71
h 72
i 73
j 74
k 75
l 76
m 77
n 78
o 79
p 80
q 81
r 82
s 83
t 84
u 85
v 86
w 87
x 88
y 89
z 90
left window key 91
right window key 92
select key 93
numpad 0 96
numpad 1 97
numpad 2 98
numpad 3 99
numpad 4 100
numpad 5 101
numpad 6 102
numpad 7 103
Key Code
numpad 8 104
numpad 9 105
multiply 106
add 107
subtract 109
decimal point 110
divide 111
f1 112
f2 113
f3 114
f4 115
f5 116
f6 117
f7 118
f8 119
f9 120
f10 121
f11 122
f12 123
num lock 144
scroll lock 145
semi-colon 186
equal sign 187
comma 188
dash 189
period 190
forward slash 191
grave accent 192
open bracket 219
back slash 220
close braket 221
single quote 222

OrderBy in Query Syntax C#

Example: OrderBy in Query Syntax C#
IList<Student> studentList = new List<Student>() { 
    new Student() { StudentID = 1, StudentName = "John", Age = 18 } ,
    new Student() { StudentID = 2, StudentName = "Steve",  Age = 15 } ,
    new Student() { StudentID = 3, StudentName = "Bill",  Age = 25 } ,
    new Student() { StudentID = 4, StudentName = "Ram" , Age = 20 } ,
    new Student() { StudentID = 5, StudentName = "Ron" , Age = 19 } 
};

var orderByResult = from s in studentList
                   orderby s.StudentName 
                   select s;

var orderByDescendingResult = from s in studentList
                   orderby s.StudentName descending
                   select s;

https://www.tutorialsteacher.com/linq/linq-sorting-operators-orderby-orderbydescending

Extend an existing renderer

1. Project XFDraw, create a derived element  ShadowedLabel.cs as below:

using Xamarin.Forms;
namespace XFDraw
{
class ShadowedLabel : Label
{
}
}

2. Project XFDraw, use the custom element:

  1. Open MainPage.xaml in the XFDraw shared project.

  2. Notice the XML namespace named local, which is used to reach the XFDraw namespace.
  3. Replace the existing Label with your new ShadowedLabel. Leave all existing properties as they are.
    <ContentPage …
    xmlns:local=”clr-namespace:XFDraw”>
    <Grid x:Name=”mainLayout” Padding=”10″>
    <local:ShadowedLabel Text=”Microsoft Learn” HorizontalOptions=”Center” VerticalOptions=”End” />
    </Grid>
    </ContentPage>
    3. Create the Android renderer:
    [assembly: ExportRenderer(typeof(ShadowedLabel), typeof(ShadowedLabelRenderer))]
    namespace XFDraw.Droid
    {
    class ShadowedLabelRenderer : LabelRenderer
    {
    public ShadowedLabelRenderer(Context context) : base (context)
    {
    }protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
    {
    base.OnElementChanged(e);
    Control.SetShadowLayer(10, 5, 5, Android.Graphics.Color.DarkGray);
    }
    }
    }

    4. Create the iOS renderer

    [assembly: ExportRenderer(typeof(ShadowedLabel), typeof(ShadowedLabelRenderer))]
    namespace XFDraw.iOS
    {
    class ShadowedLabelRenderer : LabelRenderer
    {
    protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
    {
    base.OnElementChanged(e);

    Control.Layer.ShadowColor = UIColor.DarkGray.CGColor;
    Control.Layer.ShadowOpacity = 1.0f;
    Control.Layer.ShadowRadius = 2f;
    Control.Layer.ShadowOffset = new CGSize(4, 4);
    Control.Layer.MasksToBounds = false;
    }
    }
    }

    Source: https://docs.microsoft.com/en-us/learn/modules/create-custom-controls-with-forms-renderers/4-exercise-extend-an-existing-renderer