Cayla  Erdman

Cayla Erdman

1602318660

Join Hacktoberfest at the Xamarin Community Toolkit

You may have heard about the Xamarin Community Toolkit by now. This toolkit will be an important part of the Xamarin.Forms ecosystem during the evolution to .NET 6. Now is the time to contribute since it is “Hacktoberfest” after all!

What is the Xamarin Community Toolkit?

Since Xamarin.Forms 5 will be the last major version of Forms before .NET 6, we wanted to have an intermediate library that can still add value for Forms in the meanwhile. However, why stop there? There is also a lot of converters, behaviors, effects, etc. that everyone is continually rewriting. To help avoid this, we consolidated all of those into the Xamarin Community Toolkit.

This toolkit already has a lot of traction and support from our wonderful community, but there is always room for more! Lucky for us, that time of year which makes contributing extra special is upon us again.

Hacktoberfest 2020

For Hacktoberfest we welcome you all to join us and plant that tree (new reward by Hacktoberfest!) or earn that t-shirt while giving some of your valuable time to our library. On top of that, we will offer some swag whenever you decide to contribute. When you do, we will reach out to you near the end of October and if your PRs are eligible to make sure we get your details. That means: no need to do anything special, just crush that code!

HacktoberFest Xamarin Community Toolkit Flyer

#announcements #events #xamarin #xamarin.forms #hacktoberfest #xamarin community toolkit

What is GEEK

Buddha Community

Join Hacktoberfest at the Xamarin Community Toolkit
Cayla  Erdman

Cayla Erdman

1602318660

Join Hacktoberfest at the Xamarin Community Toolkit

You may have heard about the Xamarin Community Toolkit by now. This toolkit will be an important part of the Xamarin.Forms ecosystem during the evolution to .NET 6. Now is the time to contribute since it is “Hacktoberfest” after all!

What is the Xamarin Community Toolkit?

Since Xamarin.Forms 5 will be the last major version of Forms before .NET 6, we wanted to have an intermediate library that can still add value for Forms in the meanwhile. However, why stop there? There is also a lot of converters, behaviors, effects, etc. that everyone is continually rewriting. To help avoid this, we consolidated all of those into the Xamarin Community Toolkit.

This toolkit already has a lot of traction and support from our wonderful community, but there is always room for more! Lucky for us, that time of year which makes contributing extra special is upon us again.

Hacktoberfest 2020

For Hacktoberfest we welcome you all to join us and plant that tree (new reward by Hacktoberfest!) or earn that t-shirt while giving some of your valuable time to our library. On top of that, we will offer some swag whenever you decide to contribute. When you do, we will reach out to you near the end of October and if your PRs are eligible to make sure we get your details. That means: no need to do anything special, just crush that code!

HacktoberFest Xamarin Community Toolkit Flyer

#announcements #events #xamarin #xamarin.forms #hacktoberfest #xamarin community toolkit

Gaurav Singh

1609755091

Xamarin Forms Training Institute | Xamarin Forms Development Classes | Xamarin Training

In this Xamarin Online course, you will learn each and every topic with the help of hands-on labs. This program includes a hands-on live project with the implementation of recommended design patterns and practices. The learning path for this program is given below:
Xamarin Training objective
At the completion of this course, attendees will be able to;

  1. Understand Xamarin architecture
  2. Understand Xamarin .Android, Xamarin. iOS fundamentals
  3. Understand Xamarin. Forms fundamentals
  4. Build UI with XAML and code
  5. Work with images, display data beautifully and create interactive lists
  6. Implement multi-page apps with navigation, tabs, master/detail pages
  7. Store and retrieve data from a variety of sources like file system, SQLite database and RESTful services
  8. Implement MVVM pattern

#xamarin training #xamarin course #xamarin forms course #xamarin online course #xamarin forms training #xamarin training course

How to Design Login Page using Xamarin Forms C# | Login Form | Sign In UI Design

#xamarin
#aspdotnetexplorer
https://www.youtube.com/watch?v=2tehSdX897E

#xamarin forms #xamarin forms bangla tutorials for beginners #xamarin forms tutorials for beginners #xamarin #xamarin.forms #xamarin.forms ui

the featured effects available in Xamarin Community Toolkit

