loading...
DotNek app development
DotNek بازدید : 133 چهارشنبه 19 خرداد 1400 نظرات (0)

Web owners are always trying to improve the quality of content on the web and in order to achieve this goal, they take various measures and use all available facilities, to draw graphics on web pages, you can use the Canvas element, which we are going to explain to you in this regard, so that we can learn the ways to implement important things together, such as adding shadows, text, and so on.

Canvas Rectangle, Shadow, Path and Text training in HTML

What is HTML Canvas?

This element is used to draw graphics, and the important point is that, in order to do this, scripting is required, which is usually used in JavaScript and you can apply the graphics through it, finally, with the help of this element, text, shadows, paths, etc., can be added to the images, if you want to make them more attractive to different users.

This element is one of the most attractive features in HTML5 , and it should be noted that almost all browsers today support Canvas, and through it, you can draw graphics using JavaScript while running (On The Fly).

Canvas Rectangle:

This method is used in order to draw a rectangle which has various parameters that we are going to mention in the following.

Available parameters:

- width:

This parameter represents the width of the rectangle which is in pixels.

- Height:

As you know, in addition to the width of the rectangle, it also has a length, which determines the height of the rectangle, and it is also in pixels.

- x:

By using this parameter, you can specify the coordinates that the upper-left corner of the rectangle should have and determine where the rectangle should start from.

- y:

This parameter also specifies the coordinates of the upper-left corner, so with these 4 parameters, a rectangle can be drawn.

Another point that should be mentioned is that you can also specify the color of the rectangle by using the command ctx.strokeStyle, which we are going to show you an example of coding in order to draw a rectangle with the help of JavaScript .

For example, suppose you want to draw a blue rectangle with line width 6, length 250, width 150 and at 5&5 point, you need to do the following with JavaScript.

// Blue rectangle

ctx.beginPath ();

ctx.lineWidth = "6";

ctx.strokeStyle = "Blue";

ctx.rect (5, 5, 250, 150);

ctx.stroke ();

After doing this, you can easily draw a rectangle and use it in order to make your content more attractive.

Now imagine that you want to draw a slightly smaller green rectangle inside this blue rectangle, if you want to do this, you have to do the following.

// Green rectangle

ctx.beginPath ();

ctx.lineWidth = "4";

ctx.strokeStyle = "green";

ctx.rect (30, 30, 70, 50);

ctx.stroke ();

All the things mentioned above is usually done with the help of JavaScript, so in the following we are going to introduce this language to you.

What is JavaScript?

There are different programming languages, one of which is JavaScript, it is a kind of language which different programmers can use in order to implement various features in web pages, another use of it, is in the development of various games , finally all of these enable the user to get a better user experience from using pages and games.

Canvas Rectangle, Shadow, Path and Text training in HTML

Shadows:

Everyone's effort is to be able to convey a better feeling to the user that in HTML5 canvas you can make images, text, even a line more realistic with the help of shadows, in other words, with the help of shadows, everything can be made 3D, the shadows that are created can have the following properties:

- shadowOffsetX () Property:

This is one of the properties of the shadow which is zero by default, and with help of which you can specify the horizontal distance of the shadow from the shape, it should be also noted that in order to change the position of the shadow, you can use positive or negative values.

The way of doing this is as follows:

ctx.shadowOffsetX = h_distance;

- shadowOffsetY () Property:

This is another property for adding shadow, which is used to adjust the vertical distance of the shadow from the shape, and just like the previous case, it is zero by default, and with the help of positive and negative values, you can determine its position.

In order to do this, you must do the following:

ctx.shadowOffsetX = v_distance;

- shadowBlur () Property:

Another feature for shadows is the amount of blurring that can be adjusted, which you must be done as follows.

ctx.shadowBlur = blur_value

- shadowColor () Property:

Shadows can have different color spectrums which can be adjusted this way: ctx.shadowColor

For example, suppose you want to create several rectangles with the same size which have shadows with different colors in relation to each other, to do this, you can do the following.

<! DOCTYPE html>

<html>

<head> <title> HTML5 Canvas - shadow </title>

</head>

<body>

<canvas id = "DemoCanvas" width = "500" height = "600"> </canvas>

<script>

var canvas = document.getElementById ("DemoCanvas");

if (canvas.getContext)

{

var ctx = canvas.getContext ('2d');

ctx.shadowColor = "black";

ctx.shadowBlur = 6;

ctx.shadowOffsetX = 6;

ctx.shadowOffsetY = 6;

ctx.shadowColor = "orange";

ctx.strokeRect (25, 25, 300, 200);

ctx.shadowColor = "green";

ctx.strokeRect (50, 50, 300, 200);

ctx.shadowColor = "blue";

ctx.strokeRect (75, 75, 300, 200);

ctx.shadowColor = "red";

ctx.strokeRect (100, 100, 300, 200);

}

</script>

</body>

</html>

In addition to adding a shadow feature to a rectangle or any other shape, you can also add shadows to a text, if you want to make it more attractive to the user.

Path:

In HTML5 canvas, it is possible for you to create custom shapes, for example, imagine that you are going to start drawing a path, first, you need to start from beginPath () and finally draw the path you want, then you need to use the fill () or stroke () methods to create a suitable shape for the user, in the last step you can execute the command of a new path with closePath (), for example imagine that you want to draw a yellow triangle, to do this you have to do the following.

<! DOCTYPE html>

<html>

<head>

<title> Sample arcs example </title>

</head>

<body>

<canvas id = "DemoCanvas" width = "300" height = "600"> </canvas>

<script>

var canvas = document.getElementById ("DemoCanvas");

var context = canvas.getContext ("2d");

// Set the style properties.

context.fillStyle = 'yellow';

context.strokeStyle = 'red';

context.lineWidth = 2;

context.beginPath ();

// Start from the top-left point.

context.moveTo (20, 20); // give the (x, y) coordinates

context.lineTo (190, 20);

context.lineTo (20, 190);

context.lineTo (20, 20);

// Now fill the shape, and draw the stroke.

context.fill ();

context.stroke ();

context.closePath ();

</script>

</body>

</html>

If you want to draw any other path, you can do the same, which may only differ in characteristics, for instance, color, starting point, end point, number of paths, and so on.

Text:

One of the other things that you can do with the help of this version is drawing text, which also has different properties, such as drawing a map, drawing a rectangle, etc., the text may be italics, bold, normal and so on, also the font size and other features may differ from each other, in general, among the characteristics of the texts, the following can be mentioned.

-text:

To draw text on canvas, you can use the string type and draw it.

- x:

To draw text, you must specify what horizontal coordinates you want to draw with the canvas.

- y:

Like drawing all items, you need vertical coordinates for canvas to draw text in addition to horizontal coordinates.

- maxWidth:

Another feature that different texts can have is the maximum text width.

In general, different texts can be drawn, and also different methods can be used to draw each one, which we will mention an example of drawing text with the fillText () method in the following.

If you want to draw the text 'Canvas Rectangle, Shadow, Path' in a simple way, you can do it by coding which is mentioned below.

<! DOCTYPE html>

<html>

<head>

<title> HTML5 Canvas - Text </title>

</head>

<body>

<canvas id = "DemoCanvas" width = "500" height = "600"> </canvas>

<script>

var canvas = document.getElementById ("DemoCanvas");

if (canvas.getContext)

{

var ctx = canvas.getContext ('2d');

ctx.font = 'italic 32px sans-serif';

ctx.fillText ('Canvas Rectangle, Shadow, Path', 10, 50);

}

</script>

</body>

</html>

Canvas Rectangle, Shadow, Path and Text training in HTML

Last word:

In general, HTML Canvas can be used to draw various items that ultimately cause users to get a better user experience by viewing them, in this article, we have mentioned drawing items, so that it can give you an idea about making your site attractive, as a result, you can increase the traffic to your website with these simple tasks.

DotNek بازدید : 791 چهارشنبه 19 خرداد 1400 نظرات (0)

While the initial segment of each test is amazingly critical, it is simply a large portion of the battle, the planning, and the execution. How the information is taken care of is similarly fundamental, and it can prompt inventive outcomes and perceptions to perform great information in the right way.

The most startling piece of performing research is constantly utilized as information preparation. However, it doesn't need to be that way. Although you should realize how to manage the information and how to break down the information, factual examination programming can make this assignment as smooth and direct as could be expected. Help Writing  research papers is one of the most difficult aspects of academic study. As a result, students begin looking for help in order to write the best research paper possible.To lead factual information investigation and exploration, an immense scope of insights devices are accessible, and underneath we list the seven best measurement apparatuses for examination and information examination.

