How do I perform a text search of a Squeak 3.7 image? - smalltalk

I have an image that runs on the 3.7 version of Squeak - I'd like to do a text search for strings and fragments of strings, over all classes, categories and selectors in the image. Is there a built in tool I can use for doing this sort of thing?

"method source containing it" (mentioned by Alexandre Jasmin) will include class comments, strings, selectors, and method source.
If the string might be contained in a method protocol name, I think you'd have to check programmatically. Something like:
Smalltalk allClasses select: [ :c |
c organization categories anySatisfy: [: cat |
'*substring*' match: cat ] ].

Select the text that you want to search for (generally from a browser or workspace).
Shift-Yellow Click on the text to show up a context menu.
That menu will contains among other things some advanced search options for the selected text string:
selectors containing it
method strings with it
method source with it
class names containing it
class comments with it
change sets with it

Related

Tabulator - formatting print and PDF output

I am a relatively new user of Tabulator so please forgive me if I am asking anything that, perhaps, should be obvious.
I have a Tabulator report that I am able to print and create as a PDF, but the report's formatting (as shown on the screen) is not used in either output.
For printing I have used printAsHtml and printStyled=true, but this doesn't produce a printout that matches what is on the screen. I have formatted number fields (with comma separators) and these are showing correctly, but the number columns should be right-aligned but all of the columns appear as left-aligned.
I am also using Tree View where the tree rows are coloured differently to the main table, but when I print the report with a tree open it colours the whole table with the tree colours and not just the tree.
For the PDF none of the Tabulator formatting is being used. I've looked for anything similar to the printStyled option, but I can't see anything. I've also looked at the autoTable option, but I am struggling to find what to use.
I want to format the print and PDF outputs so that they look as close to the screen representation as possible.
Is there anywhere I could look that would provide examples of how to achieve the above? The Tabulator documentation is very good, but the provided examples don't appear to explain what I am trying to do.
Perhaps there are there CSS classes that I am missing or even mis-using? I have tried including .tabulator-print-table in my CSS, but I am probably not using it correctly. I also couldn't find anything equivalent for producing PDFs. Some examples would help immensely.
Thank you in advance for any advice or assistance.
Formatting is deliberately not included in these, below i will outline why:
Downloaders
Downloaded files do not contain formatted data, only the raw data, this is because a lot of the formatters create visual elements (progress bar, star formatter etc) that cannot be replicated sensibly in downloaded files.
If you want to change the format of data in the download you will need to use an accessor, the accessorDownload option is the one you want to use in this case. The accessors transform the data as it is leaving the table.
For instance we could create an accessor that prepended "Mr " to the front of every name in a column:
var mrAccessor= function(value, data, type, params, column, row){
return "Mr " + value;
}
Assign it to a columns definition:
{title:"Name", field:"name", accessorDownload:mrAccessor}
Printing
Printing also does not include the formatters, this is because when you print a Tabulator table, the whole table is actually rebuilt as a standard HTML table, which allows the printer to work out how to layout everything across multiple pages with column headers etc. The downside of this is that it is only loosely styled like a Tabulator and so formatted contents generated inside Tabulator cells will likely break when added to a normal td element.
For this reason there is also a accessorPrint option that works in the same way as the download accessor but for printing.
If you want to use the same accessor for both occasions, you can assign the function once to the accessor option and it will be applied in both instances.
Checkout the Accessor Documentation for full details.

Where can I find a complete list of keywords (of the form ${ ... } ) that can be used in netbeans "code template"

