Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.478.137 Times

NameSpace scoping operator 1.0

  Date Added: May 11, 2013  |  Visits: 283

NameSpace scoping operator

Report Broken Link
Printer Friendly Version


Product Homepage
Download (43 downloads)

Sometimes, I will receive a directory full of many interdependent mfiles from a colleague. I must install all the files on the path for the main files to work, which means I must also worry that some of these files have the same name as one of my own and will result in file name conflict.As a remedy, this FEX submission defines the NameSpace class, a user-defined class of namespace scoping operators. Objects of this class effectively allow different MATLAB directory search paths to act as namespaces, so that when a function in a particular colelction of directories is called, MATLAB will only see files in these directories while the function is executing. Hence, my colleague's mfile library can be executed in isolation from mine. Although MATLAB defines package directories (of the form +mypackage/ ) for this purpose, I find this less convenient, because the package must be prepared with all packaged functions and variables referenced with the package scoping syntax mypackage.blablablaConversely, objects of class NameSpace can manipulate a conventionally written library of mfiles as its own self-contained package. To do so, the NameSpace object makes an automatic path change at the time of the function call to a temporary path that includes the library. After the function call is completed, the NameSpace object automatically restores the original path. The temporary search path contains the desired function library and is specified when the NameSpace object is constructed. The temporary path also contains native MATLAB files/functions but (in the default case) contains no other user-added directories. This means that, at the time of the function call, MATLAB will only be aware of user-defined mfiles in the temporary path, so that name conflict between files in the library and files on the original search path cannot occur. There are certain hazards/limitations to this scheme, as noted below, but in simple cases, it can provide a useful way to interface to 3rd party file libraries. EXAMPLE 1: Applying scoping operator to function Obj=NameSpace(DirName); %Construct the object. %DirName is the name of a directory containing, %along with its subdirectories, a series of %MATLAB function files. argout=Obj.func(arg1,arg2); %func() is implemented in an mfile within DirName/ %or one of its subdirectories. This will invoke func(arg1,arg2), but after implictly changing the MATLAB path to include DirName/, its subdirectories, and native MATLAB directories. EXAMPLE 2: The above could also be done equivalently as follows Obj=NameSpace(DirName); %Construct object. newspace(Obj); %switches to temporary path argout=func(arg1,arg2); oldspace(Obj); %switches back to original path LIMITATIONS (1) Path switching is somewhat slow. Execution is slower than if these operations are done normally, without path switching. (2) If a function called through the NameSpace object Obj.f() is a path-altering operation, it will not work. The path always reverts to what it was at time of object construction. (3) Name conflict between classes cannot, unfortunately, be prevented. Once a class of a particular name is first referenced, MATLAB will only recognize this class definition, independently of whether this first reference occurs in the temporary function space, or the original one. (4) If execution crashes with an error during a call Obj.f(), the temporary path will not revert back to the original one. Use reset(Obj) or oldspace(Obj) to restore it.

Requirements: No special requirements
Platforms: Matlab
Keyword: Applying Argout Dobjfuncarg Arg Construct Dirname Obj Dnamespacedirname Operator Series Subdirectories
Users rating: 0/10