Ultimate Guide Statistics Tools For Data Analysis And Research

Best measurements Tools For Data Analysis and Research

There are various sorts of factual apparatuses accessible for your exploration and information examination accessible on the web. You need to check everything before picking the best one for you. Beneath, we have recorded the best seven apparatuses for information investigation and examination:

SPSS

SPSS, often known as the Statistical Package for the Social Sciences, is possibly the most widely used measuring software in human behaviour research. Factual Package for the Social Sciences gives the ability to rapidly incorporate authoritative measurements, parametric and nonparametric examinations, and graphical portrayals of results in the graphical UI (GUI). It also includes deciding to make content to mechanize investigation or to take out more prevalent measurable handling. The SPSS programming bundle was made for the administration and factual examination of social information. It was first distributed by SPSS Inc. in 1968 and then acquired by IBM in 2009. Economic analysts utilize SPSS, wellbeing scientists, study organizations, government substances, schooling specialists, showcasing associations, information diggers, and many more for handling and investigating study information. For example, you gather with an online review stage like Alchemy.

SAS(Statistical Analysis Software)

SAS is an apparatus for a measurable investigation that allows utilizing the GUI or producing more modern examinations. It is a top-notch approach that is generally utilized to examine an industry, medical care, and human instinct. Progressed investigation can be completed, and distribution commendable outlines and diagrams can be made, albeit the coding can likewise be a difficult change for those not familiar with this technique. SAS is utilized:

A tremendous cluster of factual techniques and calculations, particularly for cutting edge measurements,

Profoundly adjustable examination choices and yield alternatives.

Distribution quality illustrations with ODS.

They are broadly utilized in numerous fields, including business and medication.

Huge, dynamic online local area.

Ultimate Guide Statistics Tools For Data Analysis And Research

R

R is a free bundle of measurable programming usually utilized in investigations on human conduct and in different regions. For many uses, tool stash (fundamental modules) are accessible, improving on various parts of information preparation. While R is a good tool, it has a high expectation for absorbing information and requires a certain level of coding.Nonetheless, it accompanies a functioning gathering associated with building and improving R and the applicable modules, which implies that help is rarely excessively far away. R can be thought of as a different way of executing S. There are some notable differences. However, a lot of code written for S works fine in R. One of R's qualities is the simplicity with which very much planned distribution quality plots can be delivered, including numerical images and formulae where required. Extraordinary consideration has been assumed control over the defaults for the minor plan decisions in designs, yet the client holds full control.

Microsoft Excel

Albeit not a front-line factual investigation arrangement, Microsoft Excel gives a ton of information representation and essential examination instruments. Outline diagrams and tweaked illustrations and insights are not difficult to deliver, making it a useful stage for the individuals who need to see the essentials of their information. It also settles an open decision for those needing to begin with numbers since numerous individuals endeavor the same owner and skill to utilize Excel. The primary employments of Excel incorporate; Data Entry, Data Management, Accounting, Financial investigation, Charting and Graphing, Programming, Time Management, Task the executives, monetary displaying, Customer relationship the board (CRM), Almost anything that should be coordinated!

Matlab

Matlab is a programming language and scientific instrument that architects and researchers use broadly. Likewise, the learning way is long, likewise with R, and you will be relied upon at some stage to construct your code. There are likewise many tool compartments accessible to respond to your testing questions (like EEGLab for investigating EEG information). Even though it tends to be trying for newbies to utilize MatLab, it gives an enormous measure of adaptability as far as what you'd prefer to do, as long as you can code it.

Minitab

The Minitab programming gives various measurable apparatuses for information handling that are both straightforward and genuinely modern. Orders can be acted in both the Interface and customized orders, practically identical to GraphPad Prism, making it open to novices just as clients hoping to accomplish more convoluted investigation.

Graphpad Prism

GraphPad Prism combines logical diagramming, complete bend fitting (nonlinear relapse), reasonable insights, and information association in one application. While it won't be able to replace a comprehensive measuring tool, Prism can let you execute basic factual tests commonly used by lab and clinical analysts. T-tests, nonparametric tests, one-, two-, and three-way ANOVA, analysis of possibility tables, and endurance investigation are all available in Crystal. The results of the investigation are presented in plain terms, free of unnecessary quantifiable terminology. GraphPad Prism is progressing programming mostly utilized in science-related measurements, even though it has an assortment of highlights that can be utilized in various fields. Identified with SPSS, prearranging options can improve on computations or accomplish more convoluted measurable estimations. However, it is feasible to complete the remainder of the work through the GUI. 

Ultimate Guide Statistics Tools For Data Analysis And Research

End

Various insights programming apparatuses are accessible. Each gives something quietly not the same as the client, in light of different factors, including the investigation question, numerical abilities, and coding abilities. In any case, we have talked about a portion of the seven best insights apparatuses for exploration and information investigation.

These factors could imply that you are at the bleeding edge of information examination, yet the exactness of the information gathered relies upon the nature of the report's execution, likewise with any exploration. In this way, it is important to take note of that while you may have complex insights apparatuses (and the ability to utilize them) advantageous to you, the information would not mean a lot on the off chance that they are not truly.

DotNek بازدید : 136 چهارشنبه 19 خرداد 1400 نظرات (0)

so that they can be opened from the bottom of the page to the top of the page and show the required information to users, and Bottom Sheets , including components Material Design are on Android. They have two different types, one Persistent Bottom Sheet and Modal Bottom Sheet (modal bottom sheets android), both of which are used to display information to users, and the way to access them is by dragging them from the bottom of the page and then the item information We see the needs and details. It should be noted that these can be used in applications such as Google Maps and Google Drive. Google Drive and 

6- Define and create a simple Bottom Sheet. Like the following:

<? xml version = "1.0" encoding = "utf-8"?>
<android. support.design. widget. CoordinatorLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
xmlns: app = "http://schemas.android.com/apk/res-auto"
tools: context = ". MainActivity">

<LinearLayout
android: layout_width = "match_parent"
android: layout_height = "200dp"
android: orientation = "vertical"
android: background = "# 009688"
android: padding = "8dp"
app: layout_behavior = "android. support.design. widget. BottomSheetBehavior">

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# ffffff"
android: textSize = "20sp"
android: textStyle = "bold"
android: text = "Bottom Sheet Title" />

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# ffffff"
android: textSize = "16sp"
android: text = "Lorem ipsum dolor sit amet, te sed vide delicata,
per ex salutandi intellegat temporibus, ei insolens molestiae vis.
Eum ei possim aperiam, fuisset suscipit vim ut. Voluptua repudiare
gubergren id eum, nullam labores an nam. Sed et tota quae referendum,
enim elit democritum quo et.
Lorem ipsum dolor sit amet, te sed vide delicata,
per ex salutandi intellegat temporibus, ei insolens molestiae vis.
Eum ei possim aperiam, fuisset suscipit vim ut. Voluptua repudiare
gubergren id eum, nullam labores an nam. Sed et tota quae referendum,
enim elit dem ocritum quo et. "/>

</LinearLayout>

</android. support.design. widget. CoordinatorLayout>

In the code above, we add a LinearLayout to the layout that has two TextViews. Note that we must define LinearLayout as a Bottom Sheet. Like the following:

app: layout_behavior = "android. support.design. widget. BottomSheetBehavior"

By inserting the above code and adding a layout to it, we will cause Android to consider it as a Bottom Sheet. The value of this property can be defined as follows:

app: layout_behavior = "@ string / bottom_sheet_behavior"

Then, hold down the Ctrl key on the keyboard and click on the value entered above. This will connect to the values.xml file that is linked to the design library.

7- We run the project. After running the program, we will see that a bar with a background color of 200dp will appear at the bottom of the screen.

8- It should be noted that the content of this bar has two TextViews.

9- This bar that we have created is currently fixed and does not change by dragging down or up.

10- In order to be able to adjust it so that it changes by dragging down or up, we must add the property listed below to  is used to show the contents.

For example, we can say that the user selects a place on the map in Google Map and by dragging the bar upwards he can see the information and details about it, and if he presses the MORE INFO button, he can even see the contents related to it. Slowly

1- We create a new project in Android Studio and choose its name as desired. The name chosen in this tutorial is PersistentBottomSheet.

