Sublime tmLanguage file and sublime-settings file - editor

I have two questions about the Sublime Text Editor 2.
My 1st question is, I have several different .tmLanguage files ( ex: Console.tmLanguage) or .tmbundle (Ex: Handlebars.tmbundle) saved in the Packages/User folder. But it won't detect by the Sublime when the initial loads. If I move them under the Package folder, sublime will see them as a color syntax setting.
I thought everything should store inside the User Folder so that it won't be erased when updates or any other possible overwritten situations. What can I do to make sublime see those file when they are stored inside User folder.
I have moved those file several different locations. When I initialized sublime, I received this error " Error loading syntax file "Packages/User/Console.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/User/Console.tmLanguage" "
I did research about this error, one of the file maybe use that color setting has been cached. I could not remember that which one is using it. How can I clear all the cache to get rid of this initial loading error?
My 2nd question is, I am sharing the Preferences.sublime-settings file for Windows and Mac via Dropbox. But Mac has high resolution, window has not. Mac need font size of 21 to show the same size on windows( font-size: 14 ). Every time When I sync the setting, I have to switch this value from setting file. So I created two different files, Preferences (OSX).sublime-settings and Preferences (Windows).sublime-settings to hold the font-size setting only. It seems to work on windows, but Mac just ignore that file, no font size is being applied at all. It is so tiny that I could not see. Any ideas how could I fix that?

I solved the 2nd problem (i.e. eliminating display differences) as follows:
Create the Default folder that will "mirror" Default.sublime-package:
Window 7:
%USERPROFILE%\AppData\Roaming\Sublime Text 3\Packages\Default
Mac OS X:
~/Library/Application Support/Sublime Text 3/Packages/Default
Extract two files from Default.sublime-package into this folder:
Preferences (OSX).sublime-settings
Preferences (Windows).sublime-settings
I used the following settings to get the same look and feel on Windows 7/XP and MacBook with Retina:
Windows:
{
"font_face": "Consolas",
"font_size": 11,
"line_padding_top": -1
}
Mac OS X:
{
"font_face": "Consolas",
"font_size": 14,
"line_padding_bottom": -1,
}

According to this post in the Sublime Text forums, you need to remove an existing .tmlanguage file from the /Packages folder AND the .tmlanguage.cache file and relaunch Sublime Text to confirm that the program is no longer reading them. Then you can put your .tmlanguage or .tmbundle file in /Packages/User.
It's not clear to me that the error message you got was indicating a problem with the location and not a problem with the plist file itself. You might try using one of the free plist editors to make sure the structure of the file itself is OK.
Good luck on the Mac/Windows display difference. I have no idea how you might solve that.

For windows delete - Delete all the sublime files from
C:\Users\\AppData\Roaming

Related

CN1 - unable to use localization after activating css

Recently I switched over from the legacy css integration to using the current method of css support via the CN1 Preferences dialog. Ever since then, I've had repeated problems accessing strings from the localization resource file.
A few important points:
I have two theme files, but even importing the strings as a csv file into the theme generated by css doesn't work
I've tried all possible combinations of theme initialization with the two theme files, including initializing just one of them, with no consistent success (occasionally it works, but then if I modify the css and the theme file gets regenerated it stops working again)
I created a brand new project and copied my code into it, imported the string files, and it worked - until I turned on css support. Then I was back to square one
When it fails to work, the method UIManager.getL10NResourceNames() returns an empty array
Any help would be greatly appreciated!
CSS controls the file and as a result you can no longer change the theme.res file by other means. You need to keep a separate localization.res file and load that strictly for the localization functionality of your application. You can use Resources.open("/localization.res") to load an arbitrary resource file.
After much poking around, I found the solution. It turns out my situation was the result of a few non-standard things I did. First of all, I had a theme.res file which I renamed using IntelliJ's Refactor >> Rename function, which renamed the hardcoded css theme name in the build.xml file to my new name. I needed to manually revert that string in order to prevent the css compile task from overwriting my theme file. The second thing I noticed is that sometimes (I'm not clear on what caused this) the theme file was not being refreshed in the /out directory when running the app locally. This would manifest itself, for instance, when I would add an image in the theme file, but when running the code it wouldn't be able to find it in the Resources hashtable. Every time this happens, I now know to just delete the contents of /out, thereby forcing the IDE to rebuild/recopy the theme file (I could probably just copy it manually to the /out directory, but I think deleting it is safest).

Cross platform way to get icon of firefox exe

