How can I make Squeak ask me where to fileOut to? - squeak

I'm right-clicking a class category and choose fileOut for exporting it to an .st file. The problem is that it never asks me where to save to, instead just choosing a folder by itself (seems to be the same folder containing the image file).
How can I change it, forcing it to actually ask me where to save the file to? Previous Squeak versions (3.9.x) did ask me.
Squeak version is 4.2, OS is Ubuntu.

It looks like if you don't mind filing out twice, the default behaviour in 4.3 is to prompt if you would overwrite an existing file. Something like Class.st already exists, then select choose another name and you can write to the correct place in any directory, albeit with a second copy in the directory with the image.

I've checked in Pharo and it's the same, the menus just offer to file out to a predefined location.
However, it's still perfectly possible to trigger a file out by script. Look for implementors of #fileOut and #fileOutOn: for examples; evaluating something along the lines of `myProgramEntity fileOutOn: aFileStream' should do it.

Related

need to recover trados project with translation

I was working on a language translation project in trados on a virtual machine. Half of the work was done and the translated words were exported into a Word docx file. Upon restarting the virtul machine, the project file appears to have been corrupted as trados shows no signs that the project was worked on. When I manually open the sdlproj (trados project) file, trados cannot open the file mentioning the following:
: An error occured whilst trying to determine the file version
I have tried creating a new project and used pre-translate using batch tasks but that did not seem to have imported the previously translated document. I need to figure out how to recover my project so that I can recover the translated document (so I do not have to redo the work) as well as recover the translation memory for trados. The translation memory folder is present inside the original project folder. I would really appreciate any suggestion to further troubleshoot and fix this issue. I have tried their support desk but they do not appear to be available today. Two solutions I observed from their forum suggested:
save the project file with a zip extension, extract the contents and then open the sdlxiff file from there
recreate the project and use pre-translate.
In my case, I was able to open the sdlxiff file from the translated language directory. This opened the project with the text that had previously been translated. I am not certain whether I need to remove the sdlproj file or simply save the project hoping that it will overwrite the corrupted file. In either case, I will update this post once I get an answer to that.

How can I tell if an open file has changed, in Erlang?

I have opened a file (for read-only), and I'd like to know when it has changed (been added to, edited, or renamed and another file put in its place). Is there a simple way to do this in Erlang?
You can try https://github.com/richcarl/file_monitor
See also my answer to a similar older question: https://stackoverflow.com/a/5696288/240949

Is there a way to sync Xcode preferences and keyboard shortcuts across computers?

I'd like to avoid having to do tweaking the keyboard bindings repeatedly for each machine I use Xcode on.
Sort of like copy the settings file to a particular location in the target computer's filesystem; doesn't need Dropbox.
Yes, at least for key bindings. I'm assuming you're using Xcode4. If that's the case, your Key Bindings are stored here...
~/Library/Developer/Xcode/UserData/KeyBindings
Just copy the 'sets' you want from one machine to the other and there you go.
Note that unlike Xcode3, Xcode4 now respects global bindings as well. Global bindings are stored here...
~/Library/KeyBindings/DefaultKeyBindings.dict
Global bindings are for instance, if like me, you prefer the way cursor movement is handled in Windows (e.g. Home/End work on the line, CTRL Left/Right jump a word at a time, etc.) you can remap the keys for the overall system, and Xcode4 respects that. In Xcode3, such changes had to be duplicated in its own key bindings file.
Also note that if the same key is defined in both the defaults and the Xcode4 file, the latter 'wins'.
Additionally, you can unmap a system-wide key when using Xcode. This will disable that key when using Xcode, but leave it enabled elsewhere.
(If you open the actual key bindings file in say TextEdit or a PList editor (that's all these files are) then you'll see it still defines the command, but leaves the key itself cleared out.
Something else that may be of interest is KeyBindingsEditor. It's a great editor for creating system-wide shortcuts. While it claims to support Xcode, it doesn't (or rather Xcode 3 and 4 it doesn't. I can't speak to earlier.)
However since again Xcode 4 can utilize system-wide shortcuts now, you can use this indirectly with Xcode. I personally am very happy about that as now, no matter where I am, including Xcode, my keyboard shortcuts are unified across the entire system.
HTH, Mark
Adding to Mark's answer, setup dropbox to point that file to ~/nameofyourchoice on all of your machines, and viola, everything should be synced. You'll need to test it out to see if other machines don't overwrite etc.

change shortcut in scite dialog

does anyone know how to change alt-a (replace all) in scite's replace dialog to another shortcut? thanks a lot!
2 methods:
1. Use ResourceHacker and the uncompressed verion of SciTE.
You can get it from http://www.angusj.com/resourcehacker/
Open SciTE.exe with it, go to dialogs/400/1033.
Change the line that starts with
CONTROL "Replace &All"
Then recompile script.
2. recompile the source code...
Unzip the scite source and look for win32\SciTERes.rc
Roundabout line 400 you find the following line:
PUSHBUTTON "Replace &All",IDREPLACEALL,190,41,90,14
You can move the ampersand to a different position to change the shortcut key.
Then recompile SciTE
You can change one of ScITE's profile files by selecting from the Options menu. I usually change the User-level profile but the Global file is useful for seeing a more exhaustive list of settings.
Note 1: If you are the only user, you could change the Global settings but the User-level is just fine. One advantage to changing the User file, at lease in my case, is that User-level file (named .SciTEUser.properties) is saved in my /home/user_name directory -- I'm using Linux -- so it's included in my data backups.
Note 2: I found that altering ScITE settings is like shopping at Costco. You go in with a $30 shopping list in mind and leave $300 later. The number of things you can customize in ScITE is spectacular. It's the first time I have had an editor that feels tailor-made.
The ScITE website provides the documentation. Specifically, you'll want to look for "user.shortcuts" in this link. That section provides a link to all of the commands.

Delphi 7 keeps using old outdated form

Changed, updated, form is not used even though uses and project settings seem fine, old form files removed from disk.
Is this a bug in the IDE? I may just delete the form and copy it into another unit with a new name.
If it's using an old form it has to be getting it from somewhere--it doesn't appear out of thin air. Two scenarios come to mind:
1) It's somewhere where you don't realize. Search your system for files by that name.
2) Unless you do a build Delphi compiles based on timestamps. If the clock was wrong when it was compiled before the .dcu can have a more recent time and thus it gets skipped in compiling. I've hit this more than once with timezones.
A good way to find it is to first move the project to a different new folder and try to compile it. This should produce and error that will help you to find the culprit. If this does not work then it is settings like paths etc in your libraries that are at fault.
Also make sure that you deleted all ".dcu" files in the project before re-compiling.
No, it is not a bug in the IDE.
You are referencing that form in some setting in your project or environment, which you didn't find yet and which takes precedence to options you already tweaked.
Where do you need to go to resolve your problem? Well, that's difficult to say without looking at your development environment and your project settings.
I've had this happen before. It is always something referenced that I wasn't aware of.
You can do a grep for something from the form and see where it shows up.
Thanks for the input. The first one I tried, moving the files, mm2010, showed it was my code that was at fault.
Although the form/unit is not included in the project file (dpr), it is still referenced by some other unit. So the compiler links the res into the application. Look for the unit name you want to remove in other units' uses clauses.

Resources