range

Range Validation with Excel using C#

狂风中的少年 提交于 2019-11-29 15:39:53
I've been looking on the internet for 4 hours and I just can't do it. My objectives : create a combo where I can sort my items and when I click on one of them, the item appears alone. In Excel, easy to do, but I can't do it in C#. I found this answer : Other topic , but I can't understand where the "this.Controls" comes from. Thanks for your help if you want to use a validation for that purpose the following method was written by me to add a Validation and a small Infobox that appears when the user clicks on the cell: /// <summary> /// Adds a small Infobox and a Validation with restriction

How to select a node in a range with webkit browsers?

和自甴很熟 提交于 2019-11-29 15:20:18
I'm currently working on a WYSIWYG solution and need a function to correctly select with a range a node (by this I mean the node itself, not only it's content) DOM lvl2 clearly have a function for this w3.org/ranges and define that range.selectNodeContents() // Select the contents within a node and range.selectNode() //Select a node and its contents The problem is that when selectNode() perfectly work with Firefox or even ie9, it seem to be impossible to achieve with any Webkit browser (at last Chrome and Safari). On Webkit both selectNodeContents() and selectNode() select the node content

Python - Optimisation of Perfect Number search

痴心易碎 提交于 2019-11-29 14:54:50
p = [] for x in range(1, 50000000): count = 0 for y in range(1, x // 2 + 1): if (x % y == 0): count += y if (count == x): p.append(x) This is my code to try and find all the perfect numbers that originate between 1 and 50000000. It works fine for the first 3 numbers, they are between 1 and 10000. But as it progresses it becomes extremely slow. Like maybe going through 1000 numbers every 10 seconds. Then eventually going through 10 numbers every 5 seconds. Now is there anyway I could make this faster? I tried including some smaller things, like diving x by 2 to make sure we don't go over half

How to get specific Range in Excel through COM Interop?

安稳与你 提交于 2019-11-29 14:32:29
问题 i have the following problem. I have to read an excel file through COM interop. I am new to programming with COM interop. I search for a specific string using this: this.sheet = (Excel.Worksheet)this.excelApp.Workbook.Sheets.Item[this.sheetname]; this.sheet.Activate(); Excel.Range firstRow = this.sheet.Range["A1", "XFD1"]; Excel.Range foundRange = firstRow.Find( this.StringISearch, Type.Missing, Type.Missing, Excel.XlLookAt.xlWhole, Excel.XlSearchOrder.xlByColumns, Excel.XlSearchDirection

Select text just like “Ctrl+A” when clicking the text?

雨燕双飞 提交于 2019-11-29 14:12:17
I want to select the text in a paragraph when I click or double click the <p> tag. Not highlight, just like using mouse to make a select area to choose text to be selected! I have several paragraph and *.rar file link addresses on the page, and I want to select all the text when I click on one of them. I think the textbox could work that way but I like it to be in a paragraph or link tag. Is there a way to select all text in paragraph by clicking another element? Here's a function that will select the contents of the element you pass to it: function selectElementContents(el) { var range; if

Are upper bounds of indexed ranges always assumed to be exclusive?

我与影子孤独终老i 提交于 2019-11-29 14:04:40
So in Java, whenever an indexed range is given, the upper bound is almost always exclusive. From java.lang.String : substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1 From java.util.Arrays : copyOfRange(T[] original, int from, int to) from - the initial index of the range to be copied, inclusive to - the final index of the range to be copied, exclusive. From java.util.BitSet : set(int fromIndex, int toIndex) fromIndex - index of the first bit to be

Using an Array of Ranges in VBA - Excel

廉价感情. 提交于 2019-11-29 13:50:48
Does VBA support using an array of range variables? dim rangeArray() as range dim count as integer dim i as integer count = 3 redim rangeArray(1 to count) for i = 1 to count msgbox rangeArray(i).cells(1,1).value next I can't get it to work in this type of application. I want to store a series of ranges in a certain order as a "master copy". I can then add, delete, sort or do whatever to this array and then just print it out to a series of ranges in excel. It doesn't seem like excel supports this - it just forces you to store your data in the spreadsheet and you have to reread it in order to

about ruby range?

醉酒当歌 提交于 2019-11-29 13:26:55
like this range = (0..10) how can I get number like this: 0 5 10 plus five every time but less than 10 if range = (0..20) then i should get this: 0 5 10 15 20 Try using .step() to go through at a given step. (0..20).step(5) do |n| print n,' ' end gives... 0 5 10 15 20 As mentioned by dominikh, you can add .to_a on the end to get a storable form of the list of numbers: (0..20).step(5).to_a Like Dav said, but add to_a: (0..20).step(5).to_a # [0, 5, 10, 15, 20] The step method described in http://ruby-doc.org/core/classes/Range.html should do the job but seriously harms may harm the readability.

Alternative to CURLOPT_RANGE to grab a specific section

自古美人都是妖i 提交于 2019-11-29 13:09:20
I'm trying to use curl to fetch only a portion of a page so it will download less data thus making it quicker. I've been testing every possible option i can think of to no avail. The main one ive tried is defining a range: curl_setopt($ch, CURLOPT_RANGE, "0-4096"); The servers im trying this on are HTTP 1.1 but the setting has no effect as the entire page is pulled. Is there an alternative way to close the connection after X bytes in PHP or something along those lines? You can use your own write callback (CURLOPT_WRITEFUNCTION) and have that return an error once you've received enough data. An

iphone, using an array to define in core-plot range

我们两清 提交于 2019-11-29 13:08:13
I'm almost done with a core-plot graph I've been working on for a couple of day now. There is something I am still not able to do (and I cannot find documentation on this), is to change the x axis labels to what I need. Today, I have an x axis with integer label beeing displayed every 5 values: "5 10 15...", I need to have labels coresponding to the last 24 hours. For instance if it's 15:00, I would need labels like: "15 16 17 ... 23 0 1 2 .. 15" I was thinking of using a NSArray for this and passing it to the plotSpace.xRange but I do not know if this is the good way to do it. Here is my code