selection

Combinations of Multiple Vector's Elements Without Repetition

Hi, I have n amount of vectors, say 3, and they have n amount of elements (not necessarily the same amount). I need to choose x amount of combinations between them. Like choose 2 from vectors[n]. Example: std::vector<int> v1(3), v2(5), v3(2); There cannot be combinations from one vector itself, like v1[0] and v1[1]. How can I do this...

Can an individual RadGrid row be selectable based upon a condition?

I have a RadGrid that has a GridClientSelectColumn. I have the AllowRowSelection setting set to true. Is there a way on the server end that I can conditionally set whether an individual datarow in selectable or not? I want some rows to be selectable on the client-side, but not others. Thanks! ...

Actionscript Freehand Selection Routine

I'm working on a visualisation interface that will display a number of points in a 2D graph, and I'd like a way for the user to be able to select any number of points. Does anyone know a freehand (lasoo) selection method would be implemented? A square or circular selection is relatively simple, but storing the selection and calculating ...

How do I set a backwards selection?

I'm working on a custom tokenfield based on textarea. The idea is to have a textarea with div elements absolutely positioned above, so it looks like they are in text area. It was pain so far, but I managed to do pretty much everything, except one thing. Is it even possible in javascript to set reverse-selection? When you put a cursor s...

iPhone Dev: triggering Copy function UIResponderStandardEditActions for selection on UIWebView

Greetings! Please kindly give me some advice on the following requirement: To select a text from a page loaded on a UIWebView To trigger the Copy function using another button instead of the standard Copy from the UIMenuController What I would like achieve is basically the storing of the highlighted/selected text into a persistence....

Comparing 2 elements of a 3x3 matrix to see if element 2 is adjacent to element 1.

Basically, I'm creating a puzzle where you can swap pieces. And I want to make sure that when swapping 2 elements, the selection is valid. Since the puzzle is only 9 pieces (3x3), I am currently using the code: function valid_selection(p1, p2) { if (p1 == 1 && (p2 == 2 || p2 == 4)) return true; if (p1 == 2 && (p2 == 1 || p2 == ...

iPhone Development: Grabbing selected/highlighted text on UIWebView

Greetings, Please kindly advice on how possibly I can get the selected text on UIWebVIew. I went on to search on how to deal with selected/highlighted text and found the following: Selection and Menu Management To copy or cut something in a view, that “something” must be selected. It can be a range of text, an image, a URL, ...

Eclipse RCP: Determine mouse button that caused selection on SelectionChanged Event.

I have a class that implements ISelectionListener. I want to determine when the user right clicked when the selection was made. This is the method that I need to implement to handle selection changes: public void selectionChanged(IWorkbenchPart part, ISelection selection) { //HOW? // if right clicked... do something // else .. do defa...

How to do Selection Alignment using the RichTextBox in Silverlight 4?

I cannot seem to figure out how to do a Selection Alignment in the new RichTextBox, I have an idea that I need to convert the selection into the Paragraph type which supports alignment, but cannot seem to figure this out. None of the Silverlight examples have this, but I'm sure it is possible. I have this code, that does not work - as I ...

How can i produce a select handle by css

hi guys... I want to produce a sort of select/resiz border when some on click on the div, and when i move mouse over that the cursor should change accordingly. I want the user to be able to drag the element border and the element re-size accordingly thanks.... ...

Set textarea selection in Internet Explorer

I'm looking for a way to set a selection in a textarea in Internet Explorer. In other browsers, this works just fine: textarea.selectionStart = start; textarea.selectionEnd = end; In IE, I assume I have to use createRange and adjust the selection somehow, but I cannot figure out how. Extra bonus points for a link to a proper document...

WPF Toolkit: how to scroll datagrid to show selected item from code behind?

I tried following, all of following fails on function ScrollIntoView and gives NullReferenceException. // doesnt work grid.SelectedItem = sItem; grid.ScrollIntoView(sItem); // doesnt work grid.SelectedItem = sItem; grid.Focus(); grid.CurrentColumn = grid.Columns[0]; grid.UpdateLayout(); grid.ScrollIntoView(sItem,grid.Columns[0]); // d...

DataGridView: Keep selections after datasource is changed?

Is there a way to keep the selected cells of a DataGridView selected after the DataSource is changed? ...

select mulitple items with JS

I have a bunch of divs (i'll call them items). Most have an image in them but having an image doesnt matter. How can i select these items, have the item show some way of being selected (i was thinking having padding which changes color?) and allow me to add more by hold ctrl and left click or by left clicking which creates some kind of m...

textarea::selection and ::-moz-selection

Is there a way to apply the ::selection and ::-moz-selection css pseudo-classes to the text inside a textarea? textarea::selection { color: #ff0000; } Isn't working ...

WPF Datagrid Multiple Selection without CTRL or Space

The WPF Datagrid has two selection modes, Single or Extended. The WPF ListView has a third - Multiple. This mode allows you to click and select multiple rows without CTRL or Shift being held down. Anyone know how to do this for the datagrid? ...

Algorithm to implement a lasso selection tool?

I am developing a Mac OS X application which, as part of it's UI, will display many visual elements in it's main view which can be selected. These elements can be positioned really anywhere within the view. The UI will support various ways of selecting the elements: rectangular marquee selection, elliptical marquee selection, and 'free' ...

jquery won't work in multi level dependency?

$(document).ready(function() { $("#ddlprod").change(function() { var pk= $("#ddlprod").val(); $.ajax({ url: "ajaxprintdropdown.php", type: "POST", data: 'pk='+pk, timeout: 5000, success: function(output) { $('#divtesting').show...

Interview test for applied scientific computing job

Do you know a good and objective question/test to examine applicants for a scientific computing job? (In fact, this test comes after the candidate passed an interview.) 1st) They need to be intelligent. (Edit, thanks for the words from Trent) 2nd) They would have to deal mostly with programming (C++ and Python, using scientific librar...

WinForm: Selection box flickers when dragging the mouse

Hi. I made a click-drag selection box in a picture box. In the picturebox Paint event hander I use e.Graphics.DrawRectangle(pen, rectangle); and update the rectangle and refreshe the picturebox in the mouse move event handler. The selection box looks smooth as long as the mouse remains at the bottom-right corner (i.e. drag to right/b...