Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

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

Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Rick Flower
I frequently use my VW image over an encrypted ssh connection using X11
forwarding which means that my screen updates are not horribly fast.
This causes a lot of problems with the above code highlighter for long
blocks of code -- particularly ones that it wants to paint as syntax
errors.  In this case, it can be painful to watch the hightlighting
taking place.  What I'd like to do is to be able to disable highlighting
whenever I want (for situations like this) and to re-enable it when I'm
at home working on a local system that is fast.. Is there any way to do
this?  I poked around in the package but didn't see anything outside of
perhaps killing the highlighting process.  Any ideas?

Thanks!

-- Rick

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Ladislav Lenart
Rick Flower wrote:

> I frequently use my VW image over an encrypted ssh connection using X11
> forwarding which means that my screen updates are not horribly fast.
> This causes a lot of problems with the above code highlighter for long
> blocks of code -- particularly ones that it wants to paint as syntax
> errors.  In this case, it can be painful to watch the hightlighting
> taking place.  What I'd like to do is to be able to disable highlighting
> whenever I want (for situations like this) and to re-enable it when I'm
> at home working on a local system that is fast.. Is there any way to do
> this?  I poked around in the package but didn't see anything outside of
> perhaps killing the highlighting process.  Any ideas?
Well,

we "solved" this with the following:

toggleRefreshDelay
        | longVariant shortVariant |
        longVariant := SmallInteger maxVal.
        shortVariant := OldRefreshDelay ifNil: 250.

        RefreshDelay :=
                RefreshDelay < longVariant ifTrue: [
                        OldRefreshDelay := RefreshDelay.
                        longVariant.
                ] ifFalse: [shortVariant].

This method can be anywhere, for example on the class side of
CodeHighlighter where the shared vars are defined.

Just to be sure, the trick is that after setting RefreshDelay to maxInt,
no highlighter process will ever do anything, because it is paused in its
wait part for quite a long time...

Hope this helps,

Ladislav Lenart

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Rick Flower
Ladislav Lenart wrote:

> Rick Flower wrote:
>> I frequently use my VW image over an encrypted ssh connection using
>> X11 forwarding which means that my screen updates are not horribly
>> fast. This causes a lot of problems with the above code highlighter
>> for long
>> blocks of code -- particularly ones that it wants to paint as syntax
>> errors.  In this case, it can be painful to watch the hightlighting
>> taking place.  What I'd like to do is to be able to disable
>> highlighting whenever I want (for situations like this) and to
>> re-enable it when I'm
>> at home working on a local system that is fast.. Is there any way to
>> do this?  I poked around in the package but didn't see anything
>> outside of perhaps killing the highlighting process.  Any ideas?
> Well,
>
> we "solved" this with the following:
>
> toggleRefreshDelay
>     | longVariant shortVariant |
>     longVariant := SmallInteger maxVal.
>     shortVariant := OldRefreshDelay ifNil: 250.
>
>     RefreshDelay :=
>         RefreshDelay < longVariant ifTrue: [
>             OldRefreshDelay := RefreshDelay.
>             longVariant.
>         ] ifFalse: [shortVariant].
>
> This method can be anywhere, for example on the class side of
> CodeHighlighter where the shared vars are defined.
>
> Just to be sure, the trick is that after setting RefreshDelay to maxInt,
> no highlighter process will ever do anything, because it is paused in its
> wait part for quite a long time...

Ladislav.. Thanks for the code snippet.. This looks like something that
would be nice to plug into the code-highlighter's settings window so it
can effectively turn it on/off with a nice mouse-click (if so desired).
  I might look into doing that if I've got a little bit of spare time..
Thanks!

-- Rick

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Martin McClure
In reply to this post by Rick Flower
Rick Flower wrote:

