I'm not sure exactly how to explain this, so I'll just start with an example.
Given the following data:
Apple
Apricot
Blackberry
Blueberry
Cherry
Crabapple
Cranberry
Elderberry
Grapefruit
Grapes
Kiwi
Mulberry
Nectarine
Pawpaw
Peach
Pear
Plum
Raspberry
Rhubarb
Strawberry
I want to generate an index based on the first letter of my data...
Can anyone shed some insight onto why the following happens?
irb(main):001:0> r = '1'..'30'
=> "1".."30"
irb(main):002:0> r.each do |i|
irb(main):003:1* puts "#{i} : #{r.include?(i)}"
irb(main):004:1> end
1 : true
2 : true
3 : true
4 : false
5 : false
6 : false
7 : false
8 : false
9 : false
10 : true
...
(snip.. the String-numbers here ...
This is hopefully a very simple maths question. If I have two number ranges, what is the simplest and most efficient way to check if they clash, eg:
10-20 and 11-14 // clash as B is contained in A
11-15 and 20-22 // don't clash
24-26 and 20-30 // clash as A is contained in B
15-25 and 20-30 // clash as they overlap at each end
I curre...
Hi
Is it possible to use [Range] annotation for dates?
something like
[Range(typeof(DateTime), DateTime.MinValue.ToString(), DateTime.Today.ToString())]
Thanks
Davy
...
I have an Excel addin written in C# that imports a text file into Excel worksheet. Some of the fields in the file are text and some oare numbers.
Problem Steps:
Change the System's Regional Settings to Dutch (Belgium)
Open Excel and import the file into Excel. Records contain values such as 78,1118 which gets converted to 781.118. Not...
How can I make a programmatical page selection visible to the user, as if it was selected by the user?
var range = document.createRange();
var startPar = [some node];
var endLi = [some other node];
range.setStart(startPar,13);
range.setEnd(endLi,17);
Thank you.
...
EDIT: If you have an example in VBA, I'll take it. I'm just trying to understand how to use the Range object with the Tables collection to copy and paste multiple tables without looping. Put another way, how can I specify a range of 1..lastTable using the Tables collection? If I can see a working VBA example of this, I'll work on the VBA...
Hay guys
I've programmed a very simple range finder.
The user can only select numbers 1 - 180 (axis)
if the number is 90 or below i have to add 90 on to it
if the number is 91 - 180 i have to take off 90 from it.
Here's what i have
$min_range = range(1,90);
$max_range = range(91,180);
if(in_array($axis, $min_range)){
$c = $axis...
I'm using a hash table (DotNET Dictionary object) as part of a sparse two-dimensional data set. Most of the entries in the hash table will be close together. I'll probably end up with 100 ~ 10,000 entries, all of them clustered near zero. I've read that a Hash table performs better when the hashes are spread across the entire integer(32 ...
Hi,
In a template function, I like to determine the range for the value of its template type. For specific type, like int, INT_MAX and INT_MIN are what I want. But how to do the same for a template type?
Thanks and regards!
...
I'm trying to learn how to handle Range objects in Word VBA with regards to MS Word tables.
Using the Range object help, it would seem I can create a range of cells as long as the cells are contiguous, however I cannot seem to get the syntax for specifying the Start and End points of the range using cells.
For example:
Set rngCells = ...
xrange function doesn't work for large integers:
>>> N = 10**100
>>> xrange(N)
Traceback (most recent call last):
...
OverflowError: long int too large to convert to int
>>> xrange(N, N+10)
Traceback (most recent call last):
...
OverflowError: long int too large to convert to int
Python 3.x:
>>> N = 10**100
>>> r = range(N)
>>> r = r...
i have selected text from range object. is it possible to "select" text again, using the range object, if i deselect it (click somewhere) ? text is in iframe. thanks, here is code:
var iframe_window = window.frames["iView"];
iframe_content = iframe_window.document.getElementsByTagName("body")[0].innerHTML;
iframe_document = iframe_...
I have an implementation of the Zend Search (Lucene) framework on my website that contains an index of products with prices.
I am trying to allow customers to search for something, while contsraining the prices. Eg. Search for "dog food" between $5-$10 dollars.
My search index looks like this:
Keyword('name')
Keyword('price')
Lets sa...
FYI, I'm using Perl and Win32::OLE, but the error is a Word VBA one.
Using Perl's Win32::OLE module, I'm trying to create a table in Word and format certain elements of it. I created the table (15 x 3) and successfully created a range object pointing to the cells from (2, 1) to (14, 3), i.e. all cells except the top and bottom rows.
I ...
Hello,
My question is, how I can gain better control over this slider, because if I move over it
a couple of times then the slider slide's into a wrong position. Either below minimum value or above maximum value. I use the animate function.
The slider has three different positions and it has to do basicly two things.
1.calculate how...
What is the precise implementation of Enumerable.Range in .Net; preferable .Net 4? Is it a yielded for-loop? A custom implementation (IEnumerable, IEnumerator) or?
...
The IEE754 (64 bits) floating point is supposed to correctly represent 15 significant digit although the internal representation has 17 ditigs. Is there a way to force the 16th and 17th digits to zero ??
Ref:
http://msdn.microsoft.com/en-us/library/system.double%28VS.80%29.aspx :
.
.
Remember that a floating-point number can only appr...
While the following subrange enumeration declaration works:
type
TReceiptCode = 'A'..'F';
This does not:
type
TReceiptCode = ' ','A'..'F', 'R';
Nor does
type
TReceiptCode = ' ','A','B','C','D','E','F','R';
How can i declare a subrange type with non-contiguous values?
...
I've worked out a method to test if two one-dimensional line-segments/ranges.
So defining a range as:
[min, max]
Given two instances of range:
a = [min, max]
b = [min, max]
I use the following to test if they intersect:
(a.max - b.min) * (b.max - a.min) >= 0.
I think this is a one-dimensional cross-product, so my question is:...