Netbeans and PhpDocumentor - windows

I have downloaded Netbeans 7.0 beta as I wanted to give the PhpDoc functionality a bash, but can't get it to work.
I seem to be falling over on the configuration options for PhpDoc in netbeans. It is asking for the script location,
but whatever I enter I get the error;
** ERROR *****************************************************************
* Sorry, can't find the php.exe file.
* You must edit this file to point to your php.exe (CLI version!)
* [Currently set to C:\usr\local\php\cli\php.exe]
*
* NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe.
* PHP 4.3.x renamed it php.exe but stores it in a subdir
* called /cli/php.exe
* E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
* for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
**************************************************************************
Press any key to continue . . .
The set-up is Netbeans and xampp running on a windows machine.
Any and all help greatly appreciated.

That error indicates that the php.exe executable file is not in your Windows "PATH", and as such, when Windows tries to run the phpdoc script, it doesn't know how. Fortunately, the phpdoc script itself checks for this condition and explains it to you, in the error text you posted. Otherwise, the Windows error would have been much more generic and probably unhelpful.
You need to determine where your php.exe file is located. Then, edit the phpdoc.bat script file itself to hardcode the absolute path. Look for the line near the beginning that SETs the phpCli value. That is where you should place the absolute path to your php.exe file.
As an aside, I would suggest that your "PhpDoc script" setting in NetBeans should explicitly call the phpdoc.bat script rather than just "phpdoc", e.g. D:\xampp\php\phpdoc.bat, since both files actually exist. I know that Windows will typically look for "foo.bat" if you tell it to execute "foo" when foo doesn't exist and foo.bat does exist, but since phpdoc and phpdoc.bat both exist, ... I think that Windows trying to run phpdoc directly rather than phpdoc.bat will give you trouble.
Further, I see that you have the phpdoc.bat file itself listed as the first "argument" to the phpdoc script. That will probably cause you some grief once you get past the "can't find php.exe" error. You should remove that... the only arguments you should give after naming the script itself are the valid arguments that phpDocumentor expects, particularly the ones it requires -- -o for output template, -t for where to write the doc files, -d or -f to tell it where the PHP code is that you want documented.

for my case, in the version 2:
i changed the last line in phpdoc.bat:
"%PHPBIN%" "%PHP_PERAR_BIN_DIR%\phpdoc.php" %*
to
"%PHPBIN%" "phpdoc.php" %*
%PHP_PERAR_BIN_DIR% in this case is empty & the backslash makes an error finding the phpdoc.php file

I finally figured out an easy way to use phpdoc in Netbeans Windows!
Pear? Drop it. There's way too many problems.
Download it directly - http://sourceforge.net/projects/phpdocu/files/
Download the tar file, not the zip. The zip is bugged and will output 2 letter extensions instead of 3 (ie, .cs instead of .css) (as of 1.4.3)
Unzip it anywhere you want
Open up the phpdoc.bat file, and make 2 changes
a) Change the phpcli path
b) Add in code to navigate to the directory.
So for example, I put my phpdocumentor folder in d:\programs\xampp\php\phpdoc. Modifying the phpdoc.bat file:
SET phpCli=d:\programs\xampp\php\php.exe
d:
cd d:\programs\xampp\php\phpdoc
Then in Netbeans, you put this for the phpdoc script:
D:\programs\xampp\php\phpdoc\phpdoc.bat -o HTML:frames:earthli
Note that when you set the target (right click on project -> properties -> phpdoc), you will need to manually change the backslashes to forward slashes.
Correct - D:/programs/xampp/htdocs/project/phpdoc
Incorrect - D:\programs\xampp\htdocs\project\phpdoc (this will be generated when you use the browse button)
Good luck!
PS. Note that you can also run the phpdoc batch file directly from dos. You don't need to do it through netbeans.
d:\programs\xampp\php\phpdoc\phpdoc.bat -d D:\programs\xampp\htdocs\project -t D:\programs\xampp\htdocs\project\phpdoc -o HTML:frames:phpedit

