Find a Number Using Pythagoras Theorem with Chash

Samual Sam
Updated on 22-Jun-2020 09:04:37

611 Views

Firstly, set the first two numbers −double val1, val2; val1 = 10; val2 = 5;Now use the Math.Sqrt function to use Pythagoras Theorem.res = Math.Sqrt(val1 * val1 + val2 * val2);Example Live Demousing System; public class Program {    public static void Main(string[] args) {       double val1, val2, res;       val1 = 10;       val2 = 5;       res = Math.Sqrt(val1 * val1 + val2 * val2);       Console.WriteLine("Result = {0}", res);       Console.ReadLine();    } }OutputResult = 11.1803398874989

Find and Replace a Word in a String in C#

George John
Updated on 22-Jun-2020 09:04:03

4K+ Views

Firstly, set the string to be replaced.string str = "Demo text!";Now use the replace() method to replace the above string.string res = str.Replace("Demo ", "New ");The following is the complete code to replace a word in a string.Example Live Demousing System; public class Demo {    public static void Main() {       string str = "Demo text!";       Console.WriteLine(str);       string res = str.Replace("Demo ", "New ");       Console.WriteLine("After replacing...");       Console.WriteLine(res);    } }OutputDemo text! After replacing... New text!

Searching a SAP HANA System in HANA Studio System View

SAP Expert
Updated on 22-Jun-2020 09:03:53

692 Views

When you are managing a large number of systems using HANA Studio, this can be used to find a specific system more quickly.To use find system option, the following steps should be performed −From the Systems view toolbar, choose the Find System (Find System) button.2. Enter a search string −You can also use “*” or “?” wildcards.It will display matching systemsSelect the system you were searching for.You can select several systems in the search results by pressing the CTRL key while selecting. You can use this, for example, to mark duplicate systems.Choose whether you want to open the selected system ... Read More

Find Substring from a String in C#

karthikeya Boyini
Updated on 22-Jun-2020 09:03:24

342 Views

Set the stringstring s = "Tom Cruise";Now let’s say you need to find the substring “Tom”, then use the Contains() method.if (s.Contains("Tom") == true) {    Console.WriteLine("Substring found!"); }The following is the code to learn how to find a substring from a string −Example Live Demousing System; public class Demo {    public static void Main() {       string s = "Tom Cruise";       if (s.Contains("Tom") == true) {          Console.WriteLine("Substring found!");       } else {          Console.WriteLine("Substring not found!");       }    } }OutputSubstring found!

Managing Password Policy in SAP HANA System

SAP ABAP Expert
Updated on 22-Jun-2020 09:00:08

535 Views

The last folder in SAP HANA Studio system navigation is Security and it has 3 subfolders inside it that define the system security policy and user management activities −SecurityUserRolesSecurity tab is used to manage Password Policy in HANA system −

Find and Display the Multiplication Table in C#

Chandu yadav
Updated on 22-Jun-2020 09:00:08

994 Views

To display multiplication table, you need to set the numbers and format the output property. Let’s say you want to find the table of 4 from 1 to 10. For that, set a while loop first till 10.while (a

CSS Overflow Scroll

Sreemaha
Updated on 22-Jun-2020 08:59:58

417 Views

In the CSS overflow property with value scroll, the overflow is clipped and a scrollbar gets added. This allows the user to read the entire content.ExampleYou can try to run the following code to implement CSS overflow: scroll property −Live Demo                    div {             background-color: orange;             width: 250px;             height: 45px;             border: 2px solid blue;             overflow: scroll;          }                     Heading       Overflow property used here. This is a demo text to show the working of CSS overflow: scroll. This won't hide the content. Now a scrollbar will be visible.     Output

Use of Restricted User in SAP HANA System

SAP Expert
Updated on 22-Jun-2020 08:58:59

768 Views

When you compare standard database users, restricted users have the following limitations −With restricted users, it is not possible to create objects in the database as they are not authorized to create objects in their own database schemaRestricted users are not authorized to view any data in the database as they are not granted the standard PUBLIC roleWith the use of restricted users, you can connect to the database using HTTP.

Keywords in Chash

George John
Updated on 22-Jun-2020 08:58:35

735 Views

Keywords are reserved words predefined to the C# compiler. These keywords cannot be used as identifiers. However, if you want to use these keywords as identifiers, you may prefix the keyword with the @ character.The following are the two types of keywords in C#.Reserved KeywordsabstractasbaseBoolbreakbytecasecatchcharcheckedClassconstcontinuedecimaldefaultdelegatedoDoubleelseenumeventexplicitexternfalseFinallyfixedfloatforforeachgotoifImplicitinin (generic modifier)intinterfaceinternalisLocklongnamespacenewnullobjectoperatorOutout (generic modifier)overrideparamsprivateprotectedpublicReadonlyrefreturnsbytesealedshortsizeofstackallocstaticstringstructswitchthisthrowTruetrytypeofuintulonguncheckedunsafeUshortusingvirtualvoidvolatilewhileContextual Keywordsaddaliasascendingdescendingdynamicfromgetglobalgroupintojoinletorderbypartial (type)partial(method)removeselectset

Lambda Expressions in C#

karthikeya Boyini
Updated on 22-Jun-2020 08:58:21

773 Views

A lambda expression in C# describes a pattern.Lambda Expressions has the token => in an expression context. This is read as “goes to” operator and used when a lambda expression is declared.Here, we are finding the first occurrence of the element greater than 50 from a list.list.FindIndex(x => x > 50);Above the token => is used. The same is shown below −Example Live Demousing System; using System.Collections.Generic; class Demo {    static void Main() {       List list = new List { 44, 6, 34, 23, 78 };       int res = list.FindIndex(x => x > 50);       Console.WriteLine("Index: "+res);    } }OutputIndex: 4

Advertisements