> I frequently use my VW image over an encrypted ssh connection using X11
> forwarding which means that my screen updates are not horribly fast.
> This causes a lot of problems with the above code highlighter for long
> blocks of code -- particularly ones that it wants to paint as syntax
> errors.  In this case, it can be painful to watch the hightlighting
> taking place.  What I'd like to do is to be able to disable highlighting
> whenever I want (for situations like this) and to re-enable it when I'm
> at home working on a local system that is fast.. Is there any way to do
> this?  I poked around in the package but didn't see anything outside of
> perhaps killing the highlighting process.  Any ideas?

I've found the biggest contributor to slow remote X connections is the
higher latency of remote connections, combined with the number of
network round trips that modern X requires.

By far the best solution I've found is a clever product called NX. It's
made by a company called Nomachine: http://nomachine.com/. It does X
compression and proxying to drastically reduce the number of network
round trips between the X client and the X server, with no modification
to either.

Their products are commercial, but are based on their own open-source
libraries that do the heavy lifting. With a little work, I was able to
download and build the source and get the thing running. What was
painfully slow before is now quite usable, almost as fast as running
locally.

I use NX for running VW remotely, and haven't noticed any slowness with
RBCodeHighlighting.

Regards,

-Martin

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Alan Knight-2
In reply to this post by Rick Flower
At 01:32 PM 8/17/2006, Rick Flower wrote:

>Ladislav Lenart wrote:
>>Rick Flower wrote:
>>>I frequently use my VW image over an encrypted ssh connection using X11 forwarding which means that my screen updates are not horribly fast. This causes a lot of problems with the above code highlighter for long
>>>blocks of code -- particularly ones that it wants to paint as syntax errors.  In this case, it can be painful to watch the hightlighting taking place.  What I'd like to do is to be able to disable highlighting whenever I want (for situations like this) and to re-enable it when I'm
>>>at home working on a local system that is fast.. Is there any way to do this?  I poked around in the package but didn't see anything outside of perhaps killing the highlighting process.  Any ideas?
>>Well,
>>we "solved" this with the following:
>>toggleRefreshDelay
>>    | longVariant shortVariant |
>>    longVariant := SmallInteger maxVal.
>>    shortVariant := OldRefreshDelay ifNil: 250.
>>    RefreshDelay :=
>>        RefreshDelay < longVariant ifTrue: [
>>            OldRefreshDelay := RefreshDelay.
>>            longVariant.
>>        ] ifFalse: [shortVariant].
>>This method can be anywhere, for example on the class side of
>>CodeHighlighter where the shared vars are defined.
>>Just to be sure, the trick is that after setting RefreshDelay to maxInt,
>>no highlighter process will ever do anything, because it is paused in its
>>wait part for quite a long time...
>
>Ladislav.. Thanks for the code snippet.. This looks like something that would be nice to plug into the code-highlighter's settings window so it can effectively turn it on/off with a nice mouse-click (if so desired).  I might look into doing that if I've got a little bit of spare time.. Thanks!
>
>-- Rick

Without going so far as that, you can just set the refresh interval to zero in the settings for the code highlighter (under Browser), and I think that would do what you want. You could also, of course, unload and reload the RBCodeHighlighting parcel. I suspect you'd want to close all browsers while doing that, though.
--
Alan Knight [|], Cincom Smalltalk Development
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Rick Flower
Alan Knight wrote:
> Without going so far as that, you can just set the refresh interval to zero in the settings for the code highlighter (under Browser), and I think that would do what you want. You could also, of course, unload and reload the RBCodeHighlighting parcel. I suspect you'd want to close all browsers while doing that, though.

Thanks Alan.. I hadn't thought of trying that yet.. I'll give it a shot
and if that doesn't cure my problem I'll look into one of the other
options already mentioned.. Thanks all!

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Travis Griggs
In reply to this post by Martin McClure

On Aug 17, 2006, at 11:25, Martin McClure wrote:

Rick Flower wrote:
I frequently use my VW image over an encrypted ssh connection using X11 forwarding which means that my screen updates are not horribly fast. This causes a lot of problems with the above code highlighter for long
blocks of code -- particularly ones that it wants to paint as syntax errors.  In this case, it can be painful to watch the hightlighting taking place.  What I'd like to do is to be able to disable highlighting whenever I want (for situations like this) and to re-enable it when I'm
at home working on a local system that is fast.. Is there any way to do this?  I poked around in the package but didn't see anything outside of perhaps killing the highlighting process.  Any ideas?

