Questions tagged [take]

Take is a common keyword or function name used to return a given number of elements, usually contiguously and from the beginning of a collection. Only use this tag for the take keyword or function name; usage such as "take a picture/screenshot" is out of scope.

Take functions usually only require two pieces of information: the number of elements to be returned from the sequence, and the sequence itself.

If take is a method in a particular library or language, it is called on the object and would only require the number parameter.

This concept is found in many languages and libraries, some of which are listed below.

Reference

142 questions
1
vote
2 answers

C# Take a piece of text at a time in a textbox

I have a textbox(textBox2) where are the email: thisemail@gmail.com,hello@yahoo.it,YesOrNo@gmail.com,etc.. I have a function that sends an email: private void button1_Click(object sender, EventArgs e) { var mail = new MailMessage(); var…
SquizzyHc
  • 15
  • 1
  • 3
1
vote
1 answer

take a picture and save it using android studio

I wrote a program that can take a picture . The problem is when I try to save it in DIRECTORY_PICTURES I can't find the picture I took in pictures directory what is the wrong with my code the?. The program I wrote open the camera with no problem and…
user6912274
  • 23
  • 1
  • 1
  • 5
1
vote
2 answers

how do I use skip/take in Vinelab/Neoeloquent queries: PHP

I want to limit the number of results given by a Neoeloquent query, take() works fine but I don't know how should I use skip()? I read the laravel 5.2 Doc. I'm trying to use skip(10)->take(10) but it says "Method skip does not exist." here is my…
Omid
  • 41
  • 5
1
vote
1 answer

LINQ .Take() after .Distinct() issue

So I'm doing a database query using LINQ with this (sanitized) code: var dateList = Table1.Where(t1 => t1.column1.Contains(stringUsed)) //stringUsed is a parameter of the method containing this code .Join(Table2, t1 =>…
user3517375
  • 91
  • 2
  • 14
1
vote
2 answers

getting an error with take in a query Rails

I have a method as follows... def self.get(code) where(code: normalize_code(code)). where('coupon_count > 0'). where('expires_at > Time.now OR expires_at IS NULL'). take end I keep getting the error "wrong number of arguments (0 for 1)" on the…
SupremeA
  • 1,519
  • 3
  • 26
  • 43
1
vote
2 answers

how to take screenshot and not save it on gallery in android

I use below code for ScreenShot: public class startActivity{ Bitmap layoutBitmap = Bitmap.createBitmap(mReLayout.getWidth(), mReLayout.getHeight(), Bitmap.Config.ARGB_4444); Canvas canvas = new Canvas(layoutBitmap); …
Ha Nguyen
  • 91
  • 8
1
vote
1 answer

NHibernate: Can't Select after Skip Take In Certain Scenario

For some reason I am unable to use Select() after a Skip()/Take() unless I do this in a certain way. The following code works and allows me to use result as part of a sub query. var query = QueryOver.Of(); query.Skip(1); var result =…
1
vote
2 answers

Take n element except from dictionary

I have this code: var items = from pair in dic orderby pair.Value descending select pair; var top5 = items.Take(5); I take five items from a Dictionary string,int in descending order var keys = String.Join(", ", top5.Select(x =>…
jelo
  • 13
  • 2
1
vote
1 answer

java blockingqueue consumer block on full queue

I'm writing an small program to put tweets from the Twitter public stream into an HBase database. The program uses two threads, one to collect the tweets and one to process them. The first thread uses twitter4j StatusListener to get the tweets and…
1
vote
1 answer

LINQ : How to set value of Take() from a field in current query

I have a table of Widgets with columns "Name" and "Count" The "Count" field contains count of Posts each Widget would show: Name | Count --------------------- RecentNews | 6 SpecialNews | 5 NewsGallery | 10 The second table…
Hamed
  • 61
  • 7
1
vote
0 answers

Android take image capture get null

I work with image caputre on android. I try to take a picture and send image after saving image on memory device. Some devices like LG return null for URI image. I dont know why get this value on LG and Samsung S4. S5 work great. Code: Start camera…
Michael
  • 780
  • 1
  • 10
  • 34
1
vote
1 answer

EF LINQ Include with Take

I want to take only 1 client with 3 invoices from the DB. The code stated below does not give me 3 results(but throws an exception). Exception: The Include path expression must refer to a navigation property defined on the type. Use dotted paths…
Lars
  • 736
  • 1
  • 8
  • 18
1
vote
0 answers

webdriver - how to capture screenshot on the assert statement passed

@Override public void onTestSuccess(ITestResult tr) { } I add method onTestSuccess, but it takes screenshot only when the whole test passed, not assetion passed. what can I do?
Feixiong Liu
  • 443
  • 1
  • 7
  • 14
0
votes
0 answers

Angular Firebase database value Id of Items is showing undefined

Database value of Id items is showing undefined: I use angular 15. here is model/product.ts export interface Product{ key: string; data:any; title: string; price: number; category: string|null; imageUrl:string; } here is…
Vinh99
  • 1
  • 3
0
votes
1 answer

How to use COUNTIF and TAKE function in Excel

I'm new here. I have a problem with an Excel function. As the result of take(filter(...)) in Excel I have this list: So, I want to apply COUNTIF there like: COUNTIF(TAKE(FILTER(..))>74). But when I've tried to do this, Excel show me this: Does…