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
-2
votes
1 answer

How do I kill this thread in python

In this code kill = False a = tr.Thread(target=func, args=(a, b, kill), daemon=True) a.start() And this is a tkinter app so how do I kill this thread like what command is threr to do that.
Deni 'Z Off
  • 11
  • 1
  • 3
-2
votes
2 answers

A breakdown of what these functions do in this list?

A basic program that intends to generate a new list containing the elements of list2. Followed by the elements of list1 in reverse order I can't seem to understand what the commented line means. def combine_lists(list1, list2): new_list =…
Levi
  • 33
  • 7
-2
votes
1 answer

How To run 'performSegue' in a function on Swift5?

I'm the first iPhone developer. My problem is that I want to run 'performSegue' in the function. Works correctly within a typical button function. But I want to do it in a function. What should I do? @IBAction func nextButtonFuc(_ sender: UIButton)…
iosbegindevel
  • 307
  • 5
  • 20
-2
votes
2 answers

C#: generic function that return element from collection based on condition

So i have this function that return element from collection based on condition public static T Search(IEnumerable source, Func filter) { return source.FirstOrDefault(filter); } And i want to convert this to return all the…
danny kob
  • 171
  • 1
  • 2
  • 12
-2
votes
2 answers

Swift String Array Iterating Function

I am trying input an array with all the months and display them one by one on my scrollable calendar. I am trying to return each individual "month" for each header of the calendar. I am using the following string array, yet i am unsure how to…
Travis Whitten
  • 44
  • 2
  • 11
-2
votes
2 answers

C# check if delegate/func has a valid receiver

I have a situation where multiple classes are registering interest with another class to observe a certain property's value. This is being done by using delegates like so: public delegate void ObservingHandler (object…
Rob Sanders
  • 5,197
  • 3
  • 31
  • 58
-2
votes
3 answers

can't open QR url from an alert view in Swift

I'm trying to open a URL from a QR with Swift, but I can't get with the code to do it. I tried with this func code: func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection…
-2
votes
2 answers

Calling a function and wait for its completion

i have this class and its func class DataUsuarios { func update(completionHandler : ((isResponse : Array) -> Void)) { //CODE completionHandler(isResponse: jsn) } } and i call it with this let data =…
Carlos.V
  • 409
  • 6
  • 13
-2
votes
3 answers

swift : i can't return a value from a function

i've been struggling with this function here :P i hope someone could help me with it. so my function retrieve some kind of data (double) from parse. the problem is i can't return the value of mark. this is a picture of my error after updating the…
hamdi islam
  • 1,327
  • 14
  • 26
-2
votes
2 answers

How to convert Func to Func in C#

I tried to code a function using refelecion to convert a function Func< TSource, bool> to Func< TTarget, bool> but without success This what i did: static Func Convert(Func func) { var…
SomeCode.NET
  • 917
  • 15
  • 33
-3
votes
1 answer

How can I get the milk cost using func (Swift)

I'm studying the Swift code now, and for the func, I have a question. The code is func getMilk(bottles: Int) { var cost = bottles * 1.5 print("Milk cost is $\(cost)") } getMilk(bottles: 4)
-3
votes
1 answer

How to deal with immutable objects in javascript?

I'd like my objects to be immutable but copying the same object like hundred times doesn't make much sense to me. const arr = [1,2,3] const arr2 = [...arr, 4] const arr3 = [...arr, 5] What if I have to copy it more times? How can I deal with it? I…
-3
votes
1 answer

C# LINQ lambda expression with Contains as a method parameter

I am writing a method that gets a lambda expression as a parameter to be used to filter the IList _collection. public void DoSomething(SomeModel model) { FilterCollectionUsingPredicate(x => x.Name.Equals(model.Name)); } private void…
MajQ
  • 1
  • 1
-3
votes
1 answer

How to share variables through packages

I'm trying to figure out how can I return a value from a function in a file of a package name to another package. for example let's assume you have package main func main(){ x := 5 a := res.Test(x) } package res func Test(x int) (y int){ …
wecandoit
  • 37
  • 6
-3
votes
1 answer

Accessing Delegates in method

I am trying to implement one interface and it has such method public object GetOrCreate(string key, Func func) { } From the method declaration, I find that ICacheEntry and generic T type object is passed. Maybe someone could…
Tomas
  • 17,551
  • 43
  • 152
  • 257
1 2 3
76
77