I'm trying to get the path to the default firefox executable cross platform.
I tried the way recommended here:
https://stackoverflow.com/a/24056586/1828637
However its not working on mac os or linux
on mac it shows this: http://i.imgur.com/xu5GrF8.png
on linux (tested on ubuntu 14) it shows this: http://i.imgur.com/QxWKxbH.png
I was hoping to get the .xpm on linux and the .icns on mac os and the .ico on windows which is the container file, meaning like not just .ico of the single 64x64 image but contain all files please.
Thanks
Your title and question ask two different things, which is a bit confusing. I am not clear on if you want just a way to find the Firefox executable, or a way to extract the currently used (or default?) icon from Firefox.
Icon files:
If you are just looking for a URL to use within Firefox, they should be located at:
chrome://branding/content/icon128.png
chrome://branding/content/icon64.png
chrome://branding/content/icon32.png
chrome://branding/content/icon16.png
They do not appear to exist in .ico files within the Firefox distribution. In fact there are only 4 .ico files in the entire distribution. They are all within the browser/omni.ja file at (windows assumed as primary based on your statements in prior questions):
chrome\browser\skin\classic\browser\customizableui\customizeFavicon.ico
chrome\browser\skin\classic\aero\browser\customizableui\customizeFavicon.ico
chrome\browser\skin\classic\browser\preferences\in-content\favicon.ico
chrome\browser\skin\classic\aero\browser\preferences\in-content\favicon.ico
omni.ja files are just zip format files with the extension changed to .ja instead of .zip. You can change the file extension back to .zip and read it with any appropriate archive handler.
The chrome:// URLs are:
chrome://skin/customizableui/customizeFavicon.ico
chrome://skin/preferences/favicon.ico
I think you can only get access to two of them at a time through chrome://skin/ depending on if you are using aero. If you really need access to both you could use nsiZipReader to open the actual omni.ja file.
Executable file:
You already had a batter way to get the executable file. From your comment it is:
FileUtils.getFile('XREExeF', []);

XNA XACT Where do I place the .xap file?

I've been trying and looking on the internet for ages now, but where exactly do you place the .xap file? I've read that you should place the file in your content folder, but I have a content folder located in;
TheGame\TheGameContent\
But I also have;
TheGame\TheGame\bin\x86\Debug\Content
Which is it? If I add the .xap file to the latter it recognises it when I refresh the solution explorer, but the former does not.
However, if I add the .xap to the latter it gives an error saying it can't find it when I use the following line of code to access it;
ae = new AudioEngine(#"Content\game_content\audio\xact\Win\xna xact file.xgs");
This line apparently gets the \x86\debug path.
Any advice?
Thanks
Visual Studio, go to the Solution Explorer and right click the Content solution (i.e. "TheGameContent (Content)") or a folder in that section and select Add > Existing Item... and select the .xap file. If it isn't in there, it will copy the file into TheGame/Content, but it will also make it ready to load and work within your project.
Basically it's the same as adding an image file to an XNA project, and it will save you all that trouble you are having.

Importing file into maple on a mac, correct filepath or default directory

I want to import a (text) file into maple on a mac.
According to all available information, the command should be of the form
read "MacIntosh HD/Programme/myfile"
but I did not succeed.
I tried various variations, slash/backslash, slash at the beginning, with and without Mac HD at the beginning, local language and English language name for the system directories.
I always get
Error, unable to read pathname I entered.
I would be content with any solution, either the syntax, or the default maple directory where I can put the file without worrying about the path or the existence of a menu item with the same effect.
Found the answer myself in the meantime:
For the above example
read "/Applications/myfile";
would succeed, so in particular, one has to use the English names for the systems directories even though in finder they are only ever given in the language you chose for your account.
Also, currentdir() and currentdir("Applications/Maple 15") allows you to see the current directory and to change it, respectively.

How does vi editor remember current line of the previous file

Suppose I am reading a file in vi editor. I am at line number 50 and I quit. After some time I reopen the file in vi editor. I notice that the cursor is at the same line where I was before closing the file.
How does VI editor remember this?
Don't know about plain old vi. vim, however, saves the current line number of the files you edit with it in a file called .viminfo in your home directory. At least, that's what it does in Linux.
You can see this behavior in many programs. You close your IDE and when you reopen it, it opens your last project. Your can kill your firefox and when you reopen it, you get all your pages reloaded.
It is simple, they save it somewhere for themselves.
One of the common places to save these information in Windows-y applications is the registry. You can run regedt32 in your windows and see all those data there. With Linux-y applications, it is common to create a hidden file in your home (~). You can go to your home directory in your Linux and open file .bash_history and see your old bash commands that you can access with the Up Arrow key
Vi in particular? Definitely has a file somewhere.

Resources