In this post, we are going to see the featured effects available in Xamarin Community Toolkit and how to use them. This post is a part of Xamarin Community Toolkit - Tutorial Series, visit the post to know about the Xamarin Community Toolkit. The Xamarin Community Toolkit is a collection of reusable elements for mobile development with Xamarin.Forms, including animations, behaviors, converters, effects, and helpers. It simplifies and demonstrates common developer tasks when building iOS, Android, macOS, WPF, and Universal Windows Platform (UWP) apps using Xamarin.Forms. 

Coding Part

Steps

  1. Step 1: Creating new Xamarin.Forms Projects.
  2. Step 2: Setting up the Xamarin Community Toolkit in Xamarin.Forms .Net Standard Project.
  3. Step 3: Implementation of Effects using Xamarin Community Toolkit.

Step 1: Creating new Xamarin.Forms Projects

Create New Project by Selecting New Project à Select Xamarin Cross Platform App and Click OK.

Note: Xamarin.Forms version should be greater than 5.0.

Then Select Android and iOS Platforms as shown below with Code Sharing Strategy as PCL or .Net Standard and Click OK.

Step 2: Setting up the scanner in Xamarin.Forms .Net Standard Project

In this step, we will see how to setup the plugin.

  • Open the Nuget Manager in the Visual Studio Solution by right clicking the solution and select “Manage Nuget Packages”.
     

  • Then select “Xamarin Community Toolkit” and check all the projects in the solution, install the plugin

    ​​​​​

Step 3: Implementation of Effects using Xamarin Community Toolkit.

In this step, we will see how to implement the featured effects offered in Xamarin Community Toolkit. Here, we have explained the implementation of Safe Area Effect, Shadow Effect, Life Cycle Effect, and StatusBar Effect.

  • Open your XAML design file and add the following namespace to utilize the views on the screen.
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"

C#

SafeAreaEffect

  • The SafeAreaEffect is an effect that can be added to any element through an attached property to indicate whether or not that element should take current safe areas into account.
  • This is an area of the screen that is safe for all devices that use iOS 11 and greater.

Specifically, it will help to make sure that content isn't clipped by rounded device corners, the home indicator, or the sensor housing on an iPhone X. The effect only targets iOS, meaning that on other platforms it does not do anything.

Properties

<StackLayout xct:SafeAreaEffect.SafeArea="True" BackgroundColor="White"> </StackLayout>

C#

SafeArea

Indicates which safe areas should be taken into account for this element

Before Applying the Effect

After Applying the Effect

ShadowEffect

It is used to have a shadow effect for Xamarin Forms Views and we have five properties that need to be understood to use this effect.

Properties

  1. Color: It's the color that the shadow will have.
  2. Opacity: With this property, you can control the opacity you want in the shadow.
  3. Radius: It’s responsible for handling the blurring in the shadow.
  4. OffsetX/OffsetY: It allows us to define the displacement that the shadow will have, therefore OffsetX is responsible for specifying the distance of the horizontal displacement, while OffsetY of the vertical displacement.

In this example, I have updated the shadow effect for the Image Control like in the following code block

<Image
	x:Name="img"
	HeightRequest="150"
	Margin="10"
	xct:ShadowEffect.Color="Green"
	xct:ShadowEffect.OffsetY="15"
	Source="https://shorturl.at/qsvJ1">
</Image>

C#

Lifecycle Effect

The LifecycleEffect allows you to determine when a VisualElement has its renderer allocated by the platform. It can be identified by using the LifeCycleEffect event handlers.

<Image
	x:Name="img"
	HeightRequest="150"
	Margin="10"
	Source="https://shorturl.at/qsvJ1">
	<Image.Effects>
		<xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
	</Image.Effects>
</Image>

C#

private void LifeCycleEffect_Loaded(object sender, EventArgs e)
{
	Console.WriteLine("Image loaded...");
}

private void LifeCycleEffect_Unloaded(object sender, EventArgs e)
{
	Console.WriteLine("Image Unloaded...");
}

C#

Statusbar Effect

  • This effect is used to control the status bar color in the Xamarin Forms Application during the compile time or runtime or like button clicks. It is a single line code to be useful to control.

In this example, we will create color resource in the App.xaml file like below. It will be updated later dynamically.

<Color x:Key="StatusBarColor">Firebrick</Color>

C#

Then add the following line in the root element of your XAML page as a DynamicResource

xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}"

C#

Then add the 3 buttons like in the sample screen and update your dynamic resource color on button click like below.

private void ButtonClicked(object sender, EventArgs e)
{
	Application.Current.Resources["StatusBarColor"] = ((Button)sender).TextColor;
}

