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
10
votes
6 answers

SampleSyncAdapter Breakpoints Not Working

I'm using Eclipse to learn how the SampleSyncAdapter example works. I can't get my breakpoints to work. I set a breakpoint in multiple locations but none get hit. For example, AuthenticatorActivity.onCreate() never get's called. Anyone know…
Mitch
  • 1,716
  • 3
  • 25
  • 41
10
votes
3 answers

Why so few full database schemas sample online?

It is a bit strange to me about database schemas sample which I think most of the projects will need to design a database for it. but when I try to find sample online, it is really rare (eg. full database schema for Inventory Management, School…
pang
  • 3,964
  • 8
  • 36
  • 42
10
votes
7 answers

Sample from a data frame using group-specific sample sizes

I want to sample rows from a data frame using unequal sample sizes from each group. Let's say we have a simple data frame grouped by 'group': library(dplyr) set.seed(123) df <- data.frame(group = rep(c("A", "B"), each = 10), value…
user213544
  • 2,046
  • 3
  • 22
  • 52
10
votes
3 answers

R: how to sample without replacement AND without consecutive same values

I have spent over a day trying to accomplish what seems to be a very simple thing. I have to create 300 'random' sequences in which the numbers 1,2,3 and 4 all appear exactly 12 times, but the same number is never used twice 'in a…
CookieMons
  • 103
  • 3
10
votes
3 answers

Can't import or create new project from samples or downloads on Android/Eclipse

Basically, I need help importing downloaded source or creating a project from sample source programs. I'm looking for step by step instructions for both if anyone can point me there or post the steps. I'm very new to Android/Eclipse. I have the…
Lark
  • 101
  • 1
  • 4
10
votes
2 answers

Get country code using javascript

I can't figure out how to get a country code from a visitor that goes to my webpage. I have seen plenty of other examples but none use plain Javascript. Here is my current code:
702cs
  • 331
  • 1
  • 4
  • 13
10
votes
1 answer

Sample dBase files

I am working on a program that will need to read different dBase files. I can only seem to find dBaseIII plus files for testing. Does anyone know where I can find a test pack or something? I need to test this code on different versions of dBase.
user3847280
  • 137
  • 1
  • 1
  • 8
9
votes
5 answers

Is there a pythonic way to sample N consecutive elements from a list or numpy array

Is there a pythonic way to select N consecutive elements from a list or numpy array. So Suppose: Choice = [1,2,3,4,5,6] I would like to create a new list of length N by randomly selecting element X in Choice along with the N-1 consecutive elements…
phntm
  • 511
  • 2
  • 11
9
votes
1 answer

How to use sample weights in GAM (mgcv) on survey data for Logit regression?

I'm interesting in performing a GAM regression on data from a national wide survey which presents sample weights. I read with interest this post. I selected my vars of interest generating a DF: nhanesAnalysis <- nhanesDemo %>% …
Borexino
  • 802
  • 8
  • 26
9
votes
1 answer

Android: Mixing multiple AudioTrack instances?

I need to run two instances of AudioTrack at the same time. They must run separately because I'm playing them at different, variable sample rates. I found that if I run them in the same thread, they "take turns". I'm running them each in their…
BTR
  • 4,880
  • 4
  • 24
  • 21
9
votes
5 answers

A modern n-layer asp.net web application sample?

So my asp.net is very very rusty, and i'm trying to get back into best practices and what not. So, I whip out google and start looking for examples and samples and tutorials, but what do I find? Old crusty stuff that tends to be written even…
Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
9
votes
2 answers

64-bit Quicktime Question

Does anyone out there know if there is a way to pull raw, still-compressed audio and video samples out of a Quicktime .mov file using an Apple API / Framework targeting the Mac that can be compiled natively in 64-bit (IE: QTKit)? I know this…
9
votes
1 answer

Play multi-instrument MIDI file IOS

I'm trying to write a simple midi player with a quality sound bank but I'm faced with the problem of playing midi files. The problem is that all midi tracks (drums, pads, bass, synth, etc.) played, but they play a single instrument. I found a…
John
  • 151
  • 6
9
votes
1 answer

postgres random using setseed

I would like to add a column with a random number using setseed to a table. The original table structure (test_input) col_a,col_b,col_c Desired output (test_output) col_a, col_b, col_c, random_id The following returns the same random_id on all…
user3416355
  • 99
  • 1
  • 1
  • 2
8
votes
2 answers

How to sample from DataFrame based on percentile of a column?

Given a dataset like this: import pandas as pd rows = [{'key': 'ABC', 'freq': 100}, {'key': 'DEF', 'freq': 60}, {'key': 'GHI', 'freq': 50}, {'key': 'JKL', 'freq': 40}, {'key': 'MNO', 'freq': 13}, {'key': 'PQR', 'freq': 11}, {'key': 'STU',…
alvas
  • 115,346
  • 109
  • 446
  • 738