2- In this project, we create an Empty Activity.

3- We also add the design library to this section.

4- In this project, unlike the previous project, we want it to be opened and closed by clicking on the Bottom Sheet button.

5- The codes that should be in the activity_main.xml section are as follows:

<? xml version = "1.0" encoding = "utf-8"?>
<android. support.design. widget. CoordinatorLayout
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
tools: context = ". MainActivity">

<RelativeLayout
android: layout_width = "match_parent"
android: layout_height = "match_parent">

<Button
android: id = "@ + id / btn_expand"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_centerInParent = "true"
android: text = "Expand" />

</RelativeLayout>

</android. support.design. widget. CoordinatorLayout>

What is the function of Bottom Sheets in Android and what are they used for?

In the code above, because the CoordinatorLayout does not have the power and ability to manage the layout, we put the button in RelativeLayout.

6- Add a Bottom Sheet to the layout.

<LinearLayout
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"
android: id = "@ + id / bottom sheet"
android: background = "# 94aab4"
android: padding = "8dp"
app: behavior_hideable = "true"
app: behavior_peekHeight = "60dp"
app: layout_behavior = "@ string / bottom_sheet_behavior">

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 000000"
android: textSize = "20sp"
android: text = "Location: Austria "
android: paddingbottom = "10dp"
android: paddingtop = "10dp" />

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 452f2f"
android: textSize = "16sp"
android: text = " Austria initially emerged as a margraviate around 976 and developed into a duchy and archduchy. In the 16th century, Austria started serving as the heart of the Habsburg Monarchy and the junior branch of the House of Habsburg – one of the most influential royal dynasties in history. As an archduchy, it was a major component and administrative center of the Holy Roman Empire. Early in the 19th century, Austria established its own empire, which became a great power and the leading force of the German Confederation, but pursued its own course independently of the other German states following its defeat in the Austro-Prussian War in 1866. In 1867, in compromise with Hungary, the Austria-Hungary Dual Monarchy was established. "/>
</LinearLayout>

In the code above, we used wrap_content to specify the size and height of the bar, which causes the bar to be so high that the content is there. In other words, it can be said that the height of this bar will be equal to the content that is inside it. In this section, we did not specify a height for the bar.

7- Create a new layout with the desired name, for example bottom_sheet.xml, and put the code inserted below it.

<? xml version = "1.0" encoding = "utf-8"?>
<LinearLayout
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: app = "http://schemas.android.com/apk/res-auto"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"
android: id = "@ + id / bottom sheet"
android: background = "# 94aab4"
android: padding = "8dp"
app: behavior_hideable = "true"
app: behavior_peekHeight = "60dp"
app: layout_behavior = "@ string / bottom_sheet_behavior">

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 000000"
android: textSize = "20sp"
android: text = "Location: Austria "
android: paddingbottom = "10dp"
android: paddingtop = "10dp" />

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 452f2f"
android: textSize = "16sp"
android: text = " Austria initially emerged as a margraviate around 976 and developed into a duchy and archduchy. In the 16th century, Austria started serving as the heart of the Habsburg Monarchy and the junior branch of the House of Habsburg – one of the most influential royal dynasties in history. As an archduchy, it was a major component and administrative center of the Holy Roman Empire. Early in the 19th century, Austria established its own empire, which became a great power and the leading force of the German Confederation, but pursued its own course independently of the other German states following its defeat in the Austro-Prussian War in 1866. In 1867, in compromise with Hungary, the Austria-Hungary Dual Monarchy was established. "/>

</LinearLayout>

8- The complete and final codes that should be in the activity_main.xml section are as follows:

<? xml version = "1.0" encoding = "utf-8"?>
<android. support.design. widget. CoordinatorLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
tools: context = ". MainActivity">

<RelativeLayout
android: layout_width = "match_parent"
android: layout_height = "match_parent">

<Button
android: id = "@ + id / btn_expand"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_centerInParent = "true"
android: text = "Expand" />

</RelativeLayout>

<include layout = "@ layout / bottom sheet" />

</android. support.design. widget. CoordinatorLayout>

9- After applying the changes, if we run the project, we will see that the tape will open at 60dp first, and if we then drag it upwards, its size will be larger.

10- In this section, we have to make changes and adjustments so that this opening of the page is done by the button.

11- We complete the activity as follows:

import android. support.design. widget. BottomSheetBehavior;
import android.support.v7.app.AppCompatActivity;
import android.os. Bundle;
import android. view. View;
import android. widget. Button;
import Android.Widget. LinearLayout;

public class MainActivity extends AppCompatActivity {

Button banshee;
LinearLayout sheet Layout;
BottomSheetBehavior bottom Sheet;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

banshee = findViewById (R.id.btn_expand);
sheet Layout = findViewById (R.id. bottom sheet);
bottom Sheet = BottomSheetBehavior. From (sheet Layout);

btnPhoto.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (View view) {

bottomSheet.setState (BottomSheetBehavior.STATE_EXPANDED);

}
});

}
}

In the code above, we define a Button and LinearLayout that belong to Bottom Sheet. Then we create an example of the BottomSheetBehavior method with the desired name bottom Sheet.

Then we create a Listener for the button. To be able to set the Bottom Sheet mode, we use the set State () method.

In the code above, we have selected STATE_EXPANDED, but by selecting it, we can make it open by touching the status bar button.

12- We will implement the project.

13- After the implementation of the project, we will see that the operation is done correctly and the settings that we have provided have been successful.

14- Then, we have to make changes that are hidden by touching the bar button. Like the following:

btnPhoto.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (View view) {

if (bottomSheet.setState () == BottomSheetBehavior.STATE_COLLAPSED) {

bottomSheet.setState (BottomSheetBehavior.STATE_EXPANDED);

}
else if (bottom Sheet. getState () == BottomSheetBehavior.STATE_EXPANDED) {

bottomSheet.setState (BottomSheetBehavior.STATE_COLLAPSED);

}

}
});

In the code above, using the if else and the getState () method, we set a condition that will check that if the bar is collapsed, its status will change to Expanded by touching the button.

15- Use the setText () method and modify the condition, as follows:

btnPhoto.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (View view) {

if (bottomSheet.setState () == BottomSheetBehavior.STATE_COLLAPSED) {

bottomSheet.setState (BottomSheetBehavior.STATE_EXPANDED);
btnSheet.setText ("Collapse");

}
else if (bottomSheet.setState () == BottomSheetBehavior.STATE_EXPANDED) {

bottomSheet.setState (BottomSheetBehavior.STATE_COLLAPSED);
btnSheet.setText ("Expand");

}

}
});

What is the function of Bottom Sheets in Android and what are they used for?

16- If we run the project after making all the changes, we will see that everything is successful.

17- There is only one problem and that is that if we move the bar down or up using the button, the text of the button will also change, but if we move it up or down by hand, there is no change in text will not be done and we have to fix this problem and apply the relevant settings.

18- We use the setBottomSheetCallback method, which can manage the Bottom Sheet.

bottomSheet.setBottomSheetCallback (new BottomSheetBehavior.BottomSheetCallback () {
@Override
public void onTextChanged (@NonNull View bottom Sheet, int new State) {

}

@Override
public void on Slide (@NonNull View bottom Sheet, float slide Offset) {

}
});

19- It should be noted that this method has two functions. One onTextChanged and on Slide.

 20- In this section, we use the first function to solve the problem.

public void onTextChanged (@NonNull View bottom Sheet, int new State) {

if (new State == BottomSheetBehavior.STATE_EXPANDED) {
btnSheet.setText ("Collapse");
} else if (new State == BottomSheetBehavior.STATE_COLLAPSED) {
btnSheet.setText ("Expand");
}

}

21- The complete and final code that should be in the MainActivity.java section is as follows:

import android. support. annotation. Nonnull;
import android. support.design. widget. BottomSheetBehavior;
import android.support.v7.app.AppCompatActivity;
import android.os. Bundle;
import android. view. View;
import android. widget. Button;
import Android.Widget. LinearLayout;

