How do I get JetBrains IDE's auto-save to work correctly when used inside a virtual machine? - editor

The default auto-save behavior is "Save files on frame deactivation". However, I'm using it inside a virtual machine, so the frame deactivation is not detected, because the frame I'm deactivating is actually VirtualBox's window in the host machine.
The only other supported way seems to be saving it periodically every second or two, but I'm wondering if there's a better way. It would be ideal if it can save whenever I press the Alt key, but I'm not sure if it is possible to trigger a save on just the Alt key alone. Or maybe there's a way to externally trigger a save command through some API.
I'm wondering if anyone encountered similar problems when using JetBrains IDEs (in my case PyCharm) inside a virtual machine. Any advice?

Related

Q: save Open Text Exceed windows sizes and positions?

how do you save your last windows sizes and position when using Exceed? I'm using it to run SAS environment but every time I boot it up, windows are always going back to default sizes and positions :(
I found this useful user written paper on using Display Manager.
The size and position of each of these windows can be adjusted using
standard mouse/window techniques. Once they have been adjusted the way
you want them, use the WSAVE ALL command in the command box to save
these settings for your next SAS session.
Also watch out for issues with not having access to your SASUSER library which can occur when you are running multiple SAS jobs at the same time. You can prevent the SASUSER library from not being accessed by all of the jobs if you run using the -RSASUSER option. But then you will not be able to run the WSAVE command. So if you want to make changes to the window locations do it when you do have write access to SASUSER.

Can Chromium features that are normally turned on via switches be turned on programatically after starting up?

Is there a way to use Chromium switches after starting it up, or must they be enabled on start up? For example, can switches be passed to the renderer processes, or just to the main process?
I want to turn on paint flashing in Chromium (actually in my Electron app which runs on top of Chromium).
Devtools has a checkbox that turns this on, but I want to be able to turn this on without devtools, and after the app has started.
I know there's a show-paint-rects flag I can use:
chrome.exe --show-paint-rects
In my Electron app, I would need to use app.commandLine.appendSwitch:
app.commandLine.appendSwitch("show-paint-rects");
I also found a ui-show-paint-rects flag that lives in something called the "compositor," but that may be irrelevant for me.
Both of these work, but since Chromium uses a multi-process architecture, I'm hoping that there's a way I can specify that switch, or otherwise, turn on a feature in one process and not have to specify it at startup.
Is there a way to do this in Chromium? (Would be ideal to do this in Electron, but I'm not counting on it)

Can I use gBrowser.selectedBrowser.addProgressLisnter in e10s?

We're trying to migrate our add-on to message manager and frame scripts.
Previously our add-on used gBrowser.addProgressListener() and nsIWebProgressListener.onStateChange() along with browser.webProgress.isLoadingDocument to monitor network activity.
The question is can I continue using browser.addProgressListener and browser.webProgres.isLoadingDocument in future versions of Firefox or using webProgress from frame script is a better way to do that? Maybe I should use some other technique?
For some reason it doesn't work reliably in Firefox 36.0a1 so I thought I should maybe move the code to frame script. Namely frame's docShell is QI-ed to webProgress to add progress listener there. It also doesn't work in all cases so I guess it's just a bug in 36.0a1.
By "doesn't work reliably" I mean that onStateChange() isn't called when I try navigating by browser.loadURI() method when a blank page is loaded in the current tab. Also webProgress from frame script sometimes "forgets" to send STATE_STOP to onStateChange().

Save boot-loader to virtual disk

Hope this doesn't sound crazy or something
I am trying to create a mini O.S. (who didn't?, it is like visiting Mecca for a muslim - any programmer must do it at least once in his life)
So, I created a simple boot-loader, that works fine when executed from a virtual boot-able ISO, in a virtual machine (Oracle VM Virtual Box). It just displays a message for now.
At this point, I am supposed to give the control to another code, that would start being my O.S. All this will be executed from the virtual optical disk. I could burn it on a CD and run it on a i386.
No, to make this really something, I want to run the "O.S". from a hard disk, so I wonder if there's a way to "burn" the boot-able information (boot-loader and other files to be loaded) directly on a virtual disk (like .vmi, .vhd, .hdd)
When I install a conventional O.S., like Windows or Linux, from an ISO image, on the virtual machine, the boot-loader starts a new code section, that installs the O.S. on the virtual disk. That is how I should do it, too: create a installer for the O.S., that would write my booting section on the virtual disk. That means that everytime I make a change to my O.S. I must re-install it. I don't like that. I would like to be able to write the booting code directly inside the virtual disk file, start the machine in Virtual Box, and see it running. I opened the .vmi file with an HEX editor but I cannot figure out where should I place the code to be considered boot-able.
Now, tell me whether I don't know what am I talking about or is there a solution for this.
Thanks to everybody!
I found out how to do it. Create a vmdk disk, open in in a HEX editor and paste the bootable information starting from 0

How to delete a file that is using by windows?

Is there any way to delete a file when its using by any program or other process in windows?
I searched and found this 2 ways:
1- using RunOnce key in Registry;
I'm not gonna use this because i dont want to wait for windows restart or anything else... prefer to do it ontime!
2- using the way declared in this page: http://www.delphipages.com/forum/showthread.php?t=201190
the problem here is its useful under NT windows, i need a way works on all Windowses!
Thank you.
the problem here is its useful under NT windows, i need a way works on all Windowses!
All modern desktop Windowses (XP, Vista, 7) are also NT. Do you really need to work with NT<4 or Win98? Or even Win CE/Mobile/Phone? Probably not.
If you need to delete an open file straight away, about the only thing you can do is attach to each process using debugger privileges, see if it has any handles open on the file, and if so close them underneath it. You can do this the manual way using eg Process Explorer. Many applications won't react well to having their files closed on them; expect them to exception out when they try to do something with the dead handle.
Unfortunately there is no option in Windows to have Unix-style files that can exist attached to a file handle independently of being stored under a filename on disc.
You cant delete a file when someone is using it. No matter how hard you try, windows will not let you. It can work with some files, but in general it does not work.
What you can try is postpone the deletion, when no one is using the file. You can:
1 - use RunOnce, but you dont want that.
2 - Wait in a loop, trying to delete the file. Pseudo code:
DeleteFile
Check if you was able to delete or if file still exists.
if you are able to delete, then exit loop.
That is the best you can do, and what i could remeber.
Try MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT flag. Will postpone move or delete action until reboot.
Edit:
If you don't whant to restart the only option is to close those handles. ProcessExplorer does that and works all the time and I have not seen any process to crash. See more info about enumeration handles in a process at
http://www.codeguru.com/forum/archive/index.php/t-176997.html. But keep in mint that you should enumerate all processes in the system and behave different on Vista+ (you need to be elevated)
Your files are most likely locked because some process has a handle open to them. That is the most common reason for the Access denied result when deleting or moving a file.
A really blunt way is to close that handle.
Then Handles tool from SysInternals (you can download the sources too) can do that for you: I have been successfully using that.
Note 1: You need administrative privileges to use it.
Note 2: Closing a handle from another process is considered very rude, and can make that process unstable.

Resources