Display paired lists - app-inventor

I want to display two paired lists with an input -> output setup. For example, list one might be (a,b,c,d,e) and the second might be (1,2,3,4,5). The user should be able to scroll both lists at once. That way the user can see which pairs match up. It would be nice if the user could drag and drop to sort the list, but that isn't a requirement, I can make do without it.
I tried Taifun's sortable list, but I can't scroll two of those lists together.
I have also tried two list views inside a horizontal arrangement inside a vertical scroll, with the list view heights as automatic, so they are as tall as the elements inside so that the vertical scroll can move up and down instead. The problem with that is when the list view height is set to automatic, it doesn't change sizes to fit its elements.
Does anyone know how to do this?

I decided to use the following setup, and I am pretty happy with how it turned out.
When the user presses "Add item", they can enter an input (segment) and output (replacement). The items show up on a sortable list view, separated by a special dash character so I can break them back up into two paired lists. If someone tries to use that dash, theirs is replaced with a normal hyphen (-). Because the list view trims spaces, the first leading and the last trailing spaces (if any) are replaced with a caret and converted back when saving (^). When the user presses delete, a normal list view appears where the user can click on a pair and is prompted to delete it. The Settings button in the screenshot is just a back button to the main settings menu.
I hope this helps anyone looking for a way to display two paired lists together while avoiding the problems of scrolling and an overly complicated UI.

Related

What does the round icon inside Xcode's filter fields mean?

Maybe I'm just me that don't grasp the meaning of a simple thing, but I really can not understand the meaning of the round icon that is next to the search field of the panel objects of Interface Builder of Xcode. Someone would know help me?
That is the filter icon for Xcode, used to filter a list that is already showing.
In each filter field that's available you don't have to enter the beginning of the name to get a match. The most powerful of all the filters is the Quick Find feature (shown at the bottom), which doesn't even require the characters to be adjacent, for a match to be successful.
Did you know that you can also filter method names that appear at the top of your Editor?
Tap on the popup button:
Start typing to filter the list. As you can see, the entered characters don't have to be adjacent to produce matched results:
Contrast that to the search icon, visible at the top of the Find navigator panel:
There is also a filter field at the bottom of the Find navigator, to enable filtering through search results. I think it is supposed to resemble a half-filled magnifying glass, but it is missing the handle:
A filter field is also at the bottom of the Project navigator:
And, let's not forget about the filter field at the bottom of each of the library panels (Template library, Code Snippet library, Object library, and Media library). That really comes in handy, especially with all the UI components available on Mac OS:
But if you have a lot of files in your project, then I recommend using Quick Find (Shft-Cmd-O). You can type any letters for what you're looking for, and it digs up results of several types of objects, including file names and method names. It performs a powerful regex-style search that doesn't require the entered characters to be adjacent in the matched results. Notice that there is no filter icon here, because a list is not displayed before you begin filtering:

sublime text: view off-screen multiple selections

When I do a multiple selection from, say, the find dialog (Alt-Enter), I sometimes find that many of the selected bits are off screen, but I'd like to check the context of all of them before I start doing a multiple edit.
Is there a way to, say, cycle through them in the view (without disrupting the selections)?
Probably the easiest way is to not do a "Find All", but instead highlight (or do a single Find) what you're looking for, then use ⌘D on OS X/CtrlD on Win/Lin to sequentially add the next matches. If you come to a match you don't want to select, just use ⌘K,⌘D (or CtrlK,CtrlD) to skip the current instance and go on to the next one. ⌘U (CtrlU) is "soft undo", it moves back to the previous selection in case you made a mistake.
Alternatively, I use a color scheme with a very bright selection color (it's bright blue surrounded by bright green) so that selected regions are very easy to identify. This way I can just glance at the minimap and see where selections are, and scroll through my file quickly to ensure everything looks good. If you find a selection you don't want, you can deselect it with Alt+middle mouse button on Win/Lin, or by ⌘Shift+click on OS X. You may need to set "drag_text": false in your Preferences for it to work, though (I'm not on my Mac at the moment to test).
I've found a working solution, but it's not ideal and only works if you're ok with losing the selections (eg: with multiple selections, hit Right Arrow - you've still got multiple cursors, but the selections are gone).
It goes like this:
Make sure there is no code folding - it appears to interfere with this sort of manipulation of multiple selections.
Use altEnter in the search dialogue to select all occurrences of your regex.
Scroll through the selections until you find one you don't want (MattDMo's Neon plugin is helpful here).
Use a cursor movement to lose the selections (multiple cursors remain).
Use Alt+Left Click on the undesired cursor.
Repeat 5. as required. Making another (multiple) selection can be helpful here to locate the other cursors (eg: Control/CommandShiftLeft Arrow)
If you remove a cursor by mistake, or need to add one, use Control/Command+Left Click