public class MainActivity extends AppCompatActivity {

Button btnSheet;
LinearLayout sheet Layout;
BottomSheetBehavior bottom Sheet;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

btnSheet = findViewById (R.id.btn_expand);
sheet Layout = findViewById (R.id. bottom sheet);
bottom Sheet = BottomSheetBehavior. From (sheet Layout);

btnPhoto.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (View view) {

if (bottomSheet.setState () == BottomSheetBehavior.STATE_COLLAPSED) {

bottomSheet.setState (BottomSheetBehavior.STATE_EXPANDED);
//btnSheet.setText("Collapse ");

}
else if (bottomSheet.setState () == BottomSheetBehavior.STATE_EXPANDED) {

bottomSheet.setState (BottomSheetBehavior.STATE_COLLAPSED);
//btnSheet.setText("Expand ");

}

}
});

bottomSheet.setBottomSheetCallback (new BottomSheetBehavior.BottomSheetCallback () {
@Override
public void onTextChanged (@NonNull View bottom Sheet, int new State) {

if (new State == BottomSheetBehavior.STATE_EXPANDED) {
btnSheet.setText ("Collapse");
} else if (new State == BottomSheetBehavior.STATE_COLLAPSED) {
btnSheet.setText ("Expand");
}

}

@Override
public void on Slide (@NonNull View bottom Sheet, float slide Offset) {

}
});

}
}

Modal Bottom Sheet

In this section, we also display a Dialog as a Bottom Sheet. Like Google Drive.

It should be noted that Modal is used to display options such as Upload, Copy and Share or even other options.

1- We create a new project in Android Studio and select its name as desired, and the name selected in this section for this project is ModalBottomSheet.

2- After creating the project and performing the next steps, we must create an Empty Activity.

3- Like previous projects, we add the Support Design library to the project.

4- The codes that should be in the activity_main.xml section are as follows:

<? xml version = "1.0" encoding g = "utf-8"?>
<android. support.design. widget. CoordinatorLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
tools: context = ". MainActivity">

<RelativeLayout
android: layout_width = "match_parent"
android: layout_height = "match_parent">

<Button
android: id = "@ + id / btn_expand"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_centerInParent = "true"
android: text = "Expand" />

</RelativeLayout>

</android. support.design. widget. CoordinatorLayout>

5- Create a fragment to display the Bottom Sheet in the form of a Dialog.

6- After creating the fragment, we have to change its inheritance, that is, change it from Fragment to BottomSheetDialogFragment.

7- The code that should be in the BottomSheetFragment.java section is as follows:

import android.os. Bundle;
import android. support.design. widget. BottomSheetDialogFragment;
import android. view. LayoutInflater;
import android. view. View;
import android. view. ViewGroups;


public class BottomSheetFragment extends BottomSheetDialogFragment {


public BottomSheetFragment () {
// Required empty public constructor
}


@Override
public View onCreateView (LayoutInflater inflater, ViewGroups container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater. inflate (R. layout. fragment_bottom_sheet, container, false);
}

}

8- Then we have to complete the layout of this fragment.

9- It is worth mentioning that we use the content that was created in the previous project for bottom_sheet.xml in this project as well.

10- The codes that should be in the fragment_bottom_sheet.xml section are as follows:

<? xml version = "1.0" encoding = "utf-8"?>
<LinearLayout
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: app = "http://schemas.android.com/apk/res-auto"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"
android: id = "@ + id / bottom sheet"
android: background = "# 94aab4"
android: padding = "8dp"
app: behavior_hideable = "true"
app: behavior_peekHeight = "60dp"
app: layout_behavior = "@ string / bottom_sheet_behavior">

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 000000"
android: textSize = "20sp"
android: text = "Location: Austria "
android: paddingbottom = "10dp"
android: paddingtop = "10dp" />

<TextView
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: textColor = "# 452f2f"
android: textSize = "16sp"
android: text = " Austria initially emerged as a margraviate around 976 and developed into a duchy and archduchy. In the 16th century, Austria started serving as the heart of the Habsburg Monarchy and the junior branch of the House of Habsburg – one of the most influential royal dynasties in history. As an archduchy, it was a major component and administrative Centre of the Holy Roman Empire. Early in the 19th century, Austria established its own empire, which became a great power and the leading force of the German Confederation, but pursued its own course independently of the other German states following its defeat in the Austro-Prussian War in 1866. In 1867, in compromise with Hungary, the Austria-Hungary Dual Monarchy was established. "/>

</LinearLayout>

11- Then we have to write a Listener for the Expand button.

12- We will implement the project.

import android.support.v7.app.AppCompatActivity;
import android.os. Bundle;
import android. view. View;
import android. widget. Button;

public class MainActivity extends AppCompatActivity {

Button btnSheet;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

btnSheet = findViewById (R.id.btn_expand);

btnPhoto.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (View view) {

BottomSheetFragment bottom Fragment = new BottomSheetFragment ();
bottomFragment.show (getSupportFragmentManager (), bottomFragment.getTag ());

}
});

}
}

What is the function of Bottom Sheets in Android and what are they used for?

13- We will see that like AlertDialog, this bar has elevation.

14- It is removed by pressing the back button or dragging it down.

15- We complete it as follows:

DotNek بازدید : 126 چهارشنبه 19 خرداد 1400 نظرات (0)

One of these features is that this chair usually has a long back that it helps the gamers to keep their back in a good situation and save them from back ache.

What are the characteristics of a suitable chair for playing?

The Importance of gaming Chairs:  

Gaming chairs may seem unfamiliar to the general public, but they are becoming an essential accessory for game fans . Characteristics of gaming chairs differ them from other types of chair. Gamers usually sit on the game chair for a long time. A professional gamer may sit in a chair for about 10 hours a day. Therefore, having a comfortable and standard chair in which the principles of ergonomics are well observed; it's too important. The chair should be adjustable so that the person can easily sit in a comfortable position relative to his computer.Characteristics of gaming chairs allow the gamer to fully enjoy the game.A chair has certain parts, each of which must have characteristics in order to be accepted as a good chair.

Comparing a play chair with an office chair:

a gaming chair , the back of the chair is long and extends to the head. In addition, the back and seat of the chair are serrated and keep the body firm and stable. There is no holding position in a normal chair and it can be said that it is difficult to sit properly on it for a long time.Another difference between game chairs and office chairs is in their design and color. Game seat designers try to use colorful designs to make these seats look like a sports car. This chair may be pink or bright red. Of course, these chairs have a good variety of colors and game enthusiasts can easily match it with their play space. While in other chairs, designs usually do not fall out of the category of public furniture.Also, in game chairs, unlike ordinary chairs, a more durable metal frame is used so that heavy users can use it for a long time without worry. In general, these chairs are wider than ordinary chairs.
In the following articles, the expected features of each part of the seat suitable for the game will be stated.

Seat back: 

One of the characteristics of gaming chairs is the long back of it. Seat back is of particular importance. Because it can help keep the back in a straight and upright position and prevent back pain.The back of the chair should be at a suitable height that can support your pelvis, spine and back well. Also, its slope should be adjustable. Having lumbar cushions and head cushions are useful for optimizing the backrest and helping to sit better. Leaning the head back makes the weight of the head split on the neck, making it easier to look at the monitor while lying down.

What are the characteristics of a suitable chair for playing?

Chair bases: 

Chair bases play a very important role in the quality of the chair. In addition to maintaining the balance of the chair, they are also effective in positioning the person's legs. In some models of gaming chairs, the bases are designed in such a way that they place the legs in a higher position and create a relaxed state for the person. These chairs are ideal for playing video games in front of the TV and when playing with the computer.

Seat handles:

The importance of chair handles is due to the fact that in case of any defect in the chair handle, it may cause the feeling of pain in the wrist, arm or elbow area.The difference between the handles of a gaming chair and an office chair is in their movability. In a gaming chair, the handle of the chair is movable and it can be moved in different directions. The ideal chair handle should be such that the person can place his arms in parallel or on the table after sitting on the chair. It should also help keep the elbows close to the body and form a right angle. The wrist should also be as aligned with the elbow as possible. The height of the arm of the chair should be easily adjustable. In the best possible case, the arm of the chair should have a three-dimensional position and the height, depth and width of the arm should be easily adjusted.Another important point about the arm of the seat is the presence of suitable cushions on it so that it provides comfort to the gamer's hands.

Chair seat: 

It is one of the most important parts of the chair that can be examined from different perspectives. First of all, the size of the chair should be large enough for the person to sit comfortably in. The ideal size is such that after sitting down and placing your feet on the ground, there is as much space as four fingers between the knees.The seat of the chair should be soft enough so that it does not cause any problems for the person after sitting for a long time. Also, very good sponges should be used in this part so that it does not lose its shape by bearing the weight of the gamer for a long time and has good durability.