License: Shareware Size: 10 KB
NAMESPACE SCOPING OPERATOR RELATED
Development Tools  -  Pade Approximant of a trunctated series 1.0
Say you are only able to obtain a limited number of terms in a power series, as each term is increasingly difficult to obtain (ex. virial equation of state). To explore possible analytic continuations, you need an infinite series representation. A...
10 KB  
3D Graphic Tools  -  OBJ Import for Rhino 1.0
OBJ Import for Rhino is a plug-in for Rhino. This plug-in gives Rhino the ability to import graphical data from ASCII Alias|Wavefront OBJ files. Alias|Wavefront is the world's leading innovator of 2D/3D graphics technology for the film, video,...
300 KB  
3D Graphic Tools  -  OBJ Export for SolidWorks 1.0
OBJ Export for SolidWorks is a plug-in for SolidWorks. This plug-in gives SolidWorks the ability to export graphical data to ASCII Alias|Wavefront OBJ files. Alias|Wavefront is the world's leading innovator of 2D/3D graphics technology for the...
300 KB  
3D Graphic Tools  -  OBJ Import for SolidWorks 1.0
OBJ Import for SolidWorks is a plug-in for SolidWorks. This plug-in gives SolidWorks the ability to import graphical data from ASCII Alias|Wavefront OBJ files.Alias|Wavefront is the world's leading innovator of 2D/3D graphics technology for the...
300 KB  
3D Graphic Tools  -  OBJ Export for AutoCAD 1.0
OBJ Export for AutoCAD is a plug-in for AutoCAD 2000, 2000i, 2002 and 2004. This plug-in gives AutoCAD the ability to export geometric data from AutoCAD to Alias|Wavefront OBJ files. Alias|Wavefront is the world's leading innovator of 2D/3D...
400 KB  
3D Graphic Tools  -  OBJ Import for AutoCAD 1.0
OBJ Import for AutoCAD is a plug-in for AutoCAD 2000, 2000i, 2002 and 2004. This plug-in gives AutoCAD the ability to import geometric data from ASCII Alias|Wavefront OBJ files. Alias|Wavefront is the world's leading innovator of 2D/3D graphics...
400 KB  
3D Graphic Tools  -  OBJ Import for 3D Studio MAX 1.0
OBJ Import for 3D Studio MAX is a plug-in for 3D Studio MAX. This plug-in gives 3D Studio MAX the ability to import geometric data from ASCII Alias Wavefront OBJ files.Alias is the world's leading innovator of 2D/3D graphics technology for the...
307 KB  
Mathematical Graphic Tools  -  OBJ4CAD 2007 - Export OBJ 1.1
OBJ4CAD 2007 - Export OBJ is an AutoCAD 2007, 2008 and 2009 application to export AutoCAD drawing entities to OBJ file (Wavefront). It can export OBJ files from polyface meshes, polygon meshes, faces and 3d solid drawing entities.
376 KB  
Libraries  -  Construct-java 1.0 RC1
Construct is a framework for command processing. It is based on a request/response cycle managed by a Controller. Construct-java has support for filters, filter chains and command chaining. The controller has two modes for request processing:...
471.04 KB  
Multimedia & Graphics  -  OBJ2CAD 2007 - Import OBJ 1.6
OBJ2CAD 2007 - Import OBJ is an AutoCAD 2007, 2008 and 2009 application to import OBJ files (Wavefront) into AutoCAD drawing. It can import OBJ file and create lines, points, faces, polyface mesh and 3d solid drawing entities. Using it with...
358.4 KB  
NEW DOWNLOADS IN SCRIPTS, DEVELOPMENT TOOLS
Scripts  -  Freelancer Script 5.05
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Post projects. Featured projects. Private projects. Sealed projects. Edit/delete projects. Select freelancers....
5.49 MB  
Scripts  -  B2B Script 4.20
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Sign-up Account (Registration of account). Lead generation tools (for the sellers). Email verification to...
5.49 MB  
Scripts  -  B2C Script 5.06
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). The script comes with totally editable site colors, icons and graphics Multilevel categories allows extensive browsing Admin can change Category ordering or...
5.49 MB  
Scripts  -  Social Networking Script 2.86
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Registration with name, email, password, date of birth etc. User can add multiple school, college, university with start...
5.49 MB  
Scripts  -  Business Networking Script 8.04
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Ajax based interface. Profile creation. Different types of profile. Profile for jobseekers, employers and employed...
5.49 MB  
Development Tools  -  Aml2CHM 3.50
Those who use the popular Aml Pages text editor might be looking out for a way of generating help files from their text and notes. Aml2CHM is a plug-in that was developed to offer people a quick and efficient way of converting Aml Pages documents...
549.99 KB  
Development Tools  -  VMP Viewer 1.0
This is a very rudimentary tool to visualize the VMP files generated by BrainVoyager. Useful to share files with people who do not have BV.
10 KB  
Development Tools  -  Sending reports and timestamped file by emailing 1.0
main executing reference usage:[1] usage_send_mail.mIllustrates email sending with multiple separate files or single timestamped tar file. Attachment failure is properly handled, with continuation of report emailing without the attachment.[2]...
768 KB  
Development Tools  -  IrisMVC 2.0 rc1
IrisMVC is an OOP PHP framework that developers can use as a strong and secure foundation to build on various web applications following the Model-View-Controller (MVC) pattern. It provides the basic functionality developers need, without...
51.2 KB  
Development Tools  -  7-Zip for Script 4.42
7-Zip is a file archiver with a high compression ratio.Features:- High compression ratio in new 7z format with LZMA compression- Supported formats:- Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR- Unpacking only: RAR, CAB, ISO, ARJ, LZH, CHM,...
624.64 KB