Change item order in plist file

I want to change order in plist file not programmatically but from xcode. Is there a way in Xcode where i can sort by value? I simply want to arrange it for myself. For now if i want add new item it will always goes to tail.
How to sort it ? To 100 value go to the top?
Here is the (mildly infuriating) answer, at least in the case of Items in a Settings.bundle's plist, which I realize was not the OP's situation.
To arbitrarily reorder items in a plist:
Target the row by clicking within the Value column. The left-most columns don't allow dragging.
Drag into the first ~64 pixels of the Key column. A blue line appears to indicate where the row will appear when you let go.
Here's a demonstration in Xcode 9.2.
As if that's not already super confusing…
Preference Items, Vertical Drag
You can drag and drop vertically (i.e., without entering the Key column), but only if your goal is to move the item to be first in the list.
Apple Clearly Knows How to Do This
Once you open an Item, elements within it can be dragged and dropped exactly as you'd expect.
Wat!? Yeah. This doesn't need to be so painful, but it's likely to remain this way unless folks get up in arms which, once you know the workaround, it's hard to do. But in case you're feeling sufficiently incensed, make your voice heard: http://bugreporter.apple.com. (Fwiw, here's my Open Radar.)
Your can edit a plist file with an text editor. Right click on plist file -> open as -> source code.
and i think you have to put you strings in an Array

Cells & cellgroups in mma

This question and the comments and answers prompted this question. How do I effectively use Cells and CellGroups in mathematica? I've always only programmed systematically inside the input cells, entering the next line in a new cell after evaluating the previous. Looking around at the different options available, this seemed inefficient.
How do I use these more effectively? I tried organizing my code into sections using command-5 and into subsections, etc. But then when I try to get back to input cell with command-9, it doesn't evaluate it. I'm sure I'm doing something wrong, so help is appreciated.
Cell groups are just that, a way to group cells together. These groups can be easily selected, executed as one, and opened/closed (collapsed). By default these groups are indicated by a series of blue brackets to the right of the cells:
As seen above, output cells are automatically grouped with the input cell that created them. Also, the Section cell automatically groups the Text, Input, and Output cells below it. Finally the Title cell groups all cells below it, including the Section cell.
The different classes of cells that are available, such as Title, Section, etc., are determined by the active Stylesheet. The way they group is controlled by the option CellGroupingRules. This is a more advanced area, and details are probably better addressed in a different question.
Cell Grouping can be done either automatically, the default, or manually, or to a limited extent by a combination thereof. This is all handled by the menu commands in Cell > Grouping > ... or the keyboard shortcuts listed there.
If using Automatic Grouping, then styling a cell in a style that groups (as controlled by CellGroupingRules) will automatically group "lesser" cells and cell groups beneath it.
To style a cell, select the entire cell, not just the cell contents, by either:
clicking on the blue cell bracket (or the area where it would be if it is hidden)
clicking within the cell and using Alt+. until the entire cell is selected
clicking and dragging from above the cell, where the cursor is horizontal, to below the cell
Then, use menu Format > Style > ..., or the corresponding key combinations.
The same methods can be used to select cell groups, rather than individual cells.
To create a new cell of a particular style:
click outside of existing cells where the cursor is horizontal
this should create a horizontal rule as shown in earlier illustration
specify a style, again with Format > Style > ... or keyboard shortcuts
start typing (or paste) the contents of the new cell
To create a new Input cell, the default style, simply do step (1) and then type or paste the input.
It depends on your stylesheet. Input is not the nineth numbered style in every stylesheet. Also, you have to select the cell bracket to change a cell's style.
I use sections particularly to be able to use folding, i.e. the double clicking on the cell group bracket to hide the lower ranking cells. That makes for a clean document. It doesn't do anything with the Input cells (except for the context option).

