How to edit a .sx file - visual-studio-2012

I am trying to edit an .sx file associated with this addon for microsoft test manager: Test Scribe
But if I make any change to the file in any editor test manager crashes. This should work since other people have said this is how they fixed the plugin not handling certain characters.
When I open the file in notepad++ it looks almost like an archive or something. Any ideas?

Figured it out, turns out it is using zip so you can open it and edit the files inside.

Related

.cabal file keeps reverting to template on save in Visual Studio Code

I've been going through the book Haskell Programming from First Principles and I've gotten to the section on testing where I've started to encounter this strange issue.
Whenever I try and edit the .cabal file for my project, every time I save it it reverts back to the template .cabal file that is generated when creating a project with stack.
I've tried saving without formatting and editing the file in Notes (I'm on Mac), saving, and then reopening the project in vscode (this also reverts the file to the template).
Does anyone have any idea what might be going on? I'm using the basic Haskell extension, the syntax highlighting extension, the debugging extension (which I have not gotten to work, anyway), and brittany for auto-formatting.
Thanks all!
When I checked my package.yaml (as referenced by #Koterpillar) I realized that it was acting as a generator of sorts for my .cabal file.
I then edited package.yaml with the information I needed and it fixed my issue. My .cabal file now contains the appropriate parameters.
Thanks #Koterpillar!

Nodejs: Detect file type without extension

I'm looking to remotely download and detect a file from a website, like this
http://examplewebsite.com/100/download
When viewing in my browser, this automatically downloads as the appropriate file type, 100.pdf, but sometimes it can be a .xls or .doc file. etc.
Looking at libraries available, like file-type, it only works if you already have the extension
Is this possible?
If you have the url, you can split by '.' and select the last element of your list.
The file-type library you linked in your question actually checks the source of the file to guess. It doesn't use the file extension at all.

Trying to open a python file in IDLE. Instead, a pycache folder is created. How do I fix this?

I have a number of python files with .py extensions that I was working on, closed, and tried to come back to later. When I tried to open them by right clicking and selecting “Edit with IDLE,” instead of opening a pycache folder was created.
I have a work around in which I go to edit the file with Notepad++, copy the text into a new python editor, delete the old file, and resave the new file with the same name. My research has turned up questions related to pycache and IDLE, but none specifically addressing the issue. Has anyone encountered a similar problem/know how to solve it? I’m running Python 3.5.2 on Windows 7.
What did you name the .py file as? If you named it something like "string.py", Python might interpret the file as one of those in the "Lib" folder. Why you can resave it with the same name and have it working afterwards is anyone's guess. I suggest just renaming the python file to something else.
I developed the bad habit of writing/editing python files with IDLE from watching intro videos when I was still relatively new to programming. I have since learned that file editors like Sublime or IDE's like PyCharm are a significantly better way to go and would highly recommend anyone reading this.
I had a similar issue. When I clicked "Edit with IDLE 3.6", it would create a "pycache" folder and not open the python file on IDLE.
I found a Reddit thread that gives an explanation here.
The reason the pycache folder is created is as follows:
When you import a module, Python stores the compiled bytecode in that
directory so that future imports can use it directly, rather than
having to parse and compile the source again. It does not do that for
merely running a script, only when a file is imported.
No such folder is created for the standard library, as the standard
library is pre-cached when you install Python
I was importing Python's "random" library, in another python file (placed in the same directory). So the issue was solved once I deleted that file.

How to rename a file in Sublime Text 3?

I wonder if there is a way that allows me to rename an opened file in Sublime Text 3?
Renaming would include that the currently opened file is created under a different name and deleted under the old name.
There's way too many people suggesting plugins for something simple and built into Sublime's Package Manager.
In Sublime 3 there is a built in command within Package Manager. So:
Shift+(Ctrl|Cmd)+p -> Rename File
Here is a package for Sublime Text 3 I wrote:
https://github.com/brianlow/FileRename
There's the SideBarEnhancements plugin that does this.
You can find it on GitHub here: https://github.com/titoBouzout/SideBarEnhancements/tree/st3
I recently added the functionality to AdvancedNewFile. It should rename the currently opened view, assuming you have the appropriate permissions at the source and destination locations. If you try it and run into an issue though, please create an issue on the github page.
Install AdvanceNewFile package from package manager.
Link: https://github.com/skuroda/Sublime-AdvancedNewFile
Use ctr+shift+p to open command window of sublime.
Enter Rename and select ANF: Rename File
Advantage of this package is you can also move and delete the file with rename.

Where are the default packages in Sublime Text 3 on Ubuntu?

I'm migrating from Sublime Text 2 to 3. In Sublime Text 2, I changed a lot of the default settings of the editor -- such as the tab bar height, sidebar color, etc. -- by modifying the Default.sublime-theme file in sublime-text-2/Packages/Theme - Default. I was also able to modify the colors of the default color schemes in a similar fashion. I've been trying to figure out how to do this for Sublime Text 3, but can't seem to find these files. ~/.config/sublime-text-3 only seems to contain overrides for user settings, not the default settings.
This link on the Sublime Text forums seems to give the location for Windows and Mac, but not for Ubuntu. I've searched a bit to no avail. Does anyone have suggestions?
Thank you!
To amplify on #skuroda's answer - ST3 contains all of its data that, in ST2, was stored in Packages/PackageName, in PackageName.sublime-package files that are basically just zip files, or "Resources" as they're now known. Using PackageResourceViewer, you can easily edit the individual files contained within the resource, then save it back again. When saved, the proper directory structure under Packages/PackageName will be created, allowing you to edit the file directly next time. The way file precedence works in Sublime, any file that exists in ~/.config/sublime-text-3/Packages/PackageName/ will override any file of the same name stored in PackageName.sublime-package.
However, since you don't want these files to be accidentally overwritten, I would suggest creating ~/config/sublime-text-3/Packages/User/Themes/ and User/Color Schemes directories and storing your customized files there instead. The User/ directory is protected from overwrites during upgrades, etc., and unless you're planning on creating a customized theme or color scheme for redistribution through Package Control, it's best practice to keep your files in there.
EDIT
I just realized you hadn't gotten an answer to your original question - where are the files stored? If you installed the .deb file from sublimetext.com, all the .sublime-package files are in /opt/sublime_text/Packages.
If you want the easiest way to save your customized settings first copy all the default settings and paste into a new file named Preferences.sublime-settings.
Then make your changes and save the file to:
/home/**username**/.config/sublime-text-3/Packages/User
In order to see the .config folder you will have to enable show hidden files.
The instructions are written at the top of the default settings list in case you are wondering where got this from.
In the ST console, try entering sublime.executable_path(). This should get you close to where you need to be. Also, you should copy the content of the file out and move them (under a new name to the packages folder). You probably don't want your modifications to be reverted on subsequent update. An alternative method is to try overriding the files you need to. I haven't done that for theme files, so I'm unsure if everything will work as it should. If you take the override route, I'd recommend using PackageResourceViewer. I wrote it to help with browsing/overriding package files in ST3.
You can use
dpkg -L <package name>
For example
dpkg -L subli<tab>
Just open up sublime text, hit ctrl+` to open sublime text console, then run these command accordingly
sublime.packages_path() to see user installed packages directory
sublime.installed_packages_path() to see zipped packages (with .sublime-package file type) directory
Mostly likely, you'll find the Default package inside zipped packages directory.
You can use PackageResourceViewer to see zipped packages's contents as #MattDMo suggested, but more over, you can actually extract zipped packages into user installed package directory directly using PackageResourceViewer's extract command.

Resources