How to turn off Pydev indentation warnings for certain .py files - warnings

I have some files in my project that are from an external source and that I never edit but sometimes step through. These files use a different indentation style from my default one (2 spaces vs. 4 spaces), and I currently many indentation warnings on them. Is there an easy way to suppress these warnings (or alternatively, specify an indentation style) on a file by file basis? I would expect to be able to solve my problem with the equivalent of a pragma line that I add at the top of the file but so far I haven't found such a thing. (BTW I would rather not turn off indentation warnings altogether, as I find them useful when editing code.)

You can add ##PydevCodeAnalysisIgnore to the beginning of your file to have PyDev skip its code-analysis of that file -- including the indentation warnings (i.e.: go to the top of your file and do Ctrl+1 and such an option will be shown to you).

Related

How to set silent_functions(1) as default in Octave? [duplicate]

I'm new to octave, and want to run a few commands on startup automatically every time it opens.
I typed "help startup" and saw "Octave uses the file ".octaverc". I did a bit of searching online at https://www.math.utah.edu/docs/info/octave_4.html, and saw the .octaverc file should be in the following path:
OCTAVE_HOME/lib/octave/VERSION/startup/octaverc
PROBLEM:
In that directory I don't have a startup folder, only "oct" and "site". I do see hidden files, which was my first thought since the file begins with "." character. So I then used Agent Ransack in the directory, and still nothing came up.
QUESTION:
1) Do I have to make the startup folder and octaverc file myself?
2) If so, does one, both or none have to be hidden?
3) Can it be a txt file, or does it have a special extension?
4) Do I just type the commands straight into the file or is there special formatting?
NOTE:
In case I'm going about this the wrong way, there are the operations I'd like to have run on startup:
PS1('>> '), addpath('D:\Users\Me\Desktop'), clc
Thanks ahead of time for the help!!
Possible locations (and their differences) for octaverc files are specified in the documentation.
In short, these are, from more general to specific:
octave-home/share/octave/site/m/startup/octaverc (most generic, for entire system)
octave-home/share/octave/version/m/startup/octaverc (to cover for more than one octave versions installed on the system, possibly requiring different startup scripts)
~/.octaverc (where ~ is unix-speak for a user's home directory -- covering for user-specific startup files)
.octaverc files in any directory, creating specific startup conditions for specific directories
octaverc files are effectively simple script files that are executed from most generic to most specific each time octave starts. Therefore, in the presence of conflicting commands, the more specific file can effectively be used to override the more generic behaviour.
Octave also supports (but does not recommend) the use of the startup.m file, for matlab compatibility.
You might also want to check out pathdef and savepath as well.
As a more general tip, if you ever want to search for a specific keyword from the documentation (e.g. octaverc), you can type this kind of search query in duckduckgo (or google):
octaverc site:https://octave.org/doc/interpreter/
(or just download the documentation as pdf and search the pdf)
Found the solution, the file was in the following path:
OCTAVE_HOME/share/octave/site/m/startup
to find out where OCTAVE_HOME is for you, just type "OCTAVE_HOME" into your Octave command line window.
ANSWERS:
1) You do not have to make a startup octaverc file yourself
2) The file is actually not hidden, so it should be easy to find given you're looking in the right place.
3) The file doesn't have an extension. It's just octaverc.
4) Under the last line of the existing file, you can just append commands as you would type them at the Octave command line window.
the last(7.3.0) octave version placed HERE:/ does not find the THERE:/openEMS/matlab directory even it is already loaded with octaverc or addpath. It keeps looking into the work dir where openEMS is not placed and does not recognize, for instance, the 'physical_constants.m' file.

Doxygen FULL_PATH_NAMES does not generate full paths in file names

I have two libraries libA and libB.
libA contains a file Action.h
libB contains a file action.h
I want to generate doxygen documentation in the same output directory for both libraries. This directory is to be used in Windows, for which action.html and Action.html is unfortunately considered to be the same file. To prevent this clash, I wish to render the generated files unique by prepending their path names to them.
Therefore, I set FULL_PATH_NAMES to YES.
I expect to see something like libA_Action.html and libB_action.html when I generate the documentation, but I don't! I still see Action.html and action.html. Its as if the FULL_PATH_NAMES parameter does nothing at all. Do I also need to set some other parameter in the Doxyfile to make the FULL_PATH_NAMES parameter work correctly?
You're probably running doxygen twice - one time for each library. If that is the case, doxygen isn't aware of the fact that it might clash with an output from another run, so when it find an existing file, it assumes that it is leftover from a previous run, and overrides it.
Setting FULL_PATH_NAMES doesn't help, as doxygen has no idea that multiple libraries exist, so, as far as doxygen is concerned, the prefix is identical to all files, so even when you adding a force it, it adds nothing (That's probably a bug).
The solution to your problem is setting both libraries as inputs to the same doxygen project.
You can do it by setting INPUT to multiple folders in the configuration file:
INPUT = ...bla\Lib1 \
...bla\Lib2

Sublime to change Tcl syntax highlighting

