I'm trying to create an android application which will generate random series of values (integer numbers in this case) in a given range (but NOT equal between them) and display them in a simple TextView
Let's say we have the range R = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
Each time I press the button "Generate" I want to randomly...
I have a scroll area and grid.
What I want is when the user clicked the save button and for example he/she is on the range of 21-30 rows, after the save button was clicked, the page will still remain on the 21-30 range.
It's because my page go back from the starting range when I clicked the save button which is from 1-10.
The cursor s...
With SUM for instance, I can do things like:
=SUM(F5:F7,F6:F8,A1,E7:G7,F7,2,7)
Which takes multiple ranges and/or individual cells and it adds them all up. My question is how do I do this with a VBA function, e.g. to generalize a binary XOR:
Function BXOR(A As Integer, B As Integer) As Integer
BXOR = CLng(A) Xor CLng(B)
End Func...
Say I plot the following in R:
library(ggplot2)
carrots <- data.frame(length = rnorm(500000, 10000, 10000))
cukes <- data.frame(length = rnorm(50000, 10000, 20000))
carrots$veg <- 'carrot'
cukes$veg <- 'cuke'
vegLengths <- rbind(carrots, cukes)
ggplot(vegLengths, aes(length, fill = veg)) + geom_density(alpha = 0.2)
Now say I only ...
I'm trying to write the following perl subroutine. Given are an array a of length n, an index i in the array (0<=i<n an upstream window length u and a downstream window length d.
I want to iterate over the values in the upstream window and the downstream window to i. In the simplest case, this will iterating over the values in a[i-u..i...
OK, this is as noob as it gets, but I still don't get why the lowest value a byte can take is -128. That the highest value is 127 I can understand, because it's 01111111 in binary, but how does one represent -128 with only 8 bit, one of which is used for the sign? Positive 128 would already be 8-bit, i.e. 10000000, and then you need a 9t...
I have an array in the following format:
array(
0 => array(1, 5),
1 => array(4, 8),
2 => array(19, 24),
3 => array(6, 9),
4 => array(11, 17),
);
Where each item is a X-to-Y range. What I would like to merge the overlapping ranges in the array, to get something more like this:
array(
0 => array(1, 9), // 1-5, 4-8 and 6-9 a...
Hello, i m a beginner but i need a script that could help me in some pages.
I need a script that analazizes the text in the page and if there is the word that i m searching for it shows a popoup, if not does nothing.
here s the code but it doesn t work with firefox because the text range function is only for IE (probably won t work eithe...
Does anybody know how to use range.setStart in the same way as range.moveStart works in IE? I'd like to implement backspace/delete in JS, something like this:
range.moveStart('character',-1);
range.deleteContents();
but in Firefox
...
Hello...
I was wondering if it is possible to perform a certain number of operations without storing the loop iteration number anywhere.
For instance, let's say I want to print two "hello" messages on the console. Right now I know I can do:
for i in range(2):
print "hello"
but then the "i" variable is going to take the values 0 ...
Hello,
I have a table with ~30 million rows ( and growing! ) and currently i have some problems with a simple range select.
The query, looks like this one:
SELECT SUM( CEIL( dlvSize / 100 ) ) as numItems
FROM log
WHERE timeLogged BETWEEN 1000000 AND 2000000
AND user = 'example'</pre>
It takes minutes to finish and i think that the s...
Ranges in ruby are pretty cool.
I end up with arrays such as this:
geneRanges = [(234..25), (500..510), (1640..1653)]
And subsequently have to remove bits of them. For that I:
genePositions = geneRanges.collect {|range| range.entries }.flatten
=> [500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 1640, 1641, 1642, 1643, 1644, ...
Hi,
Basic question here. I am using php(smarty) range to populate an array for days in the month.
$smarty->assign('date', range(1,31 ));
The form sends OK, but because counts start at 0, when I pick 20 from dropdown 19 gets sent in the form.
How do I set it so it starts at 1?
...
the (..) and (.. ..) operators in F# are unrolled at some point, is that a compile time operation or a run time operation?
in either case, what are the performance of this? i.e. is it possible to build a custom function that does those operations faster?
...
I've got a contenteditable div and a few paraprahs in it, as the code below.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="main" contenteditable="true" style="border:solid 1px black; width:300px; height:300px"><div>Hello world!</div><div><br></div><div>This is a...
I have a set of documents that all have a "timestamp" field which is stored as a long integer number. The field is indexed in my Lucene index as a number using NumericField with a precision step of 8: NumericField("timestamp", 8). This is done so I can do numeric range queries to retrieve all documents that fall within a specific time ...
I have a database of some 30k ranges, each is given as a pair of start and end points:
[12,80],[34,60],[34,9000],[76,743],...
I would like to write a Perl subroutine that a range (not from the database), and returns the number of ranges in the database which fully 'include' the given range.
For example, if we had only those 4 ranges ...
I'm learning Ruby, and have just gotten into some stuff about arrays and ranges. I've run into something about slices that, while it makes sense at first glance, confuses me a bit when i look deeper into it.
irb says that (2..-1).to_a is an empty array. Meaning no values in the range, right?
But if i use that same range in [:a, :b, :c...
I cant find any way to do this. What I have now is that it copy the range as an image:
Dim XLApp As Excel.Application
Dim PPSlide As Slide
Set XLApp = GetObject(, "Excel.Application")
XLApp.Range("A1:B17").Select
XLApp.Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
PPSlide.Shapes.Paste.Select
this works like a charm, b...
I have a range in java implemented as a class which is divided into sub-ranges. The implementation is roughly as follows:
public class Range
{
static public class Key implements Comparable<Key>
{
public int start;
public int end;
...
}
Key range;
SortedMap<Key, Range> subRange;
}
I want to make a func...