python script for validating files in eclipse - eclipse

I have a self defined text editable (datafile) file format (which uses certain python types as dict, tuples, lists etc as well) for providing arguments data to my python scripts. These arguments are later used in my Main python script.
Currently, at the start of Main program, I am consolidating (using os.walk) all such datafiles and parsing them every time which takes a lot of time.
This is my issue!
Is there a mechanism in eclipse to run a python script (independent like a parser) and use above "datafile" as argument to check for syntax errors immediately after I save the file. So that I will not bother to check for syntax errors while running Main program.
Is this possible?
I am using Eclipse IDE with pydev for my development work.
Regards,

Related

Missing Python file for models using pyCommunicator

My experience with Python is limited, but I just started looking at the new Python models included AnyLogic's examples. I am looking at the 1st one Passing Data Types. The model runs correctly with the set, modify and get functions working as expected. My question is there a python file somewhere that the communicator is working with? I only see the .alp file in the folder.
Thanks
I'm also beginning to use this, but as I understand, the idea of the python helper here (among other things) is that you can run python commands with Anylogic, so you actually don't need a python file. Nevertheless it uses python installed in your computer to run the scripts, if you don't have python installed, your model won't work.

memory command is not available even after compiled with TCL_MEM_DEBUG flag

I have memory related problem in my application on solaris9 environment where Tcl_DeleteInterp() function calls lot of free() and mutex_unlock() functions. To debug the problem i followed the below steps to compile tcl on solaris server (with TCL_MEM_DEBUG flag) but still i couldn't use the 'memory' command in my interpreter.
Ran configure script on server (./configure –prefix=<directory needs to be installed> --enable-symbols=mem)
Make clean all
Make install (tcl libraries and tlcsh exe is copied to the path specified in step1)
Compilation generated two libraries (libtcl8.4g.so and libtclstub8.4g.a), I copied libtcl8.4g.so as libtcl8.4.so to my app
Copied tcl8.4 directory as well.
I also copied the tclsh8.4 to $PROVHOME/bin and created soft link as tclsh-> tclsh8.4.
From my application i linked the debug symbol enabled libraries to the place where exactly i created the Tcl interpreter.
Initialized the Tcl interpreter to using Tcl_InitMemory() function (so that the memory command will be registered in the supplied(arg) interpreter.
When i used the interpreter exe (tclsh) separately i could execute the memory command, but when i used the same exe on my application its not working. Can someone help me what could be the possible reason for this problem ?
Also help me how can i cross verify the libraries that they are compiled with TCL_MEM_DEBUG flag.
Will the Tcl source code tar file contain Solaris directory where i have to build the libraries or should i use the unix source code for solaris platform as well ?
Thanks
Are you using [mem] interactively (which does expansion of unambiguous short command names) and forgetting to use the full name ([memory]) in your scripts?
You're using Tcl embedded in your code? You need to call Tcl_InitMemory (passing in the handle to the interpreter where you want the memory command created) after creation of the interpreter and before you run user scripts, i.e., straight after the Tcl_CreateInterp gives you the handle (which should in turn come after the Tcl_FindExecutable call that initializes the shared parts of the library).
You must also make sure that everything is built with that flag set so that the correct memory allocation APIs are used in both your code when it integrates with Tcl, and you must make sure that you are linking against the debugging build. It's probably the linking that has gone wrong, but I've not done that level of development on Solaris for many years.
I think you'll find that “Getting a list of used libraries by a running process (unix)” is relevant to your problems.

How to access Eclipse refactoring scripts from command line for automation

Eclipse allows to create refactoring scripts through the GUI. I'm looking for a way to generate the script files with inputs from an external module and then automate the refactoring based on them. Would it be possible to do this by a mere jar/class call in a command line (bash script)?
Are there other options to do automated find and replace on large code base which won't break the code? Typically the projects contain all sorts of files java,jsp,css,html,Make,....
As far as I know, Eclipse does not include such an application (look for all definitions of the org.eclipse.core.runtime.applications extension point). It wouldn't be too hard to build one on top of the functionality of org.eclipse.ltk.core.refactoring and org.eclipse.ltk.ui.refactoring.

How to Stop Perl EPIC eclipse plugin showing errors

My eclipse tries to compile/build Perl files in my Java project and fails. I installed Perl EPIC just for syntax colouring, how can I get it to ignore errors?
I tried going into Project->Properties->Builders, and uncheck Perl Epic, this didn't change anything.
I'm using Eclipse :Helios Service Release 1
Build id: 20100917-0705
On Windows XP
I have basically the same issue as this question,
How can I set up Eclipse to edit Perl without the runtime checking?
I've been looking into similar issue for quite some time too. Apparently the Epic Perl plugin goes wildly checking anything/folder/file it finds inside the project, so like mine where I have config files, data directories, it goes inside and tries to validate "perl stuff", which evidently is an annoyance: the error log view displays a lot of useless information.
Did you try to uncheck the "Perl Auto Builder" ?
I'm not parsing this sentence in the context of your question: "My eclipse tries to compile/build perl files in my java project and fails."
Are you saying that you are running perl as a java project, and getting the inevitable error message because it is not java? Just wondering why you don't want to have your perl program set up as a perl project possibly referenced by your java project, assuming that that is what you are trying to do.
Generally, when I set up a perl project, I edit its properties and set its includes to match the current directory or local module paths. Assuming that there are self-written modules I must call, and they are not located on this machine (e.g. I wouldn't have FOO::smb on a windows machine -- it makes no sense. When I am developing for linux, I will put all my functions in there for convenience's sake)
In that case, I create a FOO directory in the workspace, and create a dummy FOO::smb module with however many stub functions in it to get me going and let my syntax highlighting and error checkign do their proper jobs for me. If I write dummy subs to match the real modules well enough, I can debug my scripts somewhat before uploading them. I figure that I should be well enough aware of what they are supposed to do anyway.
I will go so far as to dummy out CPAN modules assuming that installing them on my development workstation makes no sense or is impossible. Highlighting and syntax checking are both invaluable tools, and finding a way to make both of them work saves my sanity.

I had written a simple cobol prog in ECLIPSE. But i am unable to compile,run that program

I had written simple cobol program in eclipse.
For the first time i am using eclipse for cobol programs.
i want to know the steps followed to compile and run that simple cobol program.
Though I have never compiled Cobol programs on Eclipse there are somethings that is common in program compilation irrespective of the programming language used and the IDE used to program in. Every IDE needs some stuff to compile/build the program you created using it:
Access to the compiler for the programming language ( the colon/semi-colon separated directory paths listed in $PATH environment variable is used to figure out the location of the compiler ). Try echo $PATH on Linux or path on Windows command shell and see whether the cobol compiler is accessible from your $PATH variable
There could be a way to configure the compiler you use on a per project basis. Just look under Project->Properties from the menu bar and see if there is an option for configuring the compiler.
Next is setting the build variables to help the IDE find the libraries to compile and execute the program. Even this could be configured from the Project->Properties dialog. In that dialog look for Build Variables or something similar and set the necessary paramaters. In case of COBOL that would be the path needed to find the copy libraries you use in your programs.
Hope this helps.