Conventions for the behavior of double or triple "click to select text" features?

Almost any mature program that involves text implements "double click to select the word" and, in some cases, "triple click to select additional stuff like an entire line" as a feature. I find these features useful but they are often inconsistent between programs.
Example - some programs' double clicks do not select the ending space after a word, but most do. Some recognize the - character as the end of a word, others do not. SO likes to select the entire paragraph as I write this post when I triple click it, VS web developer 2005 has no triple click support, and ultra-edit 32 will select one line upon triple clicking. We could come up with innumerable inconsistencies about how double and triple click pattern matching is implemented across programs.
I am concerned about how to implement this behavior in my program if nobody else has achieved a convention about how the pattern matching should work.
My question is, does a convention (conventions? maybe an MS or Linux convention?) exist that dictates how these features are supposed to behave to the end user? What, if any, are they?
I don’t believe there is a standard to the level of specification you want, and there probably shouldn’t be. Apple Human Interface Guidelines are the most complete. With respect to selecting content (as opposed to controls or discrete data objects), they say:
Double-clicking is most commonly used as a shortcut for other actions, such as… to select a word. Triple-clicking selects the next logical unit, as defined by the application. In a word-processing document, triple-clicking in a word selects the paragraph containing the word…. Double-clicking within a word selects the word. The selection should provide “smart” behavior; if the user deletes the selected word, for example, the space after the word should also be deleted… In some contexts—in a programming language, for example—it may be appropriate to allow users to select both the left and right parentheses (or braces or brackets) in a pair, as well as all the characters between them, by double-clicking either one of them.” (p115-116)
Apple is quite specific about what characters are and aren’t included in a word.
Microsoft’s Windows User Interaction Experience Guidelines say:
For some types of selectable objects, each click expands the effect of the click. For example, single-clicking in a text box sets the input location, double-clicking selects a word, and triple-clicking selects a sentence or paragraph. (p430)
Java Swing Look and Feel Design Guidelines say:
Double-clicking (clicking a mouse button twice in rapid succession without moving the mouse) is used to select larger units (for example, to select a word in a text field)…. Triple-clicking (clicking a mouse button three times in rapid succession without moving the mouse) is used to select even larger units (for instance, to select an entire line in a text field)…. A triple click in a line of text deselects any existing selection and selects the line.
The Gnome Human Interface Guidelines don’t say much about what double- and triple-clicking should do.
This gives you the freedom to choose whatever is best for your users. Double and tripling clicking are expert shortcuts, so their behavior should aim to maximize efficiency. Consider why the user is selecting something and design to make that easiest and fastest.
For example, apparently the rationale behind including the trailing space when double-clicking a word is that users usually select a word in order to copy or paste it in another position in the text. This implies you automatically include the trailing space in order keep the user from having to manually delete a remaining extra space at the source and add a word-separating space at the destination.
Likewise if users are selecting a line of code or paragraph to copy or move it somewhere else, then you probably want to include the newline characters so the user isn’t left with an empty line at the source and force to manually add a newline at the destination (assuming they didn’t want to take the line/paragraph and combine it with another line/paragraph.
If selection is for something other than copying and moving text in sentences, then none of this may apply and you don’t necessarily want to include trailing spaces or newlines. That’s why there shouldn’t be a standard.
An alternative is to do what Apple calls Intelligent Cut and Paste (see the Human Interface Guidelines), or Microsoft Word’s Smart Cut and Paste, where spaces, newlines and other adjustment are algorithmically figured out when cutting, copying, pasting, and deleting, not when selecting.
In my perfect world I would have it work like this.
Double click on a word selects the word only (a word according to the grammar rules of the locale), no trailing space (this is for easier copying between programs so that I would not need to remove any spaces when pasting)
If I remove the selected word my text editor is aware of my content and removes any additional spaces left over
A triple click selects a line with no trailing newlines. (A paragraph is a long line that has been wrapped)
In Windows, Linux and OS X double-click selects the word under cursor triple-click selects the entire line of text (single line only, i.e., wrapped line)
Finding answers and come up with a alternative solution:
I like to write code or command in text, and copy them to shell prompt without the ending \n
1. use notepad
2. surround each line with ()
3. use ctrl + double click.
Fine...

Resources