Searching the image for text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Searching the image for text

Jimmie Houchin-3
Hello,

I have always wanted the ability to sometimes just search the image for
a string of text. Just like I would in an OS per se.

I might see a morph that has some text in it and I want to know the code
from whence it came.

Or any other number of reasons.

Is there a way to do this?

As Squeak is OS like in many ways, it seems like this would be there.

Any wisdom greatly appreciated.

Jimmie

Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

tblanchard
Also buried - in workspace, type text you want to find and select it.
Cmd click to get menu with 'do it' and friends.
Choose 'more...'
third or fourth section down is list of search options
Selectors with it
Strings with it
Source with it
Class names with it
etc.....

On Sep 21, 2007, at 4:03 PM, Jimmie Houchin wrote:

> Hello,
>
> I have always wanted the ability to sometimes just search the image  
> for a string of text. Just like I would in an OS per se.
>
> I might see a morph that has some text in it and I want to know the  
> code from whence it came.
>
> Or any other number of reasons.
>
> Is there a way to do this?
>
> As Squeak is OS like in many ways, it seems like this would be there.
>
> Any wisdom greatly appreciated.
>
> Jimmie
>


Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Michael Davies-2
On 22/09/2007, Todd Blanchard <[hidden email]> wrote:

> Also buried - in workspace, type text you want to find and select it.
> Cmd click to get menu with 'do it' and friends.
> Choose 'more...'
> third or fourth section down is list of search options
> Selectors with it
> Strings with it
> Source with it
> Class names with it
> etc.....
>

There's also a keyboard shortcut if you're looking for a string
literal; try selecting that text (eg in
a workspace) and pressing Cmd+Shift+e (on a mac, I think this
translates to Alt+shift+e on windows/linux). That should launch a
case-sensitive search for that string.

Cheers,
Michael

Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Brian Brown-2
In reply to this post by Jimmie Houchin-3
Alt/apple-shift-e after selecting the text.

- Brian



- Brian


On Sep 21, 2007, at 5:03 PM, Jimmie Houchin <[hidden email]>  
wrote:

> Hello,
>
> I have always wanted the ability to sometimes just search the image  
> for a string of text. Just like I would in an OS per se.
>
> I might see a morph that has some text in it and I want to know the  
> code from whence it came.
>
> Or any other number of reasons.
>
> Is there a way to do this?
>
> As Squeak is OS like in many ways, it seems like this would be there.
>
> Any wisdom greatly appreciated.
>
> Jimmie
>

Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Jimmie Houchin-3
In reply to this post by tblanchard
Todd Blanchard wrote:

> Also buried - in workspace, type text you want to find and select it.
> Cmd click to get menu with 'do it' and friends.
> Choose 'more...'
> third or fourth section down is list of search options
> Selectors with it
> Strings with it
> Source with it
> Class names with it
> etc.....
>
> On Sep 21, 2007, at 4:03 PM, Jimmie Houchin wrote:
>
>> Hello,
>>
>> I have always wanted the ability to sometimes just search the image
>> for a string of text. Just like I would in an OS per se.
[snip]

Thanks Todd and everybody.

That information will be very useful.

Jimmie

Reply | Threaded
Open this post in threaded view
|

RE: Searching the image for text

Sebastian Sastre-2
In reply to this post by Jimmie Houchin-3
Beside of the options said, there is Mercury a little morph that is meant to
do that

        cheers,

Sebastian Sastre

 

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En
> nombre de Jimmie Houchin
> Enviado el: Viernes, 21 de Septiembre de 2007 20:03
> Para: The general-purpose Squeak developers list
> Asunto: Searching the image for text
>
> Hello,
>
> I have always wanted the ability to sometimes just search the
> image for a string of text. Just like I would in an OS per se.
>
> I might see a morph that has some text in it and I want to
> know the code from whence it came.
>
> Or any other number of reasons.
>
> Is there a way to do this?
>
> As Squeak is OS like in many ways, it seems like this would be there.
>
> Any wisdom greatly appreciated.
>
> Jimmie
>


Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Jimmie Houchin-3
In reply to this post by tblanchard
 > On Sep 21, 2007, at 4:03 PM, Jimmie Houchin wrote:
 >> Hello,
 >>
 >> I have always wanted the ability to sometimes just search the image
 >> for a string of text. Just like I would in an OS per se.
 >>
 >> I might see a morph that has some text in it and I want to know the
 >> code from whence it came.
 >>
 >> Or any other number of reasons.
 >>
 >> Is there a way to do this?
 >>
 >> As Squeak is OS like in many ways, it seems like this would be there.
 >>
 >> Any wisdom greatly appreciated.
 >>
 >> Jimmie
 >>

Todd Blanchard wrote:
> Also buried - in workspace, type text you want to find and select it.
> Cmd click to get menu with 'do it' and friends.
> Choose 'more...'
> third or fourth section down is list of search options
> Selectors with it
> Strings with it
> Source with it
> Class names with it
> etc.....

Hello,

I just went to try this and in the latest squeak-dev image when I see
the above menu option they say:

Method strings with it
Method source with it

I knew I had multiple ways of searching source code, methods, classes,
etc. But there is also much in an image which isn't in source code.

