How to avoid Clozure freeing when I paste into the Listener? - ide

Sometimes I do a paste of text into the wrong place in the Listener window while using Clozure. When that happens a window from AltConsole pops up and informs me
> Error: Can't modify protected buffer region.
> While executing: HEMLOCK-INTERFACE:EDITOR-ERROR, in process Initial(0).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 >
The problem is I don't know how to get out of the AltConsole window without Clozure freezing. Aside from this not being too friendly to new users, how do I get out of the AltConsole and back to working in Clozure?

Related

How to make the SSIS package status to failure when propagate was set to false for a Sequence container

I have an SSIS package with for each loop > sequence container. The sequence container is trying to read file from For each loop and process its data. The requirement was to not fail the entire package when any exception happened in processing a file but to continue processing the next file until all the files were processed from the for each loop. For this, I have set the Propagate variable for the sequence container to False. I have also added email step on On Error event of Sequence container. The package is running as expected and able to process all files even when any exception happened with any file. But I would like the status of my SSIS package to be failed finally since one of the files got failed. How can I achieve that ?
Did you try this options?
(SSIS version in russian on the left side but it's sequence container)
View -> Properties window -> Then click on your sequence container and it will show you ther properties of sequence container.
If i were you first of all i would try property "FailPackageOnFailture" - it should cover your question if i get it right.
P.S. Also you can see the whole properties of your project when you click on a free place in your project
UPDATED (after comments and more clear understanding task):
The idea is - set this param Maximum ErrorCount for SQ as max as you want - in this case it wont stop the package because 1 of the files was failed in SQ and next file will process, but it should stop package after SQ will finish his work because you don't change MaximumErrorCount for package.
Important - a value of zero sets the error count threshold to infinity and package or task never get's Failure

SDL_CreateWindowFrom vs SDL_DestroyWindow X11 error SDL2

I get a window ID from the command line, and create an SDL window with it:
Window window_id = from_cli(); // e.g. 0x34000c8
w = SDL_CreateWindowFrom((void*) (Window) window_id);
When my program finishes I try to clean up:
SDL_DestroyWindow(w);
And that is when I got an X11 error:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x34000c8
Serial number of failed request: 255
Current serial number in output stream: 256
Obviously, the caller of my program - which I cannot change - has already destroyed the X window I was using.
How should I handle this situation?
SDL_DestroyWindow() can be omitted if the SDL window was created with SDL_CreateWindowFrom()
go for SDL_SysWMinfo, pick up x11.display, create my own X11 error handler, and filter errors for window_id?
Looking at the SDL2-2.0.9 source code, it seems that SDL already sets an error handler, which calls the previous error handler, which is the default one that terminates the program on error. (src/video/x11/SDL_x11video.c::X11_SafetyNetErrHandler())
Internally SDL will override this error handler temporarily, when doing its own stuff. (src/video/x11/SDL_x11video.c::X11_CheckWindowManager())
Thus, I guess 2) is the correct way to go.
EDIT:
When omitting SDL_DestroyWindow(), SDL_Quit() will fail with the same X error.
I also realized that SDL may not anticipate a failed X call, so ignoring the error may not be a good idea, after all.
EDIT2:
I just realized that SetErrorHandler() does not require a display.
Adding an X error handler that ignores X errors regarding this particular X window seems to work, not sure if it creates new problems unseen.
Is there preferred way to handle this problem?
Version:
SDL2-2.0.9

cocoa-applescript: running handler or command every few seconds