Related

Git Pre-Commit Hook: Unable to Run `dartfmt` (command not found) (Windows)

Ideally, I would like to have dartfmt to format my code on every commit, and I think that git hooks are ideal for this. So far, I've tried the code found in this link, but with no success, despite it appearing on multiple other websites — maybe it's outdated.
In the end, I think nothing much more complicated than this should work in most cases (inside the .git/hooks/pre-commit file):
#!/bin/bash
dartfmt -w . # or maybe `flutter format .` for Flutter
The errors I get are:
For dartfmt -w .: dartfmt: command not found
For flutter format .: find: ‘> bin [’: No such file or directory
Both of those commands do work if placed directly in the terminal.
to make dartfmt work, try running which dartfmt manually to get the path to the executable, and then use the absolute path when calling it in the script.
If which isn't able to find it, and assuming you know the complete path to the directory where dartfmt is located, try adding that directory to PATH in the script:
#!/bin/bash
PATH="/path/to/dart-sdk/bin:$PATH"
export PATH
Also, I'd suggest taking a moment double check what git will use for the working directory when it calls those hook scripts. There might be some undesired behavior by using . if the CWD isn't what is expected. See this post.
To format your dart code regularly, you can follow one of the two ways mentioned below:
Preferred way:
In IntelliJ Idea go to Settings -> Language & Frameworks -> Flutter -> Select Format Code on save option.
This will format your code every few seconds. This is preferred because you can customize your personal formatting settings such as max words in a line etc.
Alternatively
From Official website run dartfmt -w bin lib to format your code from the command line.
Add dartfmt reference in PATH, like this:
export PATH="/xxx/flutter/bin/cache/dart-sdk/bin:$PATH"

The command to move file * .pas to file * .exe in fpc.exe

I have a fpc.exe executable file that is supposed to transfer the * .pas file to * .exe file but when i click on it to write command it shows help, i write command but it does not work. The command is as follows (I learned from this link :https://www.freepascal.org/docs-html/user/userse10.html)
  fpc [options] prog.pp
I wrote on the command box
fpc C: \ Hello.pas prog.pp
I put the Hello.pas file in drive C
What should I do in this case
Thank you so much I tried it another way, is to cmd and then type the command
fpc D: \ Hello
And this is my video
https://youtu.be/MsOfohAZjqg
I finally did it. Thank you.
I wrote on the command box
fpc C: \ Hello.pas prog.pp
There are several things wrong with this:
You should leave out the "prog.pp". The example in the link is using that as an example of the name of the source file to compile. Yours is Hello.Pas.
There should be no spaces in the file name of the source file.
Do you have write permission to the root directory of your C: drive? If not, you should move your source file(s) to a directory where you do.
So, you need something like this
fpc C:\mypascal\Hello.Pas
This will only work, btw, if fpc is on your OS Path. If it isn't, then either add add it to the Path, or include the full path to fpc.exe in your compile command.
Btw, when you said
I have a fpc.exe executable file that is supposed to transfer the * .pas file to * .exe file
actually that is not quite right. You don't have the executable file, the executable file is what you are trying to create from the Hello.Pas file by compiling it using fpc.
when I click on the fpc file, it immediately prompts me to use and tells me to hit enter
I assume you mean that this happens when you click fpc.exe in an Explorer window. I'm afraid there is no easy way to avoid this - the same thing happens if you just type
C:>fpc
in a command window. It is just listing the various compiler options, etc, that you could specify. The way you avoid that in a command window is to specify the name of the source file you want to compile. Unfortunately, there isn't a simple way of specifying the source file when you click fpc. For Explorer, it is easiest to write a batch file which prompts you for the source file name and then invokes fpc to compile it.
You should omit the prog.pp in your command line and just enter
fpc C:\Hello.pas (if the file really is located in the root of C:).
If FPC does not find errors, you should have a file C:\Hello.exe.

File disappeared after trying to move it in terminal

Can anyone tell me where my file may have gone after this command?
The file I'm missing is stats.cpp
And what is the correct command to move it from directory prog3a to prog3c?
Thank you.
Since you did not post the actual command you used I cannot tell you what happened to the file. What I can say is that unless you used the rm command, the file is not gone. Probably got its name changed if you cannot find it or it got moved somewhere else other than the intended destination.
The correct command you should use is
mv prog3a/stats.cpp prog3c/stats.cpp
This command should be run in the directory where both prog3a and prog3c folders exist (cd to it before running the command. This is assuming they're both inside the same directory).
A more specific answer can be provided if you tell us which command you initially ran specifically and the full paths of each folder.

bash: ngc: command not found

I'm using #angular/compiler-cli to build my ng2 app in aot mode. When I input 'ngc -p tsconfig-aot.json' in my bash window, I get 'bash: ngc: command not found'. However, when I use 'node_modules/.bin/ngc -p tsconfig-aot.json' instead, it works. I googled for serval times but didn't get any usfull information. Can any give me a hand? Thx!
Seems like you need to put ngc in your path:
echo $PATH
Do you see ngc in binary in your path?
If not:
PATH=$PATH:/path/to/ngc
To make it permanent add to .bash_profile
export PATH=$PATH:/path/to/ngc
I've tried to change the slash to 'backslash' on windows and it worked for me:
node_modules\\.bin\ngc
If you don't want to set it globally, you can specify an absolut path in your angular-project, just make sure that you delete this part of the path when you don't use it anymore.
ngc is in node_modules/.bin, so depending on where you want to use ngc you can export the path like this:
PATH=$PATH:../../../node_modules/.bin
To run commands located into the node_modules folder of your project, without installing them globally (operation that will make the ngc command work in any system folder), you can use this command:
ngx ncc <options>
Basically ngx is a shortcut that executes any command located in node_modules bin folder.

how can i run rouge Summarization on windows?

I installed Strawberry Perl to run the rouge program in Windows. But when I want to run my program, I receive an error message that you can see on the image:
The system can't find the path specified.
My code is attempting to run "ROUGE-1.5.5.pl" but i think the system can't find this file. So I think maybe I don't initialize the path correctly?
I change my code to :
#!/usr/bin/perl
use Cwd;
$curdir=getcwd;
$ROUGE="..\ROUGE-1.5.5.pl";
chdir("sample-test");
$cmd="$ROUGE -e ..\data -c 95 -2 -1 -U -r 1000 -n 4 -w 1.2 -a DUC2002-ROUGE.in.26.spl.xml > ..\sample-output\output.out";
print $cmd,"\n";
system($cmd);
chdir($curdir);
and i receive this error:
Missing braces on \o{} at C:\runROUGE-test.pl line 7, near "$ROUGE" Execution of C:\runROUGE-test.pl aborted due to compilation errors.
As per the screen shot, you are attempting to run \ROUGE-1.5.5.pl where you probably want it without the spurious backslash (or with ..\ROUGE-1.5.5.pl if the parent directory is not on your PATH).
Similarly, you probably want the output in sample-output\output.out, or even just output.out, not \sample-output\output.out unless you specifically have a folder C:\sample-output for this purpose.
The backslash is significant; it is the absolute path to the root (of the current drive, on Windows). ..\ is the relative path to the parent folder.
Why are you writing a Perl script to run a Perl script, though? Either a simple batch file, or copy/pasting the command directly at the DOS prompt would seem like a less roundabout solution.
The problem is that when you are outputting the contents of the program to the file output.out in folder sample-output, the sample-output folder does not exist.
Command Prompt will not create the folders for you, only the files. Try creating a directory first called "sample-output" (In your drive root) such that the path resolves to something like C:\sample-output and run it again.
If the same problem results, try using an absolute path such as C:\sample-output\output.out instead.

Resources