The complete list of keywords that are legal in creating code templates in Netbeans would be accompanied by some documentation, making the "list" a reference. A line from the reference might look like:
${cursor} says to put the cursor at this point in the generated line
Working examples might be included in the reference, such as:
User-defined word to invoke the template: edfold
The template as it would appear in the Netbeans 8.2 RC > Tools > Options > Editor > Code templates tab:
${no-indent}//
// <editor-fold desc="***** ${cursor} *****" >
//
How it works: When I type edfold and hit the Tab key, the template is pasted into my document at the cursor position and looks like the following:
//
// <editor-fold desc="***** # *****" >
//
The cursor is positioned between the 5th and 6th asterisks that follow desc, so that I can then type whatever brief documentation that I wish, if any.
So where is the list of such keywords and their syntax and meaning? Such as:
${cursor}
${selection}
${no-indent}
${arg}
${Type}
and who knows how many more
It just hit me that there are OTHER keywords, two of which I unwittingly used above (I noticed them in someone else's code template and figured out how to use them):
desc
editor-fold
Surely there are other such identifiers to include in the reference.
By the way, the code template above is cute (or not) but is useless without a companion code template:
keypress:
endfold
Code template in editor:
// </editor-fold> ---------------- ${cursor} -------------------
Wherever the first inserted code template is located in your code, the second template must be below it. There is a "collapse" symbol "-" at the left of the first template. Clicking it collapses the code between the two templates. The symbol then changes to "+" and will expand the collapsed code when clicked.
EDIT
I just found this equivalent code template to the edfold and endfold pair just completed. Easier to code, up to a point, and harder to learn to use, but worth it, in the long run. Just highlight text to "hide" by folding, look for the line with the "Light Bulb", click Alt+Enter, and click "Code Folding". (Ctrl+Z to undo!)
But please see my (much better) Answer than this (was a) Question below.
Egg on my face... Googled topic, scanned all hits WAY too fast. In particular, "netbeans 8.2 code templates" pointed to this page involving PHP (think Java), which contained a lot of invaluable info about PHP that applies directly to Code Templates in Netbeans 8.2.
So, that link is part of a manual of sorts for learning how to create Code Templates for Netbeans 8.2 (in particular, and PHP in general).
The reference that I asked for--complete list of keywords (of the form ${ … } )--implies a list of all keywords or reserved words, like ${cursor} and ${selection} that permeate the list of provided Code Templates. But in a sense, that is the list. It is exactly those two Reserved Names. There are no others. Short list.
In the list of provided Netbeans Code Templates, there are a LOT of words that share the same $(...) syntax, but most are placeholder names or parameters that you decide the name and (probably-simple) meaning of.
If a code template contains, for example, class ${className}, the word class is Java code and ${className} is a parameter or placeholder. When the IDE expands the template, class is entered and ${className} turns into class_name, which the IDE automatically selects for editing, suggesting for you to enter the name of the new Java class being defined.
This non-trivial, but understandable, code template and much of what follows it explains much of the process for creating Code Templates. The heading Inserting the code template with code completion ends the explanation, but here is a sort of note of summary from further down:
The syntax of a "code template parameter" is a dollar sign, $, followed by the
parameter's definition between curly brackets {...}. Within this syntax, template
parameters have one of four forms:
* A reserved name that gives processing instructions to IDE (cursor or selection, only)
* An arbitrary placeholder name, such as ${SomeName}
* A descriptive parameter name [that hints at its meaning]
* Pre-defined parameters (??)

Jetbrains IDE: How to generate custom "todo" tags?

I have figured out how to download and install new color schemes.
It is after I did this that I noticed that IntelliJ will still color the following line yellow:
// ToDo: implement
Further, this coloration is independent of the color schemes I download. So, I now surmise that it is colored that way due to some logic specific to the Intellij.
I also use Pycharm and CLion, and suspect it would be the same situation across all three.
Here is the question: how do I access these settings/xml/logic and specify that I want say, 5 types of comment tags with colors A, B, C, D, E, such that I can call them by saying stuff like:
// T-A: File read in (t would be type)
// T-B: transform data
// T-C: linear section
// T-B: transform again
// T-D: parallel section
// T-E: MPI update
// T-B: array read in
// T-A: File read out
// etc.
So that I can basically color code the regions of a project, rather than just use the "ToDo" line?
You can go to Preferences | Editor | TODO. And there you can add / remove / edit your own patterns and filters, including color scheme:
After that, in your TODO window there's a Filter button with option to Edit filters, so you can easily find all places in your code with your custom patterns.
The problem was already answered quite well but I would like to add the usage of non-word tags like ???.
This requires to adopt the regex boundary character from \b (word boundary) to \B (non-word boundary). This leads to the final pattern \B\?\?\?\B.* to match:
code // ??? comment
code // ???: comment
This was not directly asked but may helps other with the same problem as I met...
See also https://www.jetbrains.com/help/idea/regular-expression-syntax-reference.html

Find All in a Textbox

I am working on an application to search for and build a list of all the times a string (or variable of) is in a text file. Kind of like a Find All function in a text editor that I can build a list with the info that is found, such as
S350
S250
S270
S5000
What can I use to do this search? It will have one value that does not change (The S in this case) followed by up to 4 digits
RegEx seems like a good choice.
Something like.. S(\d{1,4})? might work for you.
Expresso is my preferred regular expression composer.

Menuitem with only 1 underlined accelerator

I'm currently trying to add MenuItems to a Menu, which works almost perfect. The MenuItems I would like to add are paths to files, so they may contain "_", which sets the MenuItem an accelerator, but how do I stop mono setting this accelerator?
Example:
_1: /media/Auslagerung/Projekte/ace/sample_project.ace
The _1 at the start is the accelerator I want to set, the path behind should be used without underline. How do I realise this?
Thanks in advance!
Try escaping underscores with an extra underscore so they are not interpreted as mnemonics. In your example, insert an underscore after "/sample" so that the menu label string is:
_1: /media/Auslagerung/Projekte/ace/sample__project.ace
I haven't used GTK# but that is the method I used with GTK+ 2.10 in C. Hopefully it applies to mono.