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).
Related
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.
How do I shift a set of lines one space to the right within a text editor?
If I wanted to shift a set of lines several spaces to the right, I would perform:
selected text + Tab
However, I just want to shift the text one space to the right without tabbing.
Any suggestions?
Hold down the alt key, left-click and hold the mouse button down on the first line where you wish to insert your space. Then, while still holding down the left mouse button, drag the mouse vertically to extend this edit point to all the lines you want to move. Dragging it horizontally will create a box selection, which you want to avoid, as the selected text will end up being replaced, rather than a space be added.
Also, you cannot select individual, disjoint lines to move. You can only use alt-drag over a contiguous block of lines.
Once you have your multiline edit point created, hit the spacebar once.
Tada.
Here's a blog post by Scott Guthrie with more details and a vidya demo
If you don't want to use the mouse, you can use shift+alt+(up, down, left, or right) to create a box selection, or a multiline edit point.
Is it possible to change number of tabs and tabs name in simple UI Tab Control? How to do it? (user interface diagram)
I'm using EA 11.
No. Tab 1 | Tab 2 | Tab 3 is part of the element's image and you can't change them. There is a workaround which works visually, but won't help if you're looking to generate code out of your models.
Create a Text element (in the Common toolbox), and give it the name of your GUI's first tab.
Set a different default fill and text color for the Text element (Right-click and select Appearence - Default Appearance).
Pick the Fill and Border Color for the Text element that best matches the Tab Control's foreground, either in the diagram toolbar or the Text element's context menu.
Move and resize the Text element to cover Tab 1.
Repeat as necessary for the other tabs, using the appropriate color.
The Text elements are local to the diagram they're in and are not shown in the project browser (they are diagram objects but not proper model elements), but they move with the Tab Control so it works visually.
By making several copies of the Tab Control and varying which Text element has the foreground color, you can use this technique to show the different panes.
You can change number of tabs and selected tab this way (at least in EA 13):
Open Properties of the Tab Control;
In "General" select "Wireframing" tab. You'll see "Tabs" property with a value "Tab1";
Select this "Tabs" property and click on "Notes" menu. An editor appears;
In this editor you can change number of names of tabs;
Close editor and for "Tabs" property choose selected Tab;
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
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