Mac OS Mojave "open" command very slow - macos-mojave

Sometime in the last few months, I can't pin it down precisely, the Mac OS "open" command has become incredibly slow. If, say, I have a pdf in a directory, and type at the prompt "open file.pdf", or even "open -a Skim file.pdf", it takes minutes before the viewer actually opens. I have no idea what it could be doing, this used to be pretty much immediate.
Any advice on how to track this down? It would appear that some update, which I install automatically, made something go wrong, but unfortunately I can't be more precise than that.
Bob Harper

Related

GNU screen hangs application due to scroll blocking

I run a critical application with lots of output under screen. Eventually it blocks. Investigation showed that the cause is screen which unblock scrolling with with Ctrl-A q or other tricks, ublocking the application at the same time. Is there way to prevent screen from blocking an application no matter how much it outputs?
This sounds weird - for me, screen (on widely different hosts, different OS versions, different screen versions and so on) never blocks its applications, no matter how much they output. Eventually, when the scrollback buffer is full, old lines are cleared out, but the output keeps comming.
If you mention ctrl-a q, maybe take a look into the flow control settings, you can make screen ignore XON/XOFF (ctrl-s, ctrl-q) altogether...
EDIT: regarding your comment, I do believe that what you describe actually happens. I just wish to point out that it may not be screen that's causing it, or maybe it's because a weird combination with something else. I just now have while true ; do date ; done running in a screen - causing maximum spam. So far, many many thousands of lines have been written, and no blocking whatsoever. This is on a fresh, unmodified install of screen with default settings in a relatively fresh Debian 9.4 installation.
I have also tried the command you mentioned (ssh -t user#host screen) followed by the endless loop, and the same is true - no blocking after a long time.
Note that ssh has timeout features on keyboard (console) inactivity; maybe those are to blame?

Intellij IDEA 12 deadlock and lost changes

As you are working on the IDE, suddenly it has no reaction, the whole IDE become inactive and can not operate on it, but with high CPU usage, If you kill the process from Windows Task Manager, after it launched, all modified lost since your last edit. This problem occurs every now and then.
My environments:
Windows 7, Intel i7, 16GB RAM, IDEA 12.1.6 with auto save enabled.
Did anyone come across this problem before, it's to bad as my changes lost and i have to rewrite it after restarted.
You'll want to upgrade to v12.1.6 as 12.1.5 had a major bug in it that was fixed in 12.1.6. The bug prevented compiling of code in some circumstances. 12.1.6 was released only a few days after 12.1.5. That may not be the cause of your issue, but is still good advice.
Other than that, the 12.1.x line has been very stable. I think your issue is an isolated case as I have not seen any mention of it in the IntelliJ IDEA forums or here. Often times, such deadlocks are caused by third party plug-ins. Take a look in the logs (Help > Show Log) to see if it has any information that explains the hang. Also, if IDEA becomes non responsive, it automatically logs thread dumps in the log directory. Those may have some information.
If you experience the issue again, you may want to disable any third-party plug-ins to see if that resolves it. If it happens frequently, you can take a CPU Snapshot as described in this document and submit it to the JetBrains.
Lastly, I recommend you tweak the following setting: File > Settings > [IDE Settings] > General > Save files automatically if application is idle for x sec." Set it to 15 or 30 seconds. (You don't want to go too low). This will help reduce any loss of work in the event of a hang (which after 10 years of daily IDEA use I can attest to as being very rare.)

QBasic crashes immediately after selecting the "open" menu item

Not sure if this is even an acceptable question, but I figured it's an IDE so...
I'm trying to write a small program in qb4.5, which has happily worked on my computer (XP SP3) for a while now. For some reason though it is now sluggish and error-prone. As the title reads, if I try to open a file then QB crashes out. A virus recently attacked my registry (among other things), and after removing it and fixing many entries there are probably some entries that I haven't corrected that may affect this.
I believe that QuickBasic uses the MSDOS edit command for its IDE. Presumable that program is affected by the virus. If that is the case, you should have problems opening other files in EDIT too.
I believe that QuickBasic uses the MSDOS edit command for its IDE
The QuickBASIC IDE (-> QB.EXE) is a self-contained application. QuickBASIC doesn't use the MS DOS editor (EDIT.COM) as an input screen. The QB IDE offers several features you won't find in EDIT.COM, for example a SUB/FUNCTION browser, live syntax checking, compile+launch menu, ...
The styling of the QB IDE looks very similar to the appearance of EDIT.COM but it's a different application. In fact, one can run QB.EXE in DOSBOX without even having EDIT.COM installed.

How to autostart a program from floppy disk on a Commodore c64

Good news, my c64 ist still running after lots of years spending time on my attic..
But what I always wanted to know is:
How can I automatically load & run a program from a floppy disk that is already inserted
when I switch on the c64?
Some auto-running command like load "*",8,1 would be adequate...
Regards
MoC
You write that a command that you type in, like LOAD"*",8,1 would be adequate. Can I assume, then, that the only problem with that particular command is that it only loads, but doesn't automatically run, the program? If so, you have a number of solutions:
If it's a machine language program, then you should type LOAD"<FILENAME>",8,1: and then (without pressing <RETURN>) press <SHIFT>+<RUN/STOP>.
If it's a BASIC program, type LOAD"<FILENAME>",8: and then (without pressing <RETURN>) press <SHIFT>+<RUN/STOP>.
It is possible to write a BASIC program such that it automatically runs when you load it with LOAD"<FILENAME>",8,1. To do so, first add the following line to the beginning of your program:
0 POKE770,131:POKE771,164
Then issue the following commands to save the program:
PRINT"{CLR}":POKE770,113:POKE771,168:POKE43,0;POKE44,3:POKE157,0:SAVE"<FILENAME>",8
This is not possible without some custom cartridge.
One way to fix this would be getting the Retro Replay cartridge and hacking your own code for it.
I doubt there is a way to do it; you would need a cartridge which handles this case and I don't think one like that exists.
A better and more suitable solution is EasyFlash actually. Retro Replay is commonly used with its own ROM. Since it is a very useful cartridge by default ROM, I would never flash another ROM to it. Also it is more expensive than EasyFlash if you don't have any of those cartridges.
At the moment, I have Prince Of Persia (!) ROM written to my EasyFlash and when I open my c64, it autoruns just like you asked for.
Not 100% relevant, but C128 can autoboot disks in C128 mode. For example Ultima V (which has musics on C128 but not on C64 or C128 in C64 mode) autoboots.
As for cartridges, I'd recommend 1541 Ultimate 2. It can also run games from module rom images (although Prince of Persia doesn't work for me for some reason, perhaps software issue?), but you also get rather good floppy emulator (which also makes it easier to transfer stuff to real disks), REU, tape interface (if you order it) etc.
If you are working with a ML program, there are several methods. If you aren't worried about ever returning to normal READY prompt without a RESET, you can have a small loader that loads into the stack ($0100-$01FF) The loader would just load the next section of code, then jump to it. It would start at $0102 and needs to be as small as possible. Many times, the next piece to load is only 2 characters, so the file name can be placed at $0100 & $0101. Then all you need to do is set LFS, SETNAM, LOAD, then JMP to it. Fill the rest of the stack area with $01. It is also rather safe to only save $0100-$010d so that the entire program will fit on a single disk block.
One issue with this, is that it clears out past stack entries (so, your program will need to reset the stack pointer back to the top.) If your program tries to do a normal RTS out of itself, random things can occur. If you want to exit the program, you'll need to jmp to the reset vector ($FFFC by default,) to do so.

Knowing which process produced a sound

My computer often produces a "ding" sound, and I can't associate it with anything. Is it possible to programmatically determine the source of the beeps? For example can I hook the sound driver? If so, can you point out some examples or references?
Omer, this isn't a programming question, despite your edit.
No programming is necessary. Close applications one by one over time until the ding stops.
What operating system is this? If you're on Linux, you can use the lsof(8) command to see what files every process has open. If a process is playing sound, it will have the sound device file open, so you can grep for it like so:
lsof | grep -E '/dev/(snd|dsp)'
Another option is to use fuser(1), which works similarly to lsof.