I'm implementing a Google Map on a web-page. For the purpose of this project, I want to limit how far users can drag the map, so that they can only view a certain area that falls within two co-ordinates (one specifies north-west, the other, south-east, if you get my meaning).
What's the best way to implement this using the Google Maps A...
What's the most elgant way in Groovy to specify a range of integers and the 0.5 steps between them? e.g.: 1, 1.5, 2, 2.5, 3, 3.5, 4
Edit: To clarify: As an end result I need a range object for use in a Grails constraint. Though I suppose a list would be OK too.
...
I'm aware of the range iterators in boost, and as for this reference, it seems there should be an easy way of doing what I want, but it's not obvious to me.
Say I want to represent a numerical range, 0 to 100 (inclusive or not), say range(0,100). I would like to do something like:
for_each(range<int>(0,100).begin(), range<int>(0,100).e...
How to script a comparison of a number against a range?
1 is not within 2-5
or
3 is within 2-5
...
I need a function in php that will calculate the business week in a specific format within a given date range.
Example:
startDate = 02-03-2009
endDate = 31-12-2010
Mar 2-6
Mar 9-13
Mar 16-20
Mar 23-27
Mar 30 - Apr 3
Apr 6 - 10
and so on...
...
I feel like I'm using Ruby the wrong way here: I want to generate all possible matches for the regular expression /[0-9A-Za-z]{3}/
I can't use succ because "999".succ => "1000" and "zZz".succ => "aaAa".
I'm having trouble using ranges because I can't seem to union (0..9), ('A'..'Z'), ('a'..'z')
So I wrote:
def alphaNumeric
#range an...
Suppose i want to check 1.1 belongs to range 0 to 0.5 how can i do it?
with range i can do :
for i in range(0,0.5):
if i == 1.1:
print 'yes'
if i != 1.1:
print 'no'
Is ther any other way to do this ????
...
Let's say you have a set of ranges:
0 - 100: 'a'
0 - 75: 'b'
95 - 150: 'c'
120 - 130: 'd'
Obviously, these ranges overlap at certain points. How would you dissect these ranges to produce a list of non-overlapping ranges, while retaining information associated with their original range (in this case, the letter after the range)?
For ...
I'm trying to get all the DOM nodes that are within a range object, what's the best way to do this?
var selection = window.getSelection(); //what the user has selected
var range = selection.getRangeAt(0); //the first range of the selection
var startNode = range.startContainer;
var endNode = range.endContainer;
var allNodes = /*insert ma...
Hi, I'm writing a Range class at the moment and I'm looking for a good name for the common range [0->1]. If it was a vector of length 1, I would call it a Unit vector. Is there a clear name to give this range/interval? Possibly a Unit Range?
...
I am trying to iterate through the range(750, 765) and add the non-sequential numbers 769, 770, 774. If I try adding the numbers after the range function, it returns the range list, then the individual numbers:
>>> for x in range(750, 765), 769, 770, 774: print x
...
[750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 76...
From a VBS script I have to work with an Excel book with the format:
| A | B | C |
----|-----------|-----------|-----------|
1 | Header1 | Header2 | Header3 |
----|-----------|-----------|-----------|
2 | FOLDER1 | | |
----|-----------|-----------|-----------|
3 | Item1 |...
If I have two ranges that overlap:
x = 1..10
y = 5..15
When I say:
puts x.include? y
the output is:
false
because the two ranges only overlap partially.
But if I want it to be "true" when there is partial overlap between two ranges, how would I write that? In other words I need a way to know when one range contains a subset of...
In compiler data flow analysis, what is the difference between a live range of a variable and it's reaching definition? Both seem to refer to the same thing...
...
I'm in need of a datastructure that is basically a list of data points, where each data point has a timestamp and a double[] of data values. I want to be able to retrieve the closest point to a given timestamp or all points within a specified range of timestamps.
I'm using c#. my thinking was using a regular list would be possible, wher...
there is a way to get the last number in range i need to get the last number in fibonacci sequence for first 20 terms or can to do with a list instead range?
...
Hi
I have this following IEnumerable LINQ query:
var query = from p in Enumerable.Range(2, 1000000)
let sumofPowers = from ch in p.ToString()
let sumOfPowers = Math.Pow(Convert.ToDouble(ch.ToString()), 5)
select sumOfPowers
where p == sumofPowers.Sum()
select p;
It finds the sum of all the numbers that can ...
Is is possible to do this;
for i in range(some_number):
#do something
without the i? If you just want to do something x amount of times and don't need the iterator.
...
Using this very simple function:
Function WriteArray() as Variant
Dim array(0 To 2)
array(0) = "A"
array(1) = "B"
array(2) = "C"
WriteArray = array
End Function
I was expecting to see in result the whole array in my Excel spreadsheet, but that's not the case: I get only the first string. I know there is trick to show the whole ar...
Let's say I have a sequential container, and a range (pair of iterators) within that container of elements that are currently 'active'. At some point, I calculate a new range of elements that should be active, which may overlap the previous range. I want to then iterate over the elements that were in the old active range but that are not...