Tuesday, January 21, 2020

Xamarin Forms Best Practices Enable the XAML compiler

XAML can be optionally compiled directly into intermediate language (IL) with the XAML compiler (XAMLC). XAMLC offers a number of benefits:
  • It performs compile-time checking of XAML, notifying the user of any errors.
  • It removes some of the load and instantiation time for XAML elements.
  • It helps to reduce the file size of the final assembly by no longer including .xaml files.

TPL Task Parallel Library mapping to Async Await

What is async/await?

The async and await keywords were introduced in .NET 4.5 to make calling async methods easier and to make your async code more easily readable. 
The async/await API is syntactic sugar that uses the TPL (Task Parallel Library) behind the scenes. If you wanted to start a new task and have code run on the UI thread after the task completes prior .NET 4.5, your code would have looked something like this:

Using async/await, the above code becomes just two lines of it.In the nutshell it does exactly the same thing.
The above code gets compiled behind the scenes to the same TPL code as it does in the first example, so as noted, this is just syntactic sugar, and how sweet it is!

Monday, January 13, 2020

Fiddler Web Debugging Proxy - Filtering by Process

Cool Tip to begin with:

If you are in fiddler IDE , at the bottom there is status bar. Look closely at left side of bottom status bar. You will notice by default All processes. You can filter and can view process related to web browser or Non web browser( For e.g word, pdf etc). Even you can hide them.




Tuesday, December 17, 2019

Security Beware Phishing

I happened to attend Security Hacker Jam session. It was an eye opening session never thought of there are so many things we tend to forget and act unknowingly in a spur of a moment. Digital world and technology has changed lot of things for us whether it is a web cam, an app or any sort of software you use. it is very difficult to assess and certify it is 100% secure. Moment you start using them you might be in risk of security vulnerable.
Having said that Phishing of different kind is taking toll on our personal data and we compromise so many things in the process.


  • Never act under pressure, take 3 sec to think if you have to act. For example you're in a meeting and you got an email, you see some urgency to reply and it happened that you acted upon an urgency to get rid off one of your task perhaps you have risk the data. You have opened up spam email thar resulted in breach in security.
  • Never leave your system unattended someone can use Rubber Ducky USB to get access to your sensitive data.
  • Never ever use lost USB , it might be left for purpose so that you can use them and it just do its magic
  • Phishing scams are the most common way for criminals to steal information, take control of a network or cause harm to organisations or individuals.
  • They use ‘bait’ to have you click on a link, download an attachment or perform an action. 
  • The objective is to get users to provide personal or account information, or to make wire transfer funds to fraudulent accounts.

Type of Phishing

  1. Smishing - Doggie Links through SMS
  2. Vishing - Voice +phishing- Through call
  3. Spear Phishing- sending emails to millions of unknown users
  4. Whaling- Whaling is not very different from spear phishing, but the targeted group becomes more specific and confined in this type of phishing attack.This technique targets C-suite posts like CEO, CFO, COO – or any other senior management positions – who are considered to be big players in the information chain of any organization, commonly known as “whales” in phishing terms.

Best practice to act on email

  1. Don't trust the display name. 
  2. Does it sound too good  to be true? 
  3. Think before you click. 
  4. Check for spelling errors. 
  5. Beware of urgency. Asking for personal information. 
  6. Check the email signature. 
  7. When in doubt, ask for help. 



Thursday, November 21, 2019

AI for For the Blind and Visually Impaired

I'm not sure if there is any device or product around that just replaces human eye with digital smart camera. What I mean is Smart Eye Device can do?

Wearable Smart Eye Device WSED Features:


  • Identity obstacles , identify people around while walking. 
  • Look for traffic light  any object to assist visually challenged person to move around with ease like normal eye can. Assistive and adaptive vision to make a clear mapping of path for visually challenged. 360 eye vision smart device for safety.
  •  Read image, text and recognize any people and object. Just like any eye.