C#

Full Code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
             x:Class="XamarinCommunityToolkit.EffectsSamplePage"
             xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}">
    <ContentPage.Content>
        <StackLayout xct:SafeAreaEffect.SafeArea="True"
                     BackgroundColor="White">

            <Frame BackgroundColor="#2196F3"
                   Padding="24"
                   CornerRadius="0">
                <Label Text="Xamarin Forms Effects using XCT"
                       HorizontalTextAlignment="Center"
                       TextColor="White"
                       FontSize="36"/>
            </Frame>

            <Image
                x:Name="img"
                HeightRequest="150"
                Margin="10"
                xct:ShadowEffect.Color="Green"
                xct:ShadowEffect.OffsetY="15"
                Source="https://shorturl.at/qsvJ1">
                <Image.Effects>
                    <xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
                </Image.Effects>
            </Image>
            <Grid Padding="10">
                <Button Clicked="ButtonClicked" Text="Red" TextColor="Red" BorderColor="Red" BorderWidth="2" Grid.Column="0"/>
                <Button Clicked="ButtonClicked" Text="Green" TextColor="Green" BorderColor="Green" BorderWidth="2" Grid.Column="1"/>
                <Button Clicked="ButtonClicked" Text="Blue" TextColor="Blue" BorderColor="Blue" BorderWidth="2" Grid.Column="2"/>
            </Grid>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

C#

The XCT offering other type effects as well and please visit the below link for more samples. https://github.com/xamarin/XamarinCommunityToolkit/tree/main/samples/XCT.Sample/Pages/Effects

Download Code

You can download the code from GitHub. If you have doubt, feel free to post comment. If you like this article and is useful to you, do like, share the article & star the repository on GitHub.

 Source: https://www.c-sharpcorner.com/article/xamarin-community-toolkit-effects/

#xamarin #community #toolkit #effective 

Brad  Hintz

Brad Hintz

1599302760

Apache Spark’s Join Algorithms

One of the most frequently used transformations in Apache Spark is Join operation. Joins in Apache Spark allow the developer to combine two or more data frames based on certain (sortable) keys. The syntax for writing a join operation is simple but some times what goes on behind the curtain is lost. Internally, for Joins Apache Spark proposes a couple of Algorithms and then chooses one of them. Not knowing what these internal algorithms are, and which one does spark choose might make a simple Join operation expensive.

While opting for a Join Algorithm, Spark looks at the size of the data frames involved. It considers the Join type and condition specified, and hint (if any) to finally decide upon the algorithm to use. In most of the cases, Sort Merge join and Shuffle Hash join are the two major power horses that drive the Spark SQL joins. But if spark finds the size of one of the data frames less than a certain threshold, Spark puts up Broadcast Join as it’s top contender.

Broadcast Hash Join

Looking at the Physical plan of a Join operation, a Broadcast Hash Join in Spark looks like this

Joins in Apache Spark: Broadcast Join

The above plan shows that the data frame from one of the branches broadcasts to every node containing the other data frame. In each node, Spark then performs the final Join operation. This is Spark’s per-node communication strategy.

Spark uses the Broadcast Hash Join when one of the data frame’s size is less than the threshold set in spark.sql.autoBroadcastJoinThreshold. It’s default value is 10 Mb, but can be changed using the following code

spark.conf.set("spark.sql.autoBroadcastJoinThreshold", 100 * 1024 * 1024)

This algorithm has the advantage that the other side of the join doesn’t require any shuffle. If this other side is very large, not doing the shuffle will bring notable speed-up as compared to other algorithms that would have to do the shuffle.

Broadcasting large datasets can also lead to timeout errors. A configuration spark.sql.broadcastTimeout sets the maximum time that a broadcast operation should take, past which the operation fails. The default timeout value is 5 minutes, but it can be set as follows:

spark.conf.set("spark.sql.broadcastTimeout", time_in_sec)

Sort Merge Join

If neither of the data frames can be broadcasted, then Spark resorts to Sort Merge Join. This algorithm uses the node-node communication strategy, where Spark shuffles the data across the cluster.

Sort Merge Join requires both sides of the join to have correct partitioning and order. Generally, this is ensured by** shuffle and sort** in both branches of the join as depicted below

#apache spark #scala #tech blogs #broadcast join #join opertaions #join optimization #joins in spark #shuffled hash join #sort merge join