In notepad++, the tcl command arguments get highlighted. Like this:
puts [my_tcl_command -arg1 foo -arg2 bar]
How can I change the syntax highlighting definition in Sublime Text 2. I guess it's somewhere in this file "Sublime Text 2\Packages\TCL\Tcl.tmLanguage".
Syntax highlighting in Sublime Text is controlled by two files - the .tmLanguage file, which you mentioned, and your theme's .tmTheme file. Scopes are assigned to your code by interpreting regular expressions contained in the .tmLanguage file. For example, puts is assigned the scopes source.tcl keyword.other.tcl You can determine this by putting your cursor in a certain spot, then hitting CtrlAltShift-P - the scope(s) will appear in the bottom bar. Alternatively, I highly recommend using the ScopeHunter plugin.
So, now that we have the scope, it's up to the tmTheme file to assign the syntax highlighting. Unless you've installed a plugin theme, these files live in the Packages/Color Schemes - Default directory. It's in XML format, and you can search for the scope that's assigned to your -arg1 and -arg2 arguments and change the colors - they're in hex RGB web format.
EDIT
I just re-read your question, and realized that you want to assign a new scope to highlight the arguments. For that, you'll need to edit the .tmLanguage file and add a new regex to highlight them, assign a scope, then either alter your .tmTheme to add the new scope, or just assign one that's already highlighted. I don't know that much about how Notepad++ assigns its syntax highlighting rules, so you may be able to find one already written. Taking a look at other .tmLanguage files can be very instructive, as well. I recommend the Python one, even though it's not terribly well organized, because there are a large number of scopes, and it's fairly easy to see what's being done.

CHM compiles fine, but won't open

I use a program that spits out HTML and hhp projects containing data from my databases.
I then compile that hhp with Microsoft HTML Help Compiler (hhc.exe).
It works well, but unfortunately for few projects, hhc compiles fine, but chm file is unusable.
It reports "Cannot open the file: mk:#MSITStore‎: FileName"
I have no problem with other chm files on my system. I have no problems with other chm I compile. If I remove several topics from my project produced file works again. It doesn't matter what topics I remove. Files that don't work are almost twice the size of files that work, even tho the html and project file is almost the same (very few changes), which leads me to think compression fails silently if size or structure of some file isn't right.
Does anyone have experience like this and what could be the reason?
For those that want to see example, this project will compile and work fine:
Working chm project
And this one compile but fail to open:
Chm that fails
I experienced the identical problem. The CHM was double the usual size and could not be opened. The CHM compiler did not report any error. Removing any random HTML file enabled opening the CHM. I generated many other CHMs on the same day, and all the others were OK.
I worked around the problem in the following way:
I added a very small HTML file to the project. It is a copy of one of the other files in the project, so if a user finds it in a search, it does no harm.
I entered the file name in the HHP.
I recompiled the project in the CHM compiler.
The CHM shrank to the normal size, and it opens normally.
I had exactly the same problem and can say it's all a matter of size and most likely an error in the compression module of hhc.
When I added some lines of documentation the size of the CHM-file increased from 1.6 to 3.1 MB and it could not be opened anymore.
This problem could not only be fixed by removing files but also by adding files.
So I wrote some additional documentation, added it to the project and everything was fine again.
There are a number of reasons why the MS HH compiler may crash.
(1) Invalid filenamesfile and file
The HTML Help compiler does not like some filenames e.g. spaces in a filename can still cause some minor problems with HTML Help. Best to replace spaces with underscores. Avoid "#" in file and folder names.
Try and stick with these characters _, a..z, A..Z, 0..9.
Do not use periods apart from in the normal file extension. Example: A filename such as xxx.h001.gif is identified incorrectly as a HTML file. The compiler then attempts to parse the binary file and crashes.
Do not use file or folder names containing ".chm".
(2) Avoid compiling on a network drive and try to compile on local drive.
(3) Use MJ’s Help Diagnostics to ensure that all the help viewer components are properly installed and registered.
http://helpware.net/downloads/#MJs
(4) Delete the file “hh.dat”, which you should find in this subdirectory:
\Documents and Settings\%username%\Application Data\Microsoft\HTML Help
This file stores information about all the HTML Help files on your system (Favorites, window size and position, etc.), and can cause the files to misbehave if it has somehow been corrupted.
(5) You need to debug your help system. You need to identify the file(s) that are crashing the compiler.
I normally remove sections of the web by renaming or moving folders and files, then recompile. Keep adding and removing sections until the compiler does not crash. Eventually you will find one or two files that are causing the problem. You may also need to debug these files by temporarily removing sections of the HTML file.
I see 0 byte files in the input? Maybe the compiler can't handle that?

How to get a list of files with errors in PhpStorm

In PhpStorm I get a read mark on the upper right side of the code window if there's a PHP bug in the file. That's great. What I like to have is a list of all files which have this read mark.
Any ideas?
To get the list of all files with errors and warnings use Code | Inspect Code. It's possible to specify what inspection profile to use, which directories to scan. Custom Scope provides a flexible way to include/exclude certain directories or files from the inspection results.
Slightly off-topic, but may be helpful. If you need to jump through all the errors in a file (for example, CSS file), open up the file and and hit the F2 button on the keyboard. Repeat it to cycle through all the errors. To navigate back to the previous error, hit Shift + F2