Price of game chairs:

Gaming chairs are expensive due to their special capabilities. In some models, features such as a massager have been added, the price has increased. But do not worry, there are also student game chairs and game chairs with more limited features that are less expensive.

Game chair material:

One of the most important things when buying a game chair is to pay attention to its material. As mentioned in the previous sections, the playing chair is usually used for long hours. Therefore, it is important that the material is such that it minimizes sweating and is easy to clean.The materials used in the game chairs can be divided into two groups: fabric and synthetic leather. In fabric samples, air conditioning is better and they have good durability; but in this group, the seat is more likely to get dirty and stains are usually visible. Synthetic leathers have a special beauty and are resistant to stains because they repel water. In leather game chairs, the air does not flow well and it is not very easy to use them in hot seasons such as summer.

What are the characteristics of a suitable chair for playing?

Seat angle: 

There are many models of gaming chairs that have a "lying down function" that allows you to relax a little by changing the angle of your backrest. The longer the lying angle, the easier you can relax. One of the best positions for professional gamers is the perfectly flat mode, which supports up to 180 degrees. You can adjust the angle so that the seat is parallel to the ground, so you can lie down while playing or downloading a game . Or you can even take a nap in your spare time before starting an in-game event. 

DotNek بازدید : 124 چهارشنبه 19 خرداد 1400 نظرات (0)

If important data is corrupted, it can cause irreparable damage to individuals as well as institutions, so it is necessary to protect them from being damaged, in the field of data protection , in fact, there is a need to ensure that if data is lost, you can recover the data again. It is also necessary to provide security and privacy for all your data , in general, data protection is an essential issue, which is why we are going to discuss it in more detail and mention the important points.

What is data protection, and why is it important?

What is data protection?

Data protection is the protection of privacy by regulating the processing of personal information, as well as identifying individuals to protect data by defining their duties and having control over their work.

As we mentioned earlier, data availability in case of a data breach is one of the principles of data protection and another important issue in this field is data management.

Data management itself has two fields including data lifecycle management and information lifecycle management, which we are going to discuss in more detail below.

- Data lifecycle management:

In this field of data management, all important data in a system is in the way of storing it online as well as offline.

- Information lifecycle management:

In this cycle, the information is protected against errors that may occur in the program, such as virus attacks, technical problems in the device, malware , etc., in order not to damage them, new tasks may be added to the management every day, and the ultimate goal is to protect the data in the best possible way.

Which methods were used to protect data in the past?

As you know, when the data is stored, some steps needs to be taken in order to protect it, the best ways for data storage are offline methods, in the past, many organizations, tried offline method in order to store their data through which they copied data to the tape cartridge machine, and they would eventually protect that tape.

Storing data on another computer system is something that you have to be more worried about because your data is more endangered, due to the fact that protecting your data from hacking attack would be much harder, even though having access to the tapes may be a slow process, it is the best method and there won’t be any risk of attacking the network and losing data backup.

As a result, it is generally necessary to back up all data, because as we have mentioned, this is one of the principles of data protection , different properties of data caused the need for more protection, one of them is the ability to being transferred, which we will mention more in the following.

The ability to transfer data:

This feature allows data to be transferred between clients or servers, which ultimately raises concerns about data duplication among data owners.

In the meantime, it is necessary to point out that another method that can be used to back up data is cloud backup, which has become more common these days, and most organizations often transfer their backed up data to public clouds or clouds maintained by backup vendors.

This method is better and simpler than the method which people used for data storage in the past and the ability to access data is also faster.

So far we have made some remarks about data protection , but you need to know which data needs to be protected?

Which data should be protected?

Normally, information such as documents of, transactions which have been made, employee work history, customer information, etc., should be protected, so that hackers and profiteers cannot use this important information in different ways.

As we mentioned above, a step that was taken in order to protect the data, was storing it, which is still one of the methods of data protection, essential data such as important emails, phone numbers, credit card details, documents, etc., are also important documents that need to be stored.

Data storage has rules that must be followed properly during the process, so that you can keep all the necessary data accurate, secure and legal.

Rules to follow while storing backup data:

- Information storage should be done through pre-determined methods.

- All stored data should be stored in a secure environment.

- Data storage time is limited.

- Only limited and specific people have access to data, and it is not possible for everyone in an organization.

- There shouldn’t be the permission of copying the stored data.

- While saving, enable the feature which gives you the opportunity of saving your data automatically, so in case of a hacking attack, it won’t be possible to access the backed up data for profiteers.

- Provide strong passwords for backed up data to protect them properly.

Why is data protection important?

Data protection is important due to various factors, which can be summarized as follows.

- Provide security:

Security is very important and one of the factors that can help you provide security is data protection, in fact, data protection laws ensure that important data, such as the private information of employees, customers, and other data associated with the organization, are properly protected and not made available to profiteers.

Of course, the important point that should be mentioned here is that it is necessary to check all the information you receive from each person to make sure that this information is correct, and then put your time and energy into storing it.

These actions can greatly prevent cybercrime, and ultimately your employees and customers can trust you, in addition, by checking the information of customers, you can also trust your employees and customers, as a result, you can safely provide them with important information.

- Not following data protection tips will cost a fortune:

Imagine that you are the owner of a site which different users give their personal information such as bank card information, username, address, etc., to your website, but you do not care about data protection, in this case, profiteers can have access to all users’ information easily, therefore users have the right to sue you in such circumstances, and the law may impose heavy fines on you, as a result, you should take care of users’ information as good as possible in order to prevent the possible threats from happening.

In addition to the two factors which we have mentioned above, there are other things that can be mentioned in order to emphasize the importance of data protection , but these two were the ones that should be taken into consideration more than the others.

Differences between data protection, security and privacy:

Each of these three has a huge world, but some individuals and institutions equate the terms data protection, data security, and data privacy and use them interchangeably, so it is necessary to give a brief explanation of their differences, simply put, data protection can be expressed as backing up and recovering information in order to prevent data loss. Data security is also a set of measures that should be taken in order to protect information and systems in the best possible way against various manipulations as well as the entry of malware.

Privacy is also the right of each user, institution, etc., to determine a limitation for other people in having access to their information and the time when they prefer to share this information with them, it is easy to conclude that if hackers invade the privacy of institutions and individuals, the law will severely punish them.

What is data protection?

Last word:

In general, data protection is an important issue and its importance is increasing day by day, in this article we have explained one of the reasons for this to you, so that if you have not thought about the ways to protect your data to date, now you know the necessary steps that should be taken in order to protect them, as a result you should take action immediately because if you don’t, your information would be stolen and abused.

DotNek بازدید : 128 چهارشنبه 19 خرداد 1400 نظرات (0)

Privacy and security are a widespread topic for people around the world and in order to reach each one, many points need to be considered, there are many reports of security and privacy breaches on a daily basis, and many users fall into the trap of those who violate security and privacy, in this article, we are going to discuss whether it is possible to achieve security without privacy or not.

Is it possible to have security without privacy?

Is it possible to have security without privacy?

We will first answer this question and then define security and privacy separately, the answer is yes, you can have security without privacy, but the important point is that you can’t have privacy without security.

What is security?

When we heard of the word security , the first thing that comes to our mind is the protection of important items and information against theft through different ways like passwords, physical locks, and so on, simply put, security is a technical method which is used to protect data, due to the increasing number of science and technology, more security is required in order to protect the data in computers and systems.

One of the most important types of security is cyber security , which has different layers and components, each of which we are going to discuss in the following briefly, in order for cyber security to be fully established, it is necessary to pay attention to its 7 layers and the points which should be taken into consideration referring to them.

All users who are somehow connected to the internet and computer systems also risk their data every time they connect to the internet, so it is necessary to establish full security, so that profiteers cannot gain access to this information, if the security and its tips are not established properly, users may incur heavy costs, so it is better to think seriously about security from the beginning and follow the tips carefully.

One of the most common threats in cyberspace is phishing attacks , in which hackers use spam emails and social engineering methods in order to access the data of various people.

7 layers of security:

- Information security policies:

- Protect and backup data:

This layer regularly backs up data to ensure that the user has a complete copy of their data in a safe place.

- Monitor and test your systems:

This layer is one of the most important security layers available, and to implement the tips of this layer better, you can use the tools to scan the entire system correctly and accurately.

Apart from the security of these layers, there are also threats against them which we are going to mention in the following.