Instance variable values are not source code but can be in an image.

What if I wanted to find an instance which had a variable which
contained a certain literal string? Can I do that?

While I am at it.

Can you find or browse the source code for things not created in a browser?

eg: Say someone more experienced than I wrote a small Class in a
Workspace. Possibly closed the workspace, possibly after creating an
instance of said Class. Would it show up in a browser? If not how would
you access such again?

Or access anything created in a Workspace and the particular text was
deleted or the workspace closed?

Thanks for any wisdom.

I'm sure I'm not the only one lacking understanding in these areas.

I don't know if any of this is covered in the SBE I am about to receive
or not. Or if stuff like this covered in other Smalltalk texts.

Again, thanks.

Jimmie

Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Jimmie Houchin-3
In reply to this post by Sebastian Sastre-2
Sebastian Sastre wrote:
> Beside of the options said, there is Mercury a little morph that is meant to
> do that
>
> cheers,
>
> Sebastian Sastre
[snip]

Thanks,

I don't know that I had seen that before. Some of the browsers don't
have it.

But if I had I wouldn't have thought to use it, as what I am wanting to
understand is how to search for those things that are inside of the
browser world.

I will have to spend some time using this little tool.

Thanks again for pointing it out to me.

Jimmie

Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Bert Freudenberg
In reply to this post by Jimmie Houchin-3
On Sep 22, 2007, at 15:52 , Jimmie Houchin wrote:

> What if I wanted to find an instance which had a variable which  
> contained a certain literal string? Can I do that?

Sure thing. All objects in the image are accessible and can be  
enumerated, and references traced. This is what inspectors and their  
friends are for. You need to get a reference to your String first:

        String allSubInstances select: [:s | s = 'Kernel']

Press Cmd-i to get an inspector on these strings, it's 11 in my  
image. Or use this to match substrings:

        String allSubInstances select: [:s | s includesSubString: 'Kernel']

Select one string, and in the menu select "objects pointing to this  
value". This will get you all objects referencing that string. From  
there you can continue to follow these references "backwards". A cool  
tool to do this is the pointer explorer from the same menu which lets  
you explore where objects are referenced from.

Btw, I once closed a valuable workspace with some long series of  
expressions in it. I used the #allSubInstances "trick" to get it back  
before the garbage collector could free it :)

> While I am at it.
>
> Can you find or browse the source code for things not created in a  
> browser?
>
> eg: Say someone more experienced than I wrote a small Class in a  
> Workspace. Possibly closed the workspace, possibly after creating  
> an instance of said Class. Would it show up in a browser? If not  
> how would you access such again?
>
> Or access anything created in a Workspace and the particular text  
> was deleted or the workspace closed?

There is no difference between classes created in a browser and those  
in a workspace. You have to understand that neither classes nor the  
browser is special - Everything Is An Object. The browser happens to  
be an object that manipulates class objects, just as you would do in  
a workspace.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Jimmie Houchin-3
Thank you, thank you, thank you.

Very informative and enlightening.

I will most definitely begin using this knowledge. :)

This is tremendous. Very, very sweet. :)

Thanks.

Jimmie

Bert Freudenberg wrote:

> On Sep 22, 2007, at 15:52 , Jimmie Houchin wrote:
>
>> What if I wanted to find an instance which had a variable which
>> contained a certain literal string? Can I do that?
>
> Sure thing. All objects in the image are accessible and can be
> enumerated, and references traced. This is what inspectors and their
> friends are for. You need to get a reference to your String first:
>
>     String allSubInstances select: [:s | s = 'Kernel']
>
> Press Cmd-i to get an inspector on these strings, it's 11 in my image.
> Or use this to match substrings:
>
>     String allSubInstances select: [:s | s includesSubString: 'Kernel']
>
> Select one string, and in the menu select "objects pointing to this
> value". This will get you all objects referencing that string. From
> there you can continue to follow these references "backwards". A cool
> tool to do this is the pointer explorer from the same menu which lets
> you explore where objects are referenced from.
>
> Btw, I once closed a valuable workspace with some long series of
> expressions in it. I used the #allSubInstances "trick" to get it back
> before the garbage collector could free it :)
>
>> While I am at it.
>>
>> Can you find or browse the source code for things not created in a
>> browser?
>>
>> eg: Say someone more experienced than I wrote a small Class in a
>> Workspace. Possibly closed the workspace, possibly after creating an
>> instance of said Class. Would it show up in a browser? If not how
>> would you access such again?
>>
>> Or access anything created in a Workspace and the particular text was
>> deleted or the workspace closed?
>
> There is no difference between classes created in a browser and those in
> a workspace. You have to understand that neither classes nor the browser
> is special - Everything Is An Object. The browser happens to be an
> object that manipulates class objects, just as you would do in a workspace.
>
> - Bert -
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Searching the image for text

Jason Johnson-5
In reply to this post by Bert Freudenberg
On 9/22/07, Bert Freudenberg <[hidden email]> wrote:
> On Sep 22, 2007, at 15:52 , Jimmie Houchin wrote:
>
> Btw, I once closed a valuable workspace with some long series of
> expressions in it. I used the #allSubInstances "trick" to get it back
> before the garbage collector could free it :)

Haha, nice.