Questions tagged [sample]

Small part of or a selection from something (code, logs, data etc.), intended to show the structure, style, or nature of the whole.

In statistics, the process of generating random samples is called .

In and some other programming languages, the function sample performs random sampling of a set with or without replacement.

1672 questions
200
votes
28 answers

How to split data into training/testing sets using sample function

I've just started using R and I'm not sure how to incorporate my dataset with the following sample code: sample(x, size, replace = FALSE, prob = NULL) I have a dataset that I need to put into a training (75%) and testing (25%) set. I'm not sure…
Susie Humby
  • 2,001
  • 2
  • 13
  • 3
97
votes
1 answer

Sample http range request session

Is it possible to show me a sample http session with range requests. I mean what would be the request and response headers?
chamal
  • 1,103
  • 1
  • 8
  • 6
69
votes
12 answers

Where can I find sample databases with common formatted data that I can use in multiple database engines?

Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? I know that the Canadian Department of Environment…
Kibbee
  • 65,369
  • 27
  • 142
  • 182
62
votes
5 answers

MVC tutorial that doesn't rely on a framework?

I want to learn MVC "architecture pattern" but I don't want to jump into a framework like Rails or Django just yet. I want to understand the concept first and write some simple code in my currently familiar environment, which happens to be…
Ixion
  • 745
  • 1
  • 7
  • 8
48
votes
9 answers

Take random sample by group

I have a data frame made by almost 50,000 rows spread in 15 different IDs (every ID has thousands of observations). Data frame looks like: ID Year Temp ph 1 P1 1996 11.3 6.80 2 P1 1996 9.7 6.90 3 P1 …
matteo
  • 4,683
  • 9
  • 41
  • 77
47
votes
8 answers

Where can I find some sample WPF animations?

As I am a programmer,and not an artist or animator and I am failing at showing off the best features of WPF in my application. Although I have samples for simple animations for buttons like growing, or having the color fade into something brighter…
Kris Erickson
  • 33,454
  • 26
  • 120
  • 175
46
votes
1 answer

Where can I find some good examples of Android UI?

I'm quite new to the Android world, and, due to work needs, I'm trying to get in. Whilst I'm not particularly afraid of the "thinking" code (i.e. Java), I'm a bit confused when developing the user interface. Since I found that the simplest yet most…
Gian Segato
  • 2,359
  • 3
  • 29
  • 37
45
votes
5 answers

Random Sample of a subset of a dataframe in Pandas

I have a pandas DataFrame with 100,000 rows and want to split it into 100 sections with 1000 rows in each of them. How do I draw a random sample of certain size (e.g. 50 rows) of just one of the 100 sections? The df is already ordered such that the…
WGP
  • 708
  • 2
  • 7
  • 18
43
votes
2 answers

Android sample bluetooth code to send a simple string via bluetooth

I want to send a simple string data such as 'a' from an android device to other one via bluetooth. I looked sample bluetooth code in android sdk but it is so complex for me. I cannot understand how I can send only specific data when I press a…
user3374956
  • 433
  • 1
  • 5
  • 5
43
votes
8 answers

Google Maps Android API v2 - Sample Code crashes

I'm trying to get the sample code of Android 'Google Maps Android API v2' working. I get the project built without errors. However, when I try to run the app on my Galaxy Nexus (connected with usb to my laptop), the app crashes immediately. I…
alexx
  • 603
  • 1
  • 6
  • 8
42
votes
5 answers

Error compile in "Use Facebook Login example"

I'm trying to create the Login Application in this tutorial: I'm getting this error in my logcat: 11-22 15:57:53.863: E/AndroidRuntime(816): com.facebook.FacebookException: Cannot use SessionLoginBehavior SSO_WITH_FALLBACK when…
Pootree Kun
  • 421
  • 1
  • 4
  • 3
36
votes
6 answers

How do i open a sample Android SDK app in Eclipse

I have created a basic program in Eclipse for Android 2.1. then I wanted to look at some of the samples, and import sample projects which are in the SDK directory. I have tried opening a new project and 'create project from existing source', I…
Mic
  • 361
  • 1
  • 3
  • 3
36
votes
4 answers

sample rows of subgroups from dataframe with dplyr

If I want to randomly select some samples from different groups I use the plyr package and the code below require(plyr) sampleGroup<-function(df,size) { df[sample(nrow(df),size=size),] } iris.sample<-ddply(iris,.(Species),function(df)…
Robert
  • 924
  • 1
  • 9
  • 20
33
votes
5 answers

Do any browsers support trailers sent in chunked encoding responses?

HTTP/1.1 specifies that a response sent as Transfer-Encoding: chunked can include optional trailers (ie. what would normally be sent as headers, but for whatever reason can't be calculated before the content, so they can be appended to the end), for…
Scott
  • 1,518
  • 1
  • 15
  • 23
32
votes
3 answers

How do you extract a few random rows from a data.table on the fly

I have a large data.table (about 24000 rows and growing). I want to subset that datatable based on a couple of criteria and from that subset (ends up being about 3000 rows) I want to randomly sample just 4 rows. I do not want to create a named 3000…
Farrel
  • 10,244
  • 19
  • 61
  • 99
1
2 3
99 100