Security threats include:

- Application layer threats

- Presentation layer threats

- Session layer threats

- Transport layer threats

- Network layer threats

Generally, in order to increase security , the following should be considered:

Tips to increase security:

-Use strong passwords

-Do not publish your private and important information online

-Do not connect to public Wi-Fi in public places as much as possible.

-Update programs on your system regularly

-Install strong antivirus

-Do not open attractive and deceptive emails in any way

-Do not click on any kind of link

                             

What is privacy?

Privacy includes laws and regulations that cause companies to protect your data and it is so important, also it should be noted that privacy has existed since ancient times, and people are obliged to protect each other's privacy.

Privacy can be properly maintained only if the necessary points of security is being considered completely, because as we mentioned before, privacy cannot be achieved without security, in fact, privacy gives people the right to share their desired information with others whenever they like, and people are not allowed to invade someone’s privacy without their permission.

Today, due to the existence of the rules and regulations, individuals can greatly protect their privacy and prevent various users from controlling or manipulating their information easily, and change them depending on their goals.

Fortunately, these days the issue of privacy is taken more seriously than ever, and if people want to invade the other’s privacy, they will be fined and prosecuted.

                          

How can you protect your privacy?

There are many institutions that can greatly help you in protecting your privacy , and besides, you can also increase your level of awareness in this area, to provide a lot of privacy for yourself.

You also need to be careful in some fields, for instance, never write down your passwords and usernames anywhere, think about whether this information is part of your privacy or not before sharing that, as a result, you shouldn’t share it if you come to the conclusion that this information is very important to you, be careful while making online payments in order not to let others invade your privacy.

Matomo is one of the software programs that can help users in establishing privacy, and in addition to protecting your privacy as a website owner, it can also protect the privacy of website visitors and mobile app users, by using this software, you can become aware of where your data is stored and what happens to it, which can greatly help protect privacy.

The point that should be mentioned about this software is that it is easy to work with and users at different levels of science and knowledge in the field of security and computer are able to use it.

How can you protect your privacy?

Last word:

In general, security is of a great importance, as you can understand from the article, you can achieve security without privacy, but you cannot achieve and maintain privacy without security, which is why all our efforts in this article have been on this issue in order to state the necessary points for establishing security and privacy, so that you can take all the needed steps in this field if you want to keep your information and system safe from hacking attacks by observing all the mentioned principles.

We hope that the content of this article will be useful for in the field of security and privacy , so you can prevent profiteers from accessing your personal information by following the mentioned points and abusing your information in order to achieve their personal desires, as a result, there are lots of points that should be considered in the way of protecting your information, which we tried to discuss some useful ones in order to make you aware of the steps that should be taken in this field.

DotNek بازدید : 136 چهارشنبه 19 خرداد 1400 نظرات (0)

With the increasing development of science and technology in today's world, the ways of communication and data transfer have changed and technology is evolving day by day, as a result of which security and privacy are becoming more and more important, each of the terms, security and privacy has a huge world as well as many details, in this article we are going to discuss security and privacy in ICT .

What is privacy and security in ICT?

What is information and communication technology (ICT)?

Information and communication technology , or “ICT” in simple terms, includes all products that store, process, transmit, convert, reproduce or receive electronic information, as it is clear from this explanation, it includes an extent category, which can be mobile devices, tablets, computers, software programs , websites with different contents, CDs, DVDs, content delivery network, computer hardware, email, educational software, etc.

In fact, all of these tools are a large part of everyone's lives these days, and people may convey important information through these tools, which is why the issue of security and privacy is of a great importance in all the mentioned tools, and there are so many ways through which you can increase security and privacy in them.

The importance of information and communication technology:

All organizations and individuals try to be able to use the technologies that are evolving every day, and the point of using all technologies is that you must increase the level of your awareness regarding security and privacy in them, through these ways, you can increase the security of the information contained in them to the highest possible level.

In fact, using these technologies can increase the speed and quality of work and at the same time reduce costs to a minimum, as well as increasing productivity in various fields, as we mentioned before, information and communication technology is so important and the reason for this importance is that many communication and educational methods have changed in today’s world due to the existence of these technologies, for example, you can connect to the world of education and see different trainings in different fields with just one click.

It is also possible to communicate easily with different people around the world, and as you know, these days the most important conferences may be held through information and communication technologies, each of which increases the importance of information and communication technology.

What is privacy in information and communication technology?

Privacy in general is one of the first rights that every individual deserves, which due to the existence of different technologies, it has become one of the most challenging human rights issues and these days everyone is trying to prevent people from invading their privacy, in general, privacy has several definitions that can be expressed in simple terms as follows:

privacy is the right that each user, institution, etc. has in determining a limitation of access for people who try to gain access to their personal information and also determining the time when this information should be shared with them.

Before the existence of technology, there has been privacy and people have tried to respect the privacy of others, but today, due to the development in technology and given that, in today's communication spaces, users can hide themselves behind invalid usernames, and as a result of which respect for the privacy of individuals has been severely diminished and individuals are trying to gain access to others information without their permission, and they also abuse it in order to achieve their desires.

What is security in information and communication technology?

Security is an issue that is of a great importance these days and there are many laws that are trying to provide security for different people, like privacy, which has received more attention because of the advancement of technology, security is becoming more and more important as well, and people are increasingly trying to maintain their security. Information and communication security , in simple terms, is a set of measures that should be taken in order to protect information and systems in the best possible way, in this regard, there are many points that should be observed, so that users can maintain their information in a safe space and communicate with other users.

What developments have occurred by information technology and communications?

You certainly know that there have been extensive developments in all fields of social, economic, etc., due to the existence of information and communication technology, and with the increasing development of this technology , society is becoming an information society, and as we have mentioned earlier, maintaining security and privacy in such a society is more complex than before.

One of the most important achievements of information and communication technology for human beings is the rapid access to various information and also the opportunity of doing all the tasks at the highest possible speed, and the abilities that these technologies provide have no geographical limitation, so it is not considered as an obstacle for users.

Through information and communication technology, people can express their needs to other users, and users can also help such people in various fields, which ultimately causes the community to get a high level in the field of culture, health, education, economy, etc., as we have mentioned earlier, with the help of this technology, people can have interaction with users around the world, so they can be informed of what is happening worldwide.

Given the great impact that information and communication technology has on the world, there are many theories about the development of e-government, e-cities, e-learning, and e-commerce, etc., all of which require a lot of time that should be spent by individuals and institutions in order to increase the security and privacy .

The practical benefits of these theories have made the use of information and communication technology a global and significant issue in various societies, one of which is the issue of e-government.

In order to increase security and privacy in information and communication technology, it is necessary to pay attention to many points and observe them, some of which we are going to mention in the following section.

                                                     

Important points:

- It is not possible to have security without privacy because the two are interdependent, so you need to consider both together.

- Minimize the private information that you share on social networks, because profiteers may try to use them in order to achieve their desires, which can have negative effects on security and privacy .

- While using different technologies, you should pay attention to the points that are related to each of them to increase security, for example, if you are using a mobile device, tablet, computer, etc., you have to be careful in every step you take for instance you shouldn’t click on different kinds of links which you are not sure about their safety, so you should try to pay more attention to security and privacy.

- While using all devices that transmit information in some way, you need to consider safety tips such as using strong antivirus software and never forget to update them.

- Download and use educational videos through legal ways in order to respect the rights of the producers.

- Keep images and videos that contain your personal information in a safe place and never leave them somewhere that is accessible to many people in order to protect them in the best possible way, so that they are not available to profiteers.

- Get help from experts in the fields of privacy and security of information and communication technology, so that you can take the necessary steps with complete mastery, and if you couldn’t follow the necessary tips by yourselves, these experts would help you and maximize security and privacy .

What is information and communication technology (ICT)?

Last word:

Information and communication technology has become very widespread these days and the importance of these issues is increasing day by day, which is why it is very important to pay attention to security and privacy issues, there are many articles on security and privacy in ICT all of which are trying to help different users achieve high security by following all the necessary points in the best possible way due to the fact that this issue turns into a huge concern for internet users, so you as a user, shouldn’t neglect the necessity of this topic.

DotNek بازدید : 124 چهارشنبه 19 خرداد 1400 نظرات (0)

As you know, there are many programming languages that can be used in order to implement various features in a web or application, among all the languages, one of the most popular is JavaScript, many programmers use it because it can eventually be used to make the user interact with the content better which is one of the most important factors in attracting users to your websites , there are several features in this language that you can learn by mastering each of them in the best possible way, which we are going to examine variables and data types in JS.