I've found the biggest contributor to slow remote X connections is the higher latency of remote connections, combined with the number of network round trips that modern X requires.

By far the best solution I've found is a clever product called NX. It's made by a company called Nomachine: http://nomachine.com/. It does X compression and proxying to drastically reduce the number of network round trips between the X client and the X server, with no modification to either.

Their products are commercial, but are based on their own open-source libraries that do the heavy lifting. With a little work, I was able to download and build the source and get the thing running. What was painfully slow before is now quite usable, almost as fast as running locally.

I use NX for running VW remotely, and haven't noticed any slowness with RBCodeHighlighting.

Martin, how is it compared to VNC? I just always use an XVNC server and do everything that way. Have you ever looked at the performance difference between the two?

--
Travis Griggs
Objologist
"It's [a spec] _the_ single worst way to write software, because it by definition means that the software was written to match theory, not reality" - Linus Torvalds



DISCLAIMER: This email is bound by the terms and conditions described at http://www.key.net/disclaimer.htm

Reply | Threaded
Open this post in threaded view
|

Re: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?

Martin McClure
Travis Griggs wrote:
>
> On Aug 17, 2006, at 11:25, Martin McClure wrote:

[...]

>>
>> I use NX for running VW remotely, and haven't noticed any slowness
>> with RBCodeHighlighting.
>
> Martin, how is it compared to VNC? I just always use an XVNC server and
> do everything that way. Have you ever looked at the performance
> difference between the two?

NX is *much* faster than VNC, at least in my experience.

-Martin

Reply | Threaded
Open this post in threaded view
|

FreeNX [was: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?]

Dave Stevenson-2
Martin,

Does NoMachine offer, and/or do you use a Win client to access a remote
linux application?  What about a MacX client?

I'm wondering how painful it would be to set up.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: FreeNX [was: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?]

Martin McClure
Dave Stevenson wrote:
> Martin,
>
> Does NoMachine offer, and/or do you use a Win client to access a remote
> linux application?  What about a MacX client?
>
> I'm wondering how painful it would be to set up.

NoMachine has clients (the X server end) for Linux, Windows, Mac OSX,
and Solaris. They have servers (the VW end) for Linux and Solaris.

I've only tried running Linux to Linux.

I downloaded the libraries and built from scratch then figured out how
to make a start script. That was the hard way. It looks like NoMachine
has more polished free stuff on their site now, which may be easier to
get running.

Regards,

-Martin

Reply | Threaded
Open this post in threaded view
|

Re: FreeNX [was: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?]

Martin McClure
Martin McClure wrote:
> I downloaded the libraries and built from scratch then figured out how
> to make a start script. That was the hard way. It looks like NoMachine
> has more polished free stuff on their site now, which may be easier to
> get running.

And of course their commercial packages (which I have not tried) are
supposed to be quite easy to get going.

-Martin

Reply | Threaded
Open this post in threaded view
|

Re: FreeNX [was: Any way to disable/re-enable code highlighting on-the-fly when using RBCodeHighlighting?]

Malte Zacharias
I have used NX in the past, it's really wonderful,
I used Gentoo as a server using the freenx-server (which uses nomachine's
GPLed libraries), thanks to emerge, it wasn't really hard at all.

Using the Windows Client also worked charming, with the freenx-server
you don't need any start scripts, as a client connecting starts his normal
session using ssh.

> > I downloaded the libraries and built from scratch then figured out how
> > to make a start script. That was the hard way. It looks like NoMachine
> > has more polished free stuff on their site now, which may be easier to
> > get running.
>
> And of course their commercial packages (which I have not tried) are
> supposed to be quite easy to get going.
>
> -Martin

--
Mit freundlichem Gruß,
Malte Zacharias

attachment0 (196 bytes) Download Attachment