[Solved] I need to make a function to print “=” under the user, but because variable was declared with main() the parameter isn’t seen by the function [closed]

There are a few errors in your program. Firstly, you declare your function parameter without setting the data type of the parameter. Generally, declaring a function has the following format: return_type function_name(input_type input_parameter, …) { // Do whatever you want } In the above, the input type refers to the data type of the variable … Read more

[Solved] Error adding items to the Grid

GridView1.DataSource = Sabt; GridView1.DataBind(); Sabt seems to be single object. To bind DataGrid you need to have collection like List<JadvalSabtenam > or BindingList<JadvalSabtenam> Try that: List<JadvalSabtenam > dataSource = new List<JadvalSabtenam> {Sabt}; GridView1.DataSource = dataSource; GridView1.DataBind(); Reason for that is: What Grid should do with single object? When it’s collection each item is corresponding to … Read more

[Solved] Which is more faster? trim() or RegEx?

Test: var string = ‘ fsajdf asdfjosa fjoiawejf oawjfoei jaosdjfsdjfo sfjos 2324234 sdf safjao j o sdlfks dflks l ‘ string.replace(/^\s+|\s+$|\s+(?=\s)/g, ”) string.trim() Results: Function Result regex regex x 1,458,388 ops/sec ±2.11% (62 runs sampled) trim trim x 7,530,342 ops/sec ±1.22% (62 runs sampled) Conclusion: trim is faster Source: https://www.measurethat.net/Benchmarks/Show/4767/0/regex-removing-whitespace-vs-trim solved Which is more faster? … Read more

[Solved] How can I find objects with same keys values in array?

If that is the exact solution that you want. Following code snippet may help you. const arr = [ { type: ‘type’, fields: [‘field1’]}, { type: ‘type2’}, { type: ‘type’, fields: [‘field2’]} ] const modifyArr = (data) => { let res = []; arr.map((item) => { if(item.type == data.type){ if(Object.keys(item).includes(‘fields’)){ res = res.concat(item.fields); } } … Read more

[Solved] Write a function firstWord, taking a string and returning the first word in that string. The first word are all characters up to the first space [closed]

There are several problems with your code: go and run is not a valid parameter declaration in the function header. There is confusion here with the parameter and the string value that you expect the function to be called with. In the function header you should list the parameter(s) with variable names. Since the function … Read more

[Solved] Write a programme to input 10 numbers from the user and print greatest of all

If you have an array declared like int a[N]; where N is some positive integer value then the valid range of indices to access elements of the array is [0, N). It means that for example this for loop for(i=1;i<=10;i++) { printf(“enter 10 nos. for arr[%d] :”,i); scanf(“%d”,&arr[i]); } must look like for ( i … Read more

[Solved] So,I made this simple C program to give output,so it is correct for positive and zero integer values but it is coming wrong for negative even and odd

Just reindent your code you will find strange { like the one after printf(“Positive”); Juste removing this strange { and fixing your coding style will be: #include<stdio.h> int main() { int x; scanf(“%d”, &x); if ( x > 0 ) { printf(“Positive”); if ( x % 2 == 0 ) { printf(“Even”); } else { … Read more

[Solved] how ca I get variable from ubuntu and insert it to the php file [closed]

Probably, you want to pass the arguments from the command line as follows: php /path/to/www/path/to/script.php arg1 arg2 In PHP script, you can access the variables as follows. <?php // $argv[0] is ‘/path/to/wwwpublic/path/to/script.php’ $argument1 = $argv[1]; $argument2 = $argv[2]; ?> Please let me know your thoughts. 1 solved how ca I get variable from ubuntu and … Read more