Learning different types of variables and data types in JavaScript web programming language

What is JavaScript?

The abbreviation for this language is JS, which allows you to use it to create dynamic content on the web, which has a very high interaction with the user, also with the help of this language, even very complex features can be easily implemented on the web, and the point that should be mentioned here is that any program written in JavaScript is known as a “script”.

JS can be run on both browsers and servers, there are JavaScript engines in various browsers, which are actually embedded by JS scripts and can be used to convert the script into a language that can be recognized by various devices.

JavaScript Variables:

In order to be able to store different amounts of data, you need to get help from it, which in order to master this, we suggest you pay attention to the following example.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p> In this example, x, y, and z are variables. </p>



<p id = "demo"> </p>



<script>

var x = 7;

var y = 8;

var z = x + y;

document.getElementById ("demo"). innerHTML =

"The value of z is:" + z;

</script>



</body>

</html>

Let and const:

The case which we have mentioned at the beginning was the only way that have been used in order to store data values until 2015, but now other ways are being used instead, including let and const.

- Const:

When you want to define a variable that cannot be changed again, you must use this.

- Let:

When the variable has a limited range, it is time to use this.

Much Like Algebra:

In this case, in order to try to store data values, you must use variables such as price1, for example.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p id = "demo"> </p>



<script>

var price1 = 4;

var price2 = 9;

var total = price1 + price2;

document.getElementById ("demo"). innerHTML =

"The total is:" + total;

</script>



</body>

</html>

Learning different types of variables and data types in JavaScript web programming language

When you plan to take action in this area, you need to follow the rules, some of which we are going to explain below.

- Identifiers are very important and in fact they can be in a form of short names or descriptive names.

- While using names for identifiers, you have to pay attention to the uppercase and lowercase letters that are used in them, because even with a large and small change in one of the letters, it is considered as a different variable.

- In relation to the names which are being used, it is important that they start with a letter.

- It is possible to use Dollar Sign $ for import, now note the example below in this regard.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript $ </h2>



<p> The dollar sign is treated as a letter in JavaScript names. </p>



<p id = "demo"> </p>



<script>

var $ = 2;

var $ myMoney = 5;

document.getElementById ("demo"). innerHTML = $ + $ myMoney;

</script>



</body>

</html>

Underscore (_) may also be used to enter various data, which is mentioned in the example below.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript $ </h2>



<p> The underscore is treated as a letter in JavaScript names. </p>



<p id = "demo"> </p>



<script>

var _x = 2;

var _100 = 5;

document.getElementById ("demo"). innerHTML = _x + _100;

</script>



</body>

</html>

JavaScript Data Types:

In JavaScript , data can be in lots of different forms, they can be in letters or numbers that differ from each other, for example, when you are writing codes, quotes must be used, but you do not need to use quotes while entering numbers, if you do not pay attention to this point, the commands may not be executed correctly, for example, if you quote a number, it may behave as a text string.

It is important to note that in programming , text values are called text strings, in addition to the above, the data in JavaScript can have different types, which in this article we are going to examine the numbers and text data, which are called text strings, here note the example below.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p> Strings are written with quotes. </p>

<p> Numbers are written without quotes. </p>



<p id = "demo"> </p>



<script>

var pi = 55;

var person = "John Doe";

var answer = 'Yes I am!';



document.getElementById ("demo"). innerHTML =

pi + "<br>" + person + "<br>" + answer;

</script>



</body>

</html>

Learning different types of variables and data types in JavaScript web programming language

Declaring:

It is the creation of a variable in JavaScript that requires you to use the var keyword in order to declare a variable in this language, when you want to add a value to a variable, you have to do the following, in order to understand this better, pay attention to the example below.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p> Create a variable, assign a value to it, and display it: </p>



<p id = "demo"> </p>



<script>

var carName = "Volvo";

document.getElementById ("demo"). innerHTML = carName;

</script>



</body>

</html>

In addition to being able to use these features and declaring a variable, it is possible to separate the various variables you enter by using commas, now consider the following example.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p> You can declare many variables in one statement. </p>



<p id = "demo"> </p>



<script>

var person = "John Doe", carName = "Volvo", price = 200;

document.getElementById ("demo"). innerHTML = carName;

</script>



</body>

</html>

In most cases, no value is defined for the variables when they are imported, as this data may be calculated later by the users, or it may be entered at another time by the program owner, now consider the following example.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Variables </h2>



<p> A variable declared without a value will have the value undefined. </p>



<p id = "demo"> </p>



<script>

var carName;

document.getElementById ("demo"). innerHTML = carName;

</script>



</body>

</html>

In JavaScript, one variable can be used to store different types of data, here consider the following example in this regard.

<! DOCTYPE html>

<html>

<body>



<h2> JavaScript Data Types </h2>



<p> JavaScript has dynamic types. This means that the same variable can be used to hold different data types: </p>



<p id = "demo"> </p>



<script>

var x; // Now x is undefined

x = 5; // Now x is a Number

x = "John"; // Now x is a String



document.getElementById ("demo"). innerHTML = x;

</script>



</body>

</html>

It may be as follows:

- JavaScript Strings

- JavaScript Numbers

- JavaScript Booleans

- JavaScript Arrays

- JavaScript Objects

Learning different types of variables and data types in JavaScript web programming language

Last word:

As you can see in this article, there are different ways to store different amounts of data, and the available data may be in different forms, which we explained and gave examples in this regard, but the most important point is that you have to follow all the instructions while entering commands in order to execute properly, as a result, if you pay attention to the mentioned point as well as the examples which have been described, you can have more awareness in the field of data types and various variables as well as the way that they are being used, in this article we have explained JS programming language which is so popular among various programmers and is being used by them, we hope you can get help from this article in order to write codes in the best possible way without being wrong.

DotNek بازدید : 122 چهارشنبه 19 خرداد 1400 نظرات (0)

The variety of websites is increasing day by day and different users have the right to choose one of them, one of the factors that affect the choice of users is the layout of a site due to the fact that when the site layout is attractive , it causes the users to choose it among others, there are various elements which are effective in creating a page, and in addition to the existence, their arrangement is of a great importance, and you must choose where each element should be placed very carefully, in the following, we are going to pay more attention to this issue.

Learning how to position in CSS

What is CSS?

CSS stands for Cascading style sheets which is used for the appearance of the site, in simple terms, it describes how HTML elements should be displayed on different sites.

How to position in CSS?

Determining the correct position for different elements is so essential, and it is an issue that may not be taken seriously, so that when they want to fix the existing bugs, they may try to change the position of the elements without proper awareness of its consequences, which may eventually be right or wrong, and they may be able to find the right position by repeating this process, but it would be so boring, you should also pay attention to the fact that for each element, depending on the purpose of placing them in the content, different position may be suitable, in the following, we are going to examine the different methods that exist in order to determine the position of elements.

Position properties:

Position may have different properties, such as static, relative, absolute, fixed, and inherit, each of which is used for different purposes, so that you need to specify your purpose first and then determine the position.

It allows you to place elements in a specific location on the page, or to set one element in front of another, or vice versa, you can determine the position of different elements according to the method you use with the help of top, bottom, left and right properties.

In the following section, we are going to explain the different positioning methods.

- Static:

If you do not set the position, the elements will be static by default, in fact, through this way, all the elements will be in accordance with the normal flow of the page layout, it should be also noted that the elements that you determine their position in this way cannot be affected by the top, bottom, left, right properties, now consider the following examples.

# box_1 {

Position: static;

Width: 400px;

Height: 400px;

Background: # ee3e64;

}



# box_2 {

Position: static;

Width: 400px;

Height: 400px;

Background: # 44accf;

}



# box_3 {

Position: static;

Width: 400px;

Height: 400px;

Background: # b7d84b;

}

This method is used to position elements with simple designs, and as mentioned earlier, it is not possible to affect and move them with the help of top, bottom, left, right properties, so if you use this method, you will lose the chance to move them, this method is also used in the following example.

<! DOCTYPE html>

<html xmlns = "http://www.w3.org/1999/xhtml">

<head>

<title> </title>

<style>

p.pos_fixed {

position: fixed;

top: 40px;

right: 8px;

}



</style>

</head>

<body>

<p class = "pos_fixed"> An element with position: fixed </p>

