Questions tagged [func]

Func is a family of delegate types in the .Net framework.

Func is a family of types in the framework. They are in the System namespace and can be used to represent a function that returns a value and has zero or more parameters.

1154 questions
-3
votes
2 answers

Sum sub of matrix by recursion in C#

I'm trying to solve a problem without using a loop but I don't find a way... Let take this array for example: (assume there is randomize values) 1, 2, 3, 4, 5 2, 3, 4, 5, 6 3, 4, 5, 6, 7 4, 5, 6, 7, 8 5, 6, 7, 8, 9 By sending (row: 2, column: 1) I…
Hazan
  • 323
  • 3
  • 11
-3
votes
3 answers

Cannot use optional chaining on non-optional value of type '[Int]'

I am trying to make my code print "Hello World" in Swift 4 by selecting just one of the three numbers in the array and I get the error listed in the title. func newFunc() { let employees = [1, 2, 3]? if employees == [1] { let…
pillarman38
  • 47
  • 3
  • 13
-3
votes
1 answer

Time measurement of functions with different signature in C#

I want to measure the time that certain function calls take in my application. For this I use the Stopwatch class and it works fine. It looks something like this: static readonly Stopwatch StopWatch = new Stopwatch(); StopWatch.Restart(); void…
Frank
  • 2,446
  • 7
  • 33
  • 67
-3
votes
2 answers

Loop through IEnumerable using Lambda

I have a func which looks like below Func ItemProduct(Iitem item) => (pro)=> pro.ItemID == item.Id; I am looking for a func which take multiple items. I am trying like below but that is not correct...Can you please help me how to do…
reddy
  • 81
  • 2
  • 7
-3
votes
2 answers

calling a member function of a class by member function of another class?

i have two classes A & B.i want to call a member function of A by member function of B. class A { public: void memberofa(); } class b: class B { public: void memberofb(); } now i need to call memberofa from inside memberofb. Any…
Hemanth
  • 1
  • 1
  • 1
  • 4
-3
votes
1 answer

how to store json object in a variable and use globally in other functions in swift

var drivers : NSArray? func loadDriversREST() { RestApiManager.sharedInstance.getDriverList{ json in var drivers = json println(drivers.description) } func getDriverFromId(id: Int?) -> String { if id ==…
Raj
  • 61
  • 3
  • 7
-3
votes
2 answers

C# Extension Methods for Generic Functions

I want to create a simple one-line try/catch without all the extra fluff: // The extension class public static class TryExFunc { public static Exception TryEx (this Func func, out TResult result) { …
Dandruff
  • 21
  • 4
-4
votes
3 answers

Count by Title on specific columns

Date ID intent 9/1/2018 1 fetch it 9/1/2018 1 Ask it 9/1/2018 1 default 9/1/2018 2 remand 9/1/2018 2 choose it 9/2/2018 1 fetch it 9/2/2018 1 choose 9/2/2018 1 default 9/3/2018 4 Ask…
user3369545
  • 310
  • 2
  • 14
-4
votes
1 answer

how can i delete spaces in c++

cout << "---------------------------------------------------\n"; cout << "# Level:" << getLevel() << " #\n"; cout << "# Max Hp:" << getMaxHp() << " …
-4
votes
1 answer

C# Func <> argument types

Im trying "Func" delegation. Func(myFunc); //works OK Func(myFunc); //Exception ??? Unhandled Exception: System.ArgumentException: Object of 'System.String'cannot be converted to type…
kestasj
  • 49
  • 2
  • 8
-4
votes
1 answer

How can i return value from generic Func<>

How can i provide return value according by followed sample? I want to use this function like this MyMethod(model=> model.Id) public T MyMethod(Func item) { return ?? }
Bombula
  • 15
  • 1
  • 7
-5
votes
1 answer

Having difficulty understanding func(&_) in c

Can someone please explain me the purpose of func(&_) and void? I am not sure how the whole program works. void func(int *xp); int main(void) { int x, y; x = 5; func(&x); y = x-3; func(&y); …
-8
votes
1 answer

how do I make a func that will make all vowel letters lowercase, all consonants uppercase, and write numbers in letters?

I'm new to swift and studying functions rn. I have a task that's given in the title, and I can't really imagine how to do it. I need to make a func that turn all the vowel letters into lowercase, all consonants into uppercase and write numbers in…
daria
  • 13
  • 3
-8
votes
1 answer

HOw can i fix Or translate this func.php file

I'm very curious in fixing this.., its YouTube video Grabber func.php .. i don't really understand the language it was written in and I'm looking for the line to insert my YouTube API key, This is the file below i have tried many method in fixing…
1 2 3
76
77