In normal applescript, the script is executed down the page, and so any code in loops for every 5 seconds will only run while the loop is running - there is no way to have a single function run every few second regardless of what the script is currently doing or where it is in the script (that I know of). In cocoa-applescript, however, is there a way to run a handler every 5 seconds, at all times, no matter what it is currently doing? Here is what it should be doing in my cocoa-applescript app:
on checkInternetStrength()
do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep 'agrCtlRSSI:'" -- this being the script which returns the line containing the signal strength
set SignalStrength to result
set RSSIcount to (count of characters in SignalStrength)
set SignalStrength to ((characters 18 thru RSSIcount of SignalStrength) as string) as integer -- this to turn SignalStrength into just the number and not the whole output line
set SignalStrength to (100 + SignalStrength) as integer
set SignalBar's setIntValue_(SignalStrength) -- SignalBar being the Level Indicator described below
end checkInternetStrength
Summed up, it runs the airport command to check internet connection, turns this into a number from 1 to 100 and uses this on an NSLevelIndicator (100 maximum) to show current signal strength graphically. Now, there is no point having this run once or when you hit a button - that is an option, but it would be nice if it updated itself every, say, 5 seconds with the realtime value. So is there any way to have a process which runs every 5 seconds to do this, while still enabling full functionality of the rest of the script and interface - i.e. as a background process? Comment if you need more extracts from the script.
Example
In Unity-C# scripting, the 'void Update() {code}' will run the code within it every frame while doing everything else simultaneously, so a cocoa-applescript version of this might be an answer, if anyone knows.
I Dont believe this is possible but what I had a similar problem before, what i do, I have an external applescript applicaion that is hidden the repeats the commands, the only problem is, it wont send it back to the app, you'll have to make the external applescript app do it, like
display notification, etc..., in the applescript apps "Info.plist" you can add this:
<key>LSUIElement</key>
<string>1</string>
To make the app run invisibly, but sorry i dont think you can run a handler in the app its self

Log4net: log unique messages

I'd like to log some messages only once while the program is running or be able to "unlock" the "unique" message so that it would be logged again.
Of course this can be done on code keeping track of the "unique" message and calling the log method only once, but I wonder if it is possible to do so with some configuration trick.
In pseudo code:
DO
i = i++
log.info("this should be unique")
log.info("this can be repeated")
LOOP WHILE i < 10
unlock("this should be unique")
log.info("this should be unique")
log.info("this can be repeated")
After that I should see "this should be unique" 2 times on my log.
Your other question made me consider this one also. It should be possible to create a system to log any message only once (before reset) by using any buffering appender and a custom ITriggeringEventEvaluator.
Set the buffer size to 0 and the Evaluator to the custom one. In the custom Evaluator, keep track of all messages that went through the IsTriggeringEvent method and filter out the ones that have already been processed.
It is possible to configure the messages that would be filtered, however you want to do it (config file, DB, etc), and how they can be logged again (timeout of filtering, explicit reset, etc) through the evaluator code.

Rebol 3 - How do you debug using an equivalent of view/new for Saphirion's Rebol

I'm trying to do some testing while working on GUIs, but I am running into trouble having console access at the same time.
Rebol 3
>> view/new [button]
** Script error: view has no refinement called new
>> help view
USAGE:
VIEW spec /options opts /modal /no-wait /across /as-is /maximized /minimized /on-error error-handler
DESCRIPTION:
Displays a window view from a layout block, face (layout), or low level graphics object (gob).
VIEW is a function value.
ARGUMENTS:
spec -- Layout block, face object, or gob type (block! object! gob!)
REFINEMENTS:
/options
opts -- Optional features, in name: value format (block!)
/modal -- Display a modal window (pop-up)
/no-wait -- Return immediately - do not wait
/across -- Use horizontal layout-mode for top layout (rather than vertical)
/as-is -- Use GOB exactly as passed - do not add a parent gob
/maximized -- Open window in maximized state
/minimized -- Open window in minimized state
/on-error
error-handler -- specify global error handler (block!)
Looking at the help, I tried
view/no-wait
and this gives console access, but the REB-GUI window locks up. What is going on with this? Is there a way to be able to access commands through the console while playing with the GUI?
There isn't a way to have both console access and the gui concurrently.
But you could use an area face to enter commands and a button to evaluate those commands in your GUI.