Just imagine if automated car can  manoeuvre then on similar line we can think of solution to replace eye with smart eye.

This product is one step forward to achieve one of the above functions what if AI revolutionized and does wonder. 

Not sure if Microsoft HOLO lens 2.0 or vitual reality to Actual reality

Monday, November 18, 2019

My Xamarin Journey So far

Xamarin.forms

  • MVVM
  • Data Binding
  • Resource
  • MainActivity - Icon 
  • Splash Screen On load launcher
  • ResourceDictionary
  • Dynamic vs static Resource
  • Frame
  • Use of Application setting

Controls-Component


  • Listview/Collection View
  • Tab View
  • Carousal
  • Grid View
  • TabbedPage

Explore AdMob

Thursday, October 31, 2019

Web Scrapping


Math: Pascal Triangle unknown facts and mysteries


This may look like a neatly arranged stack of numbers, but it's actually a mathematical treasure trove. Indian mathematicians called it the Staircase of Mount Meru. In Iran, it's the Khayyam Triangle. And in China, it's Yang Hui's Triangle. To much of the Western world, it's known as Pascal's Triangle after French mathematician Blaise Pascal, which seems a bit unfair since he was clearly late to the party, but he still had a lot to contribute. So what is it about this that has so intrigued mathematicians the world over? In short, it's full of patterns and secrets. 

First and foremost, there's the pattern that generates it. Start with one and imagine invisible zeros on either side of it. Add them together in pairs, and you'll generate the next row. Now, do that again and again. Keep going and you'll wind up with something like this, though really Pascal's Triangle goes on infinitely. Now, each row corresponds to what's called the coefficients of a binomial expansion of the form (x+y)^n, where n is the number of the row, and we start counting from zero. So if you make n=2 and expand it, you get (x^2) + 2xy + (y^2). The coefficients, or numbers in front of the variables, are the same as the numbers in that row of Pascal's Triangle. You'll see the same thing with n=3, which expands to this. So the triangle is a quick and easy way to look up all of these coefficients. But there's much more. For example, add up the numbers in each row, and you'll get successive powers of two. Or in a given row, treat each number as part of a decimal expansion. In other words, row two is (1x1) + (2x10) + (1x100). You get 121, which is 11^2. And take a look at what happens when you do the same thing to row six. It adds up to 1,771,561, which is 11^6, and so on. There are also geometric applications. Look at the diagonals. The first two aren't very interesting: all ones, and then the positive integers, also known as natural numbers. But the numbers in the next diagonal are called the triangular numbers because if you take that many dots, you can stack them into equilateral triangles. The next diagonal has the tetrahedral numbers because similarly, you can stack that many spheres into tetrahedra. Or how about this: shade in all of the odd numbers. It doesn't look like much when the triangle's small, but if you add thousands of rows, you get a fractal known as Sierpinski's Triangle. This triangle isn't just a mathematical work of art. It's also quite useful, especially when it comes to probability and calculations in the domain of combinatorics. 

Say you want to have five children, and would like to know the probability of having your dream family of three girls and two boys. In the binomial expansion, that corresponds to girl plus boy to the fifth power. So we look at the row five, where the first number corresponds to five girls, and the last corresponds to five boys. The third number is what we're looking for. Ten out of the sum of all the possibilities in the row. so 10/32, or 31.25%. Or, if you're randomly picking a five-player basketball team out of a group of twelve friends, how many possible groups of five are there? 

In combinatoric terms, this problem would be phrased as twelve choose five, and could be calculated with this formula, or you could just look at the sixth element of row twelve on the triangle and get your answer. The patterns in Pascal's Triangle are a testament to the elegantly interwoven fabric of mathematics. And it's still revealing fresh secrets to this day. For example, mathematicians recently discovered a way to expand it to these kinds of polynomials. What might we find next? Well, that's up to you.

Friday, October 18, 2019