</body>

</html>

Learning how to position in CSS

- Relative:

The difference between this method and the previous one in determining the position is that it is possible to move the elements with the help of top, bottom, left, right properties, but it generally puts the elements in normal places, here are some examples in the following:

# box_1 {

Position: relative;

Width: 200px;

Height: 200px;

Background: # ee3e64;

}



# box_2 {

Position: relative;

Width: 200px;

Height: 200px;

Background: # 44accf;

}



# box_3 {

Position: relative;

Width: 200px;

Height: 200px;

Background: # b7d84b;

}

Here is another example of how to position elements using this method:

<! DOCTYPE html>

<html xmlns = "http://www.w3.org/1999/xhtml">

<head>

<title> </title>

<style>

h2.pos_top {

position: relative;

top: 50px;

}



</style>

</head>

<body>

<h2 class = "pos_top"> This element has position: relative; </h2>

</body>

</html>

- Absolute:

In this method, in order to determine the position of different elements, they are positioned according to the parent element, and in the case that they cannot find it, then the elements will change position according to the HTML code is displayed on top and in front of another element.

- Right:

This property determines the edge of right margin for the positioned box.

- Top:

It adjusts the edge of the top margin for the positioned box.

Learning how to position in CSS

Last word:

In this article, we have explained the different methods of positioning the elements for you and tried to help you understand them better by giving various examples in this regard, so that you can use it to determine a suitable framework for your content, in general, there were 5 methods to determine the position of the elements, each of which should be used according to the purpose of using the element, so that try to choose the best one according to the mentioned points.

DotNek بازدید : 128 چهارشنبه 19 خرداد 1400 نظرات (0)

By learning CSS, you can avoid the repetitive use of HTML code, which can save your time a lot and also keeps your work organized, which is of a great importance, and with the introduction of different programming languages ​​and also the importance of being updated regularly, site designers can spend more energy to design different sites with more features and ultimately be able to provide better results as well as facilities to their users, so in this article we will mention some tips on how to build links, lists and tables using CSS, but first we are going to define CSS.

Learn how to create links, lists, tables in CSS

What is CSS?

It stands for Cascading Style Sheets is a language which was created to shape and make a website as well as web pages and its internal components, and it is one of the main tools for web designers, along with HTML, JavaScript, etc., which is being used a lot.

How to create links in CSS?

Links are very important in the content of a site, and it is necessary to increase your knowledge about linking and related topics,

existing links can be designed in different ways depending on their states, which in the following we will discuss more about this, in general the four links states are:

- a: link:

One of the types of links that we need to mention is this type which includes all links that are normal and unvisited.

- a: visited:

This is another type of link that, as the name implies, includes links that different users have visited.

- a: hover:

In this type, the users hit the link with their mouse, but they do not click on it.

- a: active:

It refers to the exact time when the user clicks on the link.

It should be noted that if you wanted to use multiple link modes in CSS at the same time, a: visited must be followed by a: link or a: active must be followed by a : link, a: visited and a: hover.

For example:

/ * unvisited link * /
a: link {
color: red;
}

/ * visited link * /
a: visited {
color: green;
}

/ * mouse over link * /
a: hover {
color: hotpink;
}

/ * selected link * /
a: active {
color: blue;
}

Text Decoration:

Links can more beautiful by removing the lines below them which gives a beautiful and appropriate look to the content, if you want the explanation of the 4 states that a link can have which we have explained each of them earlier, you need to do the following.

a: link {
text-decoration: none;
}

a: visited {
text-decoration: none;
}

a: hover {
text-decoration: underline;
}

a: active {
text-decoration: underline;
}

Background Color:

Another thing that can be changed in relation to the links and caused a link to be displayed in a way that we want, is its background color, which in order to change this, as in the previous case, you can write simple code, and you can do this in a way that the users can realize that the link currently exists in which of these 4 positions.

a: link {
background-color: yellow;
}

a: visited {
background-color: red;
}

a: hover {
background-color: green;
}

a: active {
background-color: blue;
}

There are some examples of coding for links which have been mentioned above, each of which is for a separate feature for the link, but imagine that you want to determine multiple features such as color, background color, no line below the link, and so on, in order to do this, you must do the following.

a: link, a: visited {
background-color: # 0000ff;
color: Blue;
padding: 13px 26px;
text-align: center;
text-decoration: none;
display: inline-block;
}

a: hover, a: active {
background-color: yellow;
}


Learn how to create links, lists, tables in CSS

Another example:

a: link, a: visited {
background-color: green;
color: blue;
border: 2px solid green;
padding: 8px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
}

a: hover, a: active {
background-color: red;
color: white;
}



How to create lists in CSS?

Lists can be very helpful to a user who has come to your site, and you want to see, a complete list of all your products, or a list of product prices and thousands of other lists, each of which may be used for an application, there are generally two main types of listings in CSS, which are as follows.

- Unordered Lists:

This link is called

      in coding and all items in the list are indicated by bullets, for example consider the list below which is an Unordered List.

o Chocolate cake

o Strawberry cake

o Vanilla Cake

▪ Chocolate cake

And Strawberry cake

And Vanilla Cake

- Ordered Lists:

This link is also indicated by

        and the items in the list are indicated by letters or numbers, an example of this list is given in the following.

1. Chocolate cake

2. Strawberry cake

3. Vanilla Cake

I. Chocolate cake

II. Strawberry cake

III. Vanilla Cake

List-style-type:

One of the features that can be changed in these lists according to your decision is that you can choose what to use next to the items in your list, for example in Unordered Lists, someone may select items that the members of the list should be shown with a square and so on, which we have given you an example in this regard below.


ul.a {
list-style-type: circle;
}

ul.b {
list-style-type: square;
}

ol.c {
list-style-type: upper-novel;
}

ol.d {
list-style-type: lower-alpha;
}

List-style-image:

Another feature that these lists can have is that they use different images to show the items in the list, in which case the following command can be used to achieve this goal.

ul {
list-style-image: url ('smiley.gif');
}
ol {
list-style-image: url ('sqpurple.gif');
}


List-style-position:

This will help you determine where you want each of the markers on your list to be, the position of them may be as follows.

- outside:

In this case, the markers in the list are in a position outside the existing list frame.

-  inside:

In this case, the markers that are placed next to each of the list items are inside the list frame.

ul.a {
list-style-position: inside;
}

ul.b {
list-style-position: outside;
}

List-style-type: none:

By default, there are a number of features for this type of list that you may not want, you need to modify them with the help of the following code.

ul {
list-style-type: none;
margin: 0;
padding: 0;
}

List-style Shorthand property:

If you want to specify all the attributes that a list can have which you can specify them in relation to a list, you need to do the following.

ol {
list-style: circle outside url ("sqpurple.gif");
}

Create color lists:

As you know, the ultimate goal of all this work is to attract more users, so you can make the existing lists colorful, so that you can attract more users to your content, it should be noted that if you do not want the whole list to be colored uniformly, you can use the

    1. tag, in which case each item in the list will be colored separately.

      for example:

      for example:
      ul li {
      background: # ffe5e5;
      margin: 5px;
      }

      How to create tables in CSS?

      It is possible for you to use it to create an attractive look for the tables in your content, which we will explain in more detail below, it should be noted that there are two elements in tables, and .

      Table Borders:

      One of the features that can make the tables beautiful is their borders, for instance, you can choose a blue border for your table:

      table, th, td {
      border: 1px solid blue;
      }

      Full-Width Table:

      Another feature that you can use in order to get the user's attention is to draw tables that take up the entire width of the page instead of creating small tables.

      table {
      width: 100%;
      }



      Learn how to create links, lists, tables in CSS

      Last word:

      In general, with the help of CSS, you can create a beautiful and attractive appearance for your content, in this article, we have taught you how to create links, lists and tables with the help of CSS, which you can use the mentioned tips according to your needs in order to create an attractive website which can get a high ranking in search engine results page due to the fact that it has the ability to attract users.

تعداد صفحات : 39

اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آرشیو
    آمار سایت
  • کل مطالب : 383
  • کل نظرات : 0
  • افراد آنلاین : 1
  • تعداد اعضا : 0
  • آی پی امروز : 38
  • آی پی دیروز : 20
  • بازدید امروز : 46
  • باردید دیروز : 28
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 176
  • بازدید ماه : 616
  • بازدید سال : 7,901
  • بازدید کلی : 57,334