Geogera: Algorithm Bezier Curve Steps



    Bezier Curve
    1 Point A
    2 Point B
    3 Segment a Segment [A, B]
    4 Point C
    5 Segment b Segment [A, C]
    6 Number n
    7 List listAB Sequence[A + i / n (B - A), i, 1, n]
    8 List listAC Sequence[A + i / n (C - A), i, 1, n]
    9 List list3 Sequence[Segment[Element[listAB, i], Element[listAC, n - i]], i, 1, n]
    10 List listBC Sequence[C + i / n (B - C), i, 1, n]
    11 List list5 Sequence[Segment[Element[listAB, i], Element[listBC, n - i]], i, 1, n]
    12 Segment c Segment [C, B]
    13 List listCB Sequence[B + i / n (C - B), i, 1, n]
    14 List list6 Sequence[Segment[Element[listAC, i], Element[listCB, n - i]], i, 1, n]

Geogebra: Divide Cirlce with n parts with polar view


https://www.geogebra.org/graphing/qz9nvmbp

Divide Circle with n parts

 Sequence(Rotate(B, i°, A), i, 0, 360, 360 / n)

Join segments from Center A to n points on circle circumference

 Sequence(Segment(A, l1(n)), n, 0, 100)

Wednesday, October 16, 2019

Coding Standards, Guidelines and Best Practices: Avoid Aysnc Void


Getting Started with Asynchronous Programming in .NET


Use Async Void


Async Void is only appropriate for Event Handler
protected async void search_click( object sender, RouteEventArgs e)
{
     await GetStocks()


Alternate Solution 

private async Task GetStock()
{

}

Take Away:
Async Void crashes an application or may results in 500 exception if something went wrong. As there is no way to propagate exception even you have proper try catch. 

Call GetStock()

private async void GetStock()
{
 try
{}
catch()
}

Monday, October 14, 2019

Geogebra: Circle with Sequence, Dilate and Segment geometry tricks

Learn Geometry 

You can open my geogebra activity and can try similar activity.
Click here


Hint:
Sequence(Dilate(C, i / s, B), i, 1, s)
To divide segment into equal parts with dynamic points in it

Sequence(Segment(G, l5(n)), n, 0, s)
To create dynamic segments 









It makes lot of sense when you.....

It makes lot of sense when you're SEEN, HEARD and VALUED! If that is the case then you're actually part of it or you're acknowledged or you've been respected Otherwise that is not the place you should be.
Just imagine you're in a meeting or discussion, you're seen but not heard if heard not valued that means you're not required.
Now in this case you're part of the team and you're seen but heard perhaps not valued . Your opinion doesn't stands any good. In and all it is very important you should be seen , heard and at the same time valued. That means you're respected and people needs you.
So bottom line is, the only way you should feel you're R equired or C onnected or R espected, it is only through these sense of acknowledgment of being Seen, heard and valued .
Eventually it shapes your whole career path for Being what you'reBelong to place you want to be and Become is the path to your career progression ...you want to be.
If none of these happens then it is a call for ....?

Monday, September 23, 2019

.Net core http pipeline processing Use, Run or Map

Request processing pattern showing a request arriving, processing through three middlewares, and the response leaving the app. Each middleware runs its logic and hands off the request to the next middleware at the next() statement. After the third middleware processes the request, the request passes back through the prior two middlewares in reverse order for additional processing after their next() statements before leaving the app as a response to the client.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseSession(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); }

public void Configure(IApplicationBuilder app) { app.Map("/map1/seg1", HandleMultiSeg); app.Run(async context => { await context.Response.WriteAsync("Hello from non-Map delegate."); }); }

Dependency Injection Overview

Highlevel
  •  Register Services(Collection) in container
  • Define Object lifetime- Transient| Scoped|Singleton
  • Create Instance at run time



Transient

Create instance of an object everytime it is requested

Scoped

Create object and lifetime of an object stays as scope defined

Singleton

Created once for an application level and served single object for all request.