isosurfaces explained
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 242
Racer 0.5.2 beta8.9
Racer is a free car simulation project, using real car physics to get a realistic feeling. more>>
Racer is a free car simulation project, using real car physics to get a realistic feeling. Cars, tracks, scenes and such can be created with relative simplicity in mind (compared to other driving simulations).
The 3D and other file formats are, or should be, documented. Editors and support programs are also available to get a very flexible and expandable simulator. It uses OpenGL for rendering.
It attempts to do well at the physics section, trying to create life-like cars to emphasize car control and doesnt cut back on realism in the interest of fun. If youve played Grand Prix Legends from Papyrus, youll know what Im talking about.
Racer major features:
- Its totally free! (for non-commercial use)
- Available for multiple platforms; Windows 2000/XP (95/98/ME may work but have some trouble with fonts), Linux and Mac OS X.
- 6 DOF models used (the car can move around freely)
- Uses motion formulae from actual engineering documents from SAE for example.
- Total flexibility; almost everything is customizable through ASCII files.
- Commercial-quality rendering engine (with smoke, skidmarks, sparks, sun, flares, vertex-color lit tracks).
- Support for Matrox Surround Gaming. See the corresponding page on Matrox site.
- Lots of addon cars and tracks available on the web.
- Easy integration of your own cars and tracks that you create in ZModeler, 3D Studio Max(tm), Maya etc.
- At least 15 degrees of freedom for a regular car (6 DOF for the car body, 1 for each wheels vertical motion and 1 for each wheel spinning, and 1 for the engine, several more for the driveline). Depending actually on how many wheels you put on the car.
- Real-time internal clock; no physical dependency on framerate. Controller updates are also done independently of the framerate.
- Not limited to 4 wheels; anything from 2 to 8 wheel vehicles are currently supported (but mostly untested, and some problems with hardcoded differentials for example may exist (v0.5.0)).
- Not much constraints on the track data; surface info is taken from polygon data (VRML tracks), and splines are used to smooth out the track surface (polygons are too harsh for driving on just like that).
- Tools to modify the cars & tracks are freely available on this site (though external utilities are recommended for best results).
- Some used algorithms are explained on this site. Also, references are available. If you are programming a carsim, you might find something useful here.
- Save game present!
Main features:
PHYSICS FEATURES
- Full 6 degree of freedom motion of the car chassis.
- Independent suspension for all wheels.
- Suspension features: springs, dampers, anti-rollbar, rollcenter, anti-pitch.
- Wheel features: camber, wheel hop (the wheels have mass), toe.
- Tires: Pacejka tire model, relaxation length.
GRAPHICS FEATURES
- View frustum culling for increased framerate.
- Shader system for Quake-style rendering.
- Fog definable per track.
- Environment mapping for shiny materials.
- Live track environment mapping.
<<lessThe 3D and other file formats are, or should be, documented. Editors and support programs are also available to get a very flexible and expandable simulator. It uses OpenGL for rendering.
It attempts to do well at the physics section, trying to create life-like cars to emphasize car control and doesnt cut back on realism in the interest of fun. If youve played Grand Prix Legends from Papyrus, youll know what Im talking about.
Racer major features:
- Its totally free! (for non-commercial use)
- Available for multiple platforms; Windows 2000/XP (95/98/ME may work but have some trouble with fonts), Linux and Mac OS X.
- 6 DOF models used (the car can move around freely)
- Uses motion formulae from actual engineering documents from SAE for example.
- Total flexibility; almost everything is customizable through ASCII files.
- Commercial-quality rendering engine (with smoke, skidmarks, sparks, sun, flares, vertex-color lit tracks).
- Support for Matrox Surround Gaming. See the corresponding page on Matrox site.
- Lots of addon cars and tracks available on the web.
- Easy integration of your own cars and tracks that you create in ZModeler, 3D Studio Max(tm), Maya etc.
- At least 15 degrees of freedom for a regular car (6 DOF for the car body, 1 for each wheels vertical motion and 1 for each wheel spinning, and 1 for the engine, several more for the driveline). Depending actually on how many wheels you put on the car.
- Real-time internal clock; no physical dependency on framerate. Controller updates are also done independently of the framerate.
- Not limited to 4 wheels; anything from 2 to 8 wheel vehicles are currently supported (but mostly untested, and some problems with hardcoded differentials for example may exist (v0.5.0)).
- Not much constraints on the track data; surface info is taken from polygon data (VRML tracks), and splines are used to smooth out the track surface (polygons are too harsh for driving on just like that).
- Tools to modify the cars & tracks are freely available on this site (though external utilities are recommended for best results).
- Some used algorithms are explained on this site. Also, references are available. If you are programming a carsim, you might find something useful here.
- Save game present!
Main features:
PHYSICS FEATURES
- Full 6 degree of freedom motion of the car chassis.
- Independent suspension for all wheels.
- Suspension features: springs, dampers, anti-rollbar, rollcenter, anti-pitch.
- Wheel features: camber, wheel hop (the wheels have mass), toe.
- Tires: Pacejka tire model, relaxation length.
GRAPHICS FEATURES
- View frustum culling for increased framerate.
- Shader system for Quake-style rendering.
- Fog definable per track.
- Environment mapping for shiny materials.
- Live track environment mapping.
Download (10.7MB)
Added: 2005-08-16 License: GPL (GNU General Public License) Price:
1543 downloads
Geography::Countries 1.4
Geography::Countries is a Perl module with 2-letter, 3-letter, and numerical codes for countries. more>>
Geography::Countries is a Perl module with 2-letter, 3-letter, and numerical codes for countries.
SYNOPSIS
use Geography::Countries;
$country = country DE; # Germany
@list = country 666; # (PM, SPM, 666,
# Saint Pierre and Miquelon, 1)
This module maps country names, and their 2-letter, 3-letter and numerical codes, as defined by the ISO-3166 maintenance agency [1], and defined by the UNSD.
The country subroutine.
This subroutine is exported by default. It takes a 2-letter, 3-letter or numerical code, or a country name as argument. In scalar context, it will return the country name, in list context, it will return a list consisting of the 2-letter code, the 3-letter code, the numerical code, the country name, and a flag, which is explained below. Note that not all countries have all 3 codes; if a code is unknown, the undefined value is returned.
There are 3 categories of countries. The largest category are the current countries. Then there is a small set of countries that no longer exist. The final set consists of areas consisting of multiple countries, like Africa. No 2-letter or 3-letter codes are available for the second two sets. (ISO 3166-3 [3] defines 4 letter codes for the set of countries that no longer exist, but the author of this module was unable to get her hands on that standard.) By default, country only returns countries from the first set, but this can be changed by giving country an optional second argument.
The module optionally exports the constants CNT_F_REGULAR, CNT_F_OLD, CNT_F_REGION and CNT_F_ANY. These constants can also be important all at once by using the tag :FLAGS.
CNT_F_ANY is just the binary or of the three other flags. The second argument of country should be the binary or of a subset of the flags CNT_F_REGULAR, CNT_F_OLD, and CNT_F_REGION - if no, or a false, second argument is given, CNT_F_REGULAR is assumed. If CNT_F_REGULAR is set, regular (current) countries will be returned; if CNT_F_OLD is set, old, no longer existing, countries will be returned, while CNT_F_REGION is used in case a region (not necessarely) a country might be returned. If country is used in list context, the fifth returned element is one of CNT_F_REGULAR, CNT_F_OLD and CNT_F_REGION, indicating whether the result is a regular country, an old country, or a region.
In list context, country returns a 5 element list. To avoid having to remember which element is in which index, the constants CNT_I_CODE2, CNT_I_CODE3, CNT_I_NUMCODE, CNT_I_COUNTRY and CNT_I_FLAG can be imported. Those constants contain the indices of the 2-letter code, the 3-letter code, the numerical code, the country, and the flag explained above, respectively. All index constants can be imported by using the :INDICES tag.
The code2, code3, numcode and countries routines.
All known 2-letter codes, 3-letter codes, numerical codes and country names can be returned by the routines code2, code3, numcode and countries. None of these methods is exported by default; all need to be imported if one wants to use them. The tag :LISTS imports them all. In scalar context, the number of known codes or countries is returned.
<<lessSYNOPSIS
use Geography::Countries;
$country = country DE; # Germany
@list = country 666; # (PM, SPM, 666,
# Saint Pierre and Miquelon, 1)
This module maps country names, and their 2-letter, 3-letter and numerical codes, as defined by the ISO-3166 maintenance agency [1], and defined by the UNSD.
The country subroutine.
This subroutine is exported by default. It takes a 2-letter, 3-letter or numerical code, or a country name as argument. In scalar context, it will return the country name, in list context, it will return a list consisting of the 2-letter code, the 3-letter code, the numerical code, the country name, and a flag, which is explained below. Note that not all countries have all 3 codes; if a code is unknown, the undefined value is returned.
There are 3 categories of countries. The largest category are the current countries. Then there is a small set of countries that no longer exist. The final set consists of areas consisting of multiple countries, like Africa. No 2-letter or 3-letter codes are available for the second two sets. (ISO 3166-3 [3] defines 4 letter codes for the set of countries that no longer exist, but the author of this module was unable to get her hands on that standard.) By default, country only returns countries from the first set, but this can be changed by giving country an optional second argument.
The module optionally exports the constants CNT_F_REGULAR, CNT_F_OLD, CNT_F_REGION and CNT_F_ANY. These constants can also be important all at once by using the tag :FLAGS.
CNT_F_ANY is just the binary or of the three other flags. The second argument of country should be the binary or of a subset of the flags CNT_F_REGULAR, CNT_F_OLD, and CNT_F_REGION - if no, or a false, second argument is given, CNT_F_REGULAR is assumed. If CNT_F_REGULAR is set, regular (current) countries will be returned; if CNT_F_OLD is set, old, no longer existing, countries will be returned, while CNT_F_REGION is used in case a region (not necessarely) a country might be returned. If country is used in list context, the fifth returned element is one of CNT_F_REGULAR, CNT_F_OLD and CNT_F_REGION, indicating whether the result is a regular country, an old country, or a region.
In list context, country returns a 5 element list. To avoid having to remember which element is in which index, the constants CNT_I_CODE2, CNT_I_CODE3, CNT_I_NUMCODE, CNT_I_COUNTRY and CNT_I_FLAG can be imported. Those constants contain the indices of the 2-letter code, the 3-letter code, the numerical code, the country, and the flag explained above, respectively. All index constants can be imported by using the :INDICES tag.
The code2, code3, numcode and countries routines.
All known 2-letter codes, 3-letter codes, numerical codes and country names can be returned by the routines code2, code3, numcode and countries. None of these methods is exported by default; all need to be imported if one wants to use them. The tag :LISTS imports them all. In scalar context, the number of known codes or countries is returned.
Download (0.009MB)
Added: 2007-02-21 License: Perl Artistic License Price:
975 downloads
Speegle Define 1.1
Speegle Define is a Firefox extension that gives a spoken definition of a word using Speegle Speech Technology. more>>
Speegle Define is a Firefox extension that gives a spoken definition of a word using Speegle Speech Technology. You highlight the word you would like explained with highlight left click on any internet page you are reading.
Right click and choose "Audio Definition" from the pop up menu and its definition will be read back to you in English through your speakers or headphones.
<<lessRight click and choose "Audio Definition" from the pop up menu and its definition will be read back to you in English through your speakers or headphones.
Download (0.004MB)
Added: 2007-06-02 License: MPL (Mozilla Public License) Price:
874 downloads
BitWise Routing Server 1.7
BitWise Routing Server allows multiple PCs behind a router to make direct connections. more>>
BitWise Routing Server allows multiple PCs behind a router to make direct connections.
The BitWise Routing Server allows you to accept BitWise connections to multiple computers behind a router. Typically, using a router, you would set up port forwarding on BitWises client port (4137), and specify a single destination IP. This is fine until multiple users behind a router all need to accept incoming connections.
As shown by the picture at right, the Routing Server allows individual users to register themselves with the Routing Server, and then the Routing Server accepts all incoming connections and directs those connections to the appropriate user.
The Routing Server requires that your physical router support port forwarding with a way to specify different external and internal ports (this is sometimes labeled "UPnP" by many common home routers).
The Routing Server has several options allowing you to customize the Routing Server for your environment. Many of the options are self-explanatory. The two that are not are Listen on Port and IP filtering. IP filtering is explained in the next section.
The BitWise Routing Server listens on a different port than the BitWise IM client. This allows the Routing Server and the IM client to be run on the same computer without causing conflicts. You will want to set up your router (more detail in a later step) to shift the port of the incoming connections from 4137 to another port. It doesnt particularly matter which port you want to use, as long as it is not a port used by another program. The default port is 4200.
Depending on the complexity of the network, it may be desirable to filter the IP addresses that are allowed to register with the Routing Server. This can be done in the preferences. One very likely scenario would be limiting registrations to the 192.168.1.x IP addresses (192.168 is reserved for local networks). When specifying an IP as the comparison address, you can use any valid IP numbers for wildcards.
In the case shown here, the Routing Server will limit connections to computers having IP addresses of 192.168.1.x. Any number, 0 through 255, could be placed for x in the Routing Server preferences.
If you are not familiar with IP address classes and IP filtering, it will usually be safe to leave Any selected.
Setting up the physical router
The picture at right was taken from a Linksys router, other routers will have a similar capability, although it may be layed out differently. On some routers, the advanced port forwarding options are mistakingly labeled UPnP.
The router setup shows that we are accepting connections on port 4137 and then sending them inside the network on port 4200 (the default port). Enter the IP address of the machine on the network running the Routing Server, and make sure that the rule is enabled. You will want to enter a rule for both TCP and UDP (UDP is used only for voice).
Please consult your router manual for more detailed instructions about how to set up port forwarding on your specific model.
Configuring BitWise to use the Routing Server
In order for you to enjoy the connectivity benefits of the Routing Server, you will need to register with the Routing Server when you log in to BitWise. Prior to logging in to BitWise, click the Setup button next to the Connect button to open the BitWise Setup. There is an area to enter an address for the Routing Server, and to specify what port to use. The port must be the same as the port used above (4200 is the default).
Upon connecting to BitWise, you will be registered with the Routing Server. If you could not be registered, an error message will be displayed. Double-check that the correct address was entered in the Setup.
Registration with the Routing Server
Upon successfully registering with the Routing Server, the Routing Server will display the user name and the IP address of the registration. If you want to unregister a user, click on the username, and then click Unregister. Incoming connections will no longer be forwarded to the specified computer.
It is worth pointing out two things here. First, if you later log in from a different computer, and that computer is also set to use the Routing Server, you will be re-registered with your new IP address. Second, if you are unregistered, or move to another computer but are not set up to use the Routing Server, you will not be able to benefit from the services of the Routing Server.
By default, the Routing Server saves the registered user list when it is closed down.
Using the Routing Server
Assuming that everything is set up correctly, everyone that registers with the Routing Server when they log in to BitWise will be able to enjoy significantly increased connectivity with other BitWise users. As incoming connections are established, you will see the connections listed in the right pane of the Routing Server window. The IP address and the time of the connection is also displayed, and the connection is later marked when it is disconnected.
The disconnected/closed connections may be cleaned from the list at any time using the Clean List button. Only active connections will be left displayed.
<<lessThe BitWise Routing Server allows you to accept BitWise connections to multiple computers behind a router. Typically, using a router, you would set up port forwarding on BitWises client port (4137), and specify a single destination IP. This is fine until multiple users behind a router all need to accept incoming connections.
As shown by the picture at right, the Routing Server allows individual users to register themselves with the Routing Server, and then the Routing Server accepts all incoming connections and directs those connections to the appropriate user.
The Routing Server requires that your physical router support port forwarding with a way to specify different external and internal ports (this is sometimes labeled "UPnP" by many common home routers).
The Routing Server has several options allowing you to customize the Routing Server for your environment. Many of the options are self-explanatory. The two that are not are Listen on Port and IP filtering. IP filtering is explained in the next section.
The BitWise Routing Server listens on a different port than the BitWise IM client. This allows the Routing Server and the IM client to be run on the same computer without causing conflicts. You will want to set up your router (more detail in a later step) to shift the port of the incoming connections from 4137 to another port. It doesnt particularly matter which port you want to use, as long as it is not a port used by another program. The default port is 4200.
Depending on the complexity of the network, it may be desirable to filter the IP addresses that are allowed to register with the Routing Server. This can be done in the preferences. One very likely scenario would be limiting registrations to the 192.168.1.x IP addresses (192.168 is reserved for local networks). When specifying an IP as the comparison address, you can use any valid IP numbers for wildcards.
In the case shown here, the Routing Server will limit connections to computers having IP addresses of 192.168.1.x. Any number, 0 through 255, could be placed for x in the Routing Server preferences.
If you are not familiar with IP address classes and IP filtering, it will usually be safe to leave Any selected.
Setting up the physical router
The picture at right was taken from a Linksys router, other routers will have a similar capability, although it may be layed out differently. On some routers, the advanced port forwarding options are mistakingly labeled UPnP.
The router setup shows that we are accepting connections on port 4137 and then sending them inside the network on port 4200 (the default port). Enter the IP address of the machine on the network running the Routing Server, and make sure that the rule is enabled. You will want to enter a rule for both TCP and UDP (UDP is used only for voice).
Please consult your router manual for more detailed instructions about how to set up port forwarding on your specific model.
Configuring BitWise to use the Routing Server
In order for you to enjoy the connectivity benefits of the Routing Server, you will need to register with the Routing Server when you log in to BitWise. Prior to logging in to BitWise, click the Setup button next to the Connect button to open the BitWise Setup. There is an area to enter an address for the Routing Server, and to specify what port to use. The port must be the same as the port used above (4200 is the default).
Upon connecting to BitWise, you will be registered with the Routing Server. If you could not be registered, an error message will be displayed. Double-check that the correct address was entered in the Setup.
Registration with the Routing Server
Upon successfully registering with the Routing Server, the Routing Server will display the user name and the IP address of the registration. If you want to unregister a user, click on the username, and then click Unregister. Incoming connections will no longer be forwarded to the specified computer.
It is worth pointing out two things here. First, if you later log in from a different computer, and that computer is also set to use the Routing Server, you will be re-registered with your new IP address. Second, if you are unregistered, or move to another computer but are not set up to use the Routing Server, you will not be able to benefit from the services of the Routing Server.
By default, the Routing Server saves the registered user list when it is closed down.
Using the Routing Server
Assuming that everything is set up correctly, everyone that registers with the Routing Server when they log in to BitWise will be able to enjoy significantly increased connectivity with other BitWise users. As incoming connections are established, you will see the connections listed in the right pane of the Routing Server window. The IP address and the time of the connection is also displayed, and the connection is later marked when it is disconnected.
The disconnected/closed connections may be cleaned from the list at any time using the Clean List button. Only active connections will be left displayed.
Download (1.0MB)
Added: 2006-03-02 License: Freeware Price:
1331 downloads
K3DSurf 0.6.2
K3DSurf is a program who generate 3D surfaces with Mathematical formulas. more>>
K3DSurf is a program who generate 3D surfaces with Mathematical formulas ( Parameter or Explicit equations).
A more advanced version is under construction so all your comments are welcome. K3DSurf program was made just for fun, to pass time and to learn some basic 3D drawing technics(without OpenGL).
If you cant run Linux, You can find an applet Java here : http://www.wintonet.com/java/j3dsurf.html. Its called J3DSurf...I hope also to finish a Gtk an Xwindow version soon(G3DSurf and X3DSurf).
Main features:
- Interactive visualization with mouse events (Right: Rotate, Middle: translate and left: Scale).
- Real time animation (rotation) and morph (by the introduction of t_time variable). Animation and morph can also be monitored by controls that affect the CPU usage and t_time step.
- Create screenshots by copying the draw window or by using the best ray tracer on the net: Povray.
- Create movie scene is also supported
- Generate Mesh files that describe the shape of the mathematical model.
- Supported formats are:
- 1. Povscript : Povray is the best ray tracer available on the net...and its free.
- 2. VRML2: to use with the majority of current browsers via an appropriate plug-in.
- 3. OBJ: a well-known file format supported by the majority of 3D applications (Blender, MAYA and Moray...).
Enhancements:
- General:
1) New GUI interface, with menus and toolbar.
2) Possibility to save a config file to store infos about colors and isosurfaces resolution.
- Isosurface:
1) The OpenGL viewer has the possibility to go as height as 10MTriangles/Grid 500 (such objects however require more than 15G of RAM or more than 1G of hard drive space for the equivalent .OBJ file).
2) Add possibility to export the "Minimal topology" as an .OBJ file: A new table for the Marching Cube algorithm was made from scratch (released under the GPL licence, we dont think such table is available on the net) that can generate a small amount of polygons compared to the original one.
3) Add Possibility to show more than one Isosurface.
4) Possibility to store/load/delete Isosurfaces formulas.
5) Possibility to turn ON/OF the new parser for fast math calculations.
5) New examples.
- Parametric:
Possibility to store/load parametric formulas.
<<lessA more advanced version is under construction so all your comments are welcome. K3DSurf program was made just for fun, to pass time and to learn some basic 3D drawing technics(without OpenGL).
If you cant run Linux, You can find an applet Java here : http://www.wintonet.com/java/j3dsurf.html. Its called J3DSurf...I hope also to finish a Gtk an Xwindow version soon(G3DSurf and X3DSurf).
Main features:
- Interactive visualization with mouse events (Right: Rotate, Middle: translate and left: Scale).
- Real time animation (rotation) and morph (by the introduction of t_time variable). Animation and morph can also be monitored by controls that affect the CPU usage and t_time step.
- Create screenshots by copying the draw window or by using the best ray tracer on the net: Povray.
- Create movie scene is also supported
- Generate Mesh files that describe the shape of the mathematical model.
- Supported formats are:
- 1. Povscript : Povray is the best ray tracer available on the net...and its free.
- 2. VRML2: to use with the majority of current browsers via an appropriate plug-in.
- 3. OBJ: a well-known file format supported by the majority of 3D applications (Blender, MAYA and Moray...).
Enhancements:
- General:
1) New GUI interface, with menus and toolbar.
2) Possibility to save a config file to store infos about colors and isosurfaces resolution.
- Isosurface:
1) The OpenGL viewer has the possibility to go as height as 10MTriangles/Grid 500 (such objects however require more than 15G of RAM or more than 1G of hard drive space for the equivalent .OBJ file).
2) Add possibility to export the "Minimal topology" as an .OBJ file: A new table for the Marching Cube algorithm was made from scratch (released under the GPL licence, we dont think such table is available on the net) that can generate a small amount of polygons compared to the original one.
3) Add Possibility to show more than one Isosurface.
4) Possibility to store/load/delete Isosurfaces formulas.
5) Possibility to turn ON/OF the new parser for fast math calculations.
5) New examples.
- Parametric:
Possibility to store/load parametric formulas.
Download (0.56MB)
Added: 2007-06-14 License: GPL (GNU General Public License) Price:
863 downloads
Religion 1.04
Religion is a Perl module that can generate tracebacks and create and install die() and warn() handlers. more>>
Religion is a Perl module that can generate tracebacks and create and install die() and warn() handlers.
This is a second go at a module to simplify installing die() and warn() handlers, and to make such handlers easier to write and control.
For most people, this just means that if use use Religion; then youll get noticably better error reporting from warn() and die(). This is especially useful if you are using eval().
Religion provides four classes, WarnHandler, DieHandler, WarnPreHandler, and DiePreHandler, that when you construct them return closures that can be stored in variables that in turn get invoked by $SIG{__DIE__} and $SIG{__WARN__}. Note that if Religion is in use, you should not modify $SIG{__DIE__} or $SIG{__WARN__}, unless you are careful about invoking chaining to the old handler.
Religion also provides a TraceBack function, which is used by a DieHandler after you die() to give a better handle on the current scope of your situation, and provide information about where you were, which might influence where you want to go next, either returning back to where you were, or going on to the very last. [Sorry - Ed.]
See below for usage and examples.
USAGE
DieHandler SUB
Invoke like this:
$Die::Handler = new DieHandler sub {
#...
};
where #... contains your handler code. Your handler will receive the following arguments:
$message, $full_message, $level, $eval,
$iline, $ifile, $oline, $ofile, $oscope
$message is the message provided to die(). Note that the default addition of " at FILE line LINE.n" will have been stripped off if it was present. If you want to add such a message back on, feel free to do so with $iline and $ifile.
$full_message) is the message with a scope message added on if there was no newline at the end of $message. Currently, this is not the original message that die() tacked on, but something along the lines of " at line 3 of the eval at line 4 of Foo.pln".
$eval is non-zero if the die() was invoked inside an eval.
The rest of the arguments are explained in the source for Religion::TraceBack. Yes, I need to document these, but not just now, for they are a pain to explain.
Whenever you install a DieHandler, it will automatically store the current value of $Die::Handler so it can chain to it. If you want to install a handler only temporarily, use local().
If your handler returns data using return or by falling off the end, then the items returns will be used to fill back in the argument list, and the next handler in the chain, if any, will be invoked. Dont fall off the end if you dont want to change the error message.
If your handler exits using last, then no further handlers will be invoked, and the program will die immediatly.
If your handler exits using next, then the next handler in the chain will be invoked directly, without giving you a chance to change its arguments as you could if you used return.
If your handler invokes die(), then die() will proceed as if no handlers were installed. If you are inside an eval, then it will exit to the scope enclosing the eval, otherwise it will exit the program.
WarnHandler SUB
Invoke like this:
$Warn::Handler = new WarnHandler sub {
#...
};
For the rest of its explanation, see DieHandler, and subsitute warn() for die(). Note that once the last DieHandler completes (or last is invoked) then execution will return to the code that invoked warn().
DiePreHandler SUB
Invoke like this:
$Die::PreHandler = new DiePreHandler sub {
#...
};
This works identically to $Die::Handler, except that it forms a separate chain that is invoked before the DieHandler chain. Since you can use last to abort all the handlers and die immediately, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages from further handling.
This is even more useful in $Warn::PreHandler, since you can just throw away warnings that you know arent needed.
WarnPreHandler SUB
Invoke like this:
$Warn::PreHandler = new WarnPreHandler sub {
#...
};
This works identically to $Warn::Handler, except that it forms a separate chain that is invoked before the WarnHandler chain. Since you can use last to abort all the handlers and return to the program, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages.
This is very useful, since you can just throw away warnings that you know arent needed.
<<lessThis is a second go at a module to simplify installing die() and warn() handlers, and to make such handlers easier to write and control.
For most people, this just means that if use use Religion; then youll get noticably better error reporting from warn() and die(). This is especially useful if you are using eval().
Religion provides four classes, WarnHandler, DieHandler, WarnPreHandler, and DiePreHandler, that when you construct them return closures that can be stored in variables that in turn get invoked by $SIG{__DIE__} and $SIG{__WARN__}. Note that if Religion is in use, you should not modify $SIG{__DIE__} or $SIG{__WARN__}, unless you are careful about invoking chaining to the old handler.
Religion also provides a TraceBack function, which is used by a DieHandler after you die() to give a better handle on the current scope of your situation, and provide information about where you were, which might influence where you want to go next, either returning back to where you were, or going on to the very last. [Sorry - Ed.]
See below for usage and examples.
USAGE
DieHandler SUB
Invoke like this:
$Die::Handler = new DieHandler sub {
#...
};
where #... contains your handler code. Your handler will receive the following arguments:
$message, $full_message, $level, $eval,
$iline, $ifile, $oline, $ofile, $oscope
$message is the message provided to die(). Note that the default addition of " at FILE line LINE.n" will have been stripped off if it was present. If you want to add such a message back on, feel free to do so with $iline and $ifile.
$full_message) is the message with a scope message added on if there was no newline at the end of $message. Currently, this is not the original message that die() tacked on, but something along the lines of " at line 3 of the eval at line 4 of Foo.pln".
$eval is non-zero if the die() was invoked inside an eval.
The rest of the arguments are explained in the source for Religion::TraceBack. Yes, I need to document these, but not just now, for they are a pain to explain.
Whenever you install a DieHandler, it will automatically store the current value of $Die::Handler so it can chain to it. If you want to install a handler only temporarily, use local().
If your handler returns data using return or by falling off the end, then the items returns will be used to fill back in the argument list, and the next handler in the chain, if any, will be invoked. Dont fall off the end if you dont want to change the error message.
If your handler exits using last, then no further handlers will be invoked, and the program will die immediatly.
If your handler exits using next, then the next handler in the chain will be invoked directly, without giving you a chance to change its arguments as you could if you used return.
If your handler invokes die(), then die() will proceed as if no handlers were installed. If you are inside an eval, then it will exit to the scope enclosing the eval, otherwise it will exit the program.
WarnHandler SUB
Invoke like this:
$Warn::Handler = new WarnHandler sub {
#...
};
For the rest of its explanation, see DieHandler, and subsitute warn() for die(). Note that once the last DieHandler completes (or last is invoked) then execution will return to the code that invoked warn().
DiePreHandler SUB
Invoke like this:
$Die::PreHandler = new DiePreHandler sub {
#...
};
This works identically to $Die::Handler, except that it forms a separate chain that is invoked before the DieHandler chain. Since you can use last to abort all the handlers and die immediately, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages from further handling.
This is even more useful in $Warn::PreHandler, since you can just throw away warnings that you know arent needed.
WarnPreHandler SUB
Invoke like this:
$Warn::PreHandler = new WarnPreHandler sub {
#...
};
This works identically to $Warn::Handler, except that it forms a separate chain that is invoked before the WarnHandler chain. Since you can use last to abort all the handlers and return to the program, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages.
This is very useful, since you can just throw away warnings that you know arent needed.
Download (0.005MB)
Added: 2007-05-24 License: Perl Artistic License Price:
883 downloads
Application::Pipeline 0.1.1
Application::Pipeline is a module designed to map methods to different phases of an applications life cycle. more>>
Application::Pipeline is a module designed to map methods ( referred to in this role as handlers ) to different phases of an applications life cycle. By assigning methods to different phases of this pipeline, the author can concentrate on the logic for each phase and let the framework manage the application flow. Adopting the same idea as CGI::Application, writing an application with Application::Pipeline is a matter of creating a module that is a subclass of Application::Pipeline.
To build a pipeline application, it is necessary to register methods to run during each phase. This can be done one at a time, with the addHandler method. But Application::Pipeline also looks in the subclass package for the package variable %plan. This hashs keys are the names of the phases of the pipeline. Each key points to an array reference which is a list of the methods to run for that phase. The methods are either the names of the methods to run, or references to the actual methods.
This is not the be-all end-all definition of the pipeline. It is still possible to use addHandler to modify the pipeline, and as explained later, it is possible to take into account %plans defined in superclasses.
<<lessTo build a pipeline application, it is necessary to register methods to run during each phase. This can be done one at a time, with the addHandler method. But Application::Pipeline also looks in the subclass package for the package variable %plan. This hashs keys are the names of the phases of the pipeline. Each key points to an array reference which is a list of the methods to run for that phase. The methods are either the names of the methods to run, or references to the actual methods.
This is not the be-all end-all definition of the pipeline. It is still possible to use addHandler to modify the pipeline, and as explained later, it is possible to take into account %plans defined in superclasses.
Download (0.010MB)
Added: 2006-09-28 License: Perl Artistic License Price:
1121 downloads
Basset::Container::Hash 1.04
Basset::Container::Hash Perl module implements a layered hash. more>>
Basset::Container::Hash Perl module implements a layered hash. The easiest way to explain is with an example:
my %x = (a => b);
tie my %y, Basset::Container::Hash, %x; #<<less
my %x = (a => b);
tie my %y, Basset::Container::Hash, %x; #<<less
Download (0.14MB)
Added: 2007-07-24 License: Perl Artistic License Price:
822 downloads
libports 0.23.1
libports library is a simpler API for TCP sockets. more>>
libports library is a simpler API for TCP sockets.
libports is a package that can be used for creating inbound and outbound sockets. It has a few functions to read, write and create new TCP sockets.
You can create and read inbound/outbound sockets with only a few lines of code. It should compile on all Linux systems.
In the "tests" directory, you will find 3 programs you may use as references. Also, in the "docs" directory is a small howto outlining the functions. The 3 test programs are explained in short in the howto. 1 and 2 do require some modification, so read the comments.
To the best of my knowledge, this compiles on:
Platform Version x86 alpha sparc
Linux All yes yes yes
NetBSD All yes yes ??
<<lesslibports is a package that can be used for creating inbound and outbound sockets. It has a few functions to read, write and create new TCP sockets.
You can create and read inbound/outbound sockets with only a few lines of code. It should compile on all Linux systems.
In the "tests" directory, you will find 3 programs you may use as references. Also, in the "docs" directory is a small howto outlining the functions. The 3 test programs are explained in short in the howto. 1 and 2 do require some modification, so read the comments.
To the best of my knowledge, this compiles on:
Platform Version x86 alpha sparc
Linux All yes yes yes
NetBSD All yes yes ??
Download (0.022MB)
Added: 2006-05-19 License: GPL (GNU General Public License) Price:
1255 downloads
Prima::Application 1.20
Prima::Application is root of widget objects hierarchy. more>>
Prima::Application is root of widget objects hierarchy.
Prima::Application class serves as a hierarchy root for all objects with child-owner relationship. All toolkit objects, existing with non-null owner property, belong by their top-level parental relationship to Prima::Application object. There can be only one instance of Prima::Application class at a time.
SYNOPSIS
use Prima;
use Prima::Application;
or
use Prima qw(Application);
Prima::MainWindow-> create();
run Prima;
USAGE
Prima::Application class, and its only instance are treated specially throughout the toolkit. The object instance is contained in
$::application
scalar, defined in Prima.pm module. The application instance must be created whenever widget and window, or event loop functionality is desired. Usually
use Prima::Application;
code is enough, but $::application can also be assigned explicitly. The use syntax has advantage as more resistant to eventual changes in the toolkit design. It can also be used in conjunction with custom parameters hash, alike the general create() syntax:
use Prima::Application name => Test application, icon => $icon;
In addition to this functionality Prima::Application is also a wrapper to a set of system functions, not directly related to object classes. This functionality is generally explained in "API".
<<lessPrima::Application class serves as a hierarchy root for all objects with child-owner relationship. All toolkit objects, existing with non-null owner property, belong by their top-level parental relationship to Prima::Application object. There can be only one instance of Prima::Application class at a time.
SYNOPSIS
use Prima;
use Prima::Application;
or
use Prima qw(Application);
Prima::MainWindow-> create();
run Prima;
USAGE
Prima::Application class, and its only instance are treated specially throughout the toolkit. The object instance is contained in
$::application
scalar, defined in Prima.pm module. The application instance must be created whenever widget and window, or event loop functionality is desired. Usually
use Prima::Application;
code is enough, but $::application can also be assigned explicitly. The use syntax has advantage as more resistant to eventual changes in the toolkit design. It can also be used in conjunction with custom parameters hash, alike the general create() syntax:
use Prima::Application name => Test application, icon => $icon;
In addition to this functionality Prima::Application is also a wrapper to a set of system functions, not directly related to object classes. This functionality is generally explained in "API".
Download (1.4MB)
Added: 2006-07-31 License: Perl Artistic License Price:
1183 downloads
XML User Profiles 0.2.3
XML User Profiles is a system that allows for remote and transferable user accounts. more>>
XUP is an attempt to replace static per-site user accounts, which most present dynamic web sites use in absence of an easy to use and open/shared user account system. It allows people to use a single account or profile with many sites, or one of their existing user profiles on multiple other web sites.
It is best suited to so called "community" sites, where the account serves mainly for lax identification of people among each other. It does not stipulate strong authentication (while OpenID or LID can be used) and is therefore only useful for applications with mediocre security and privacy demands.
Chat and discussion sites are the main target, but profiles in different applications can often also be enriched with them. They are meant to get used secondarily (as alternative) to static/local user accounts.
The XML format of user profiles is extremely simple, as is the associated login service API. Both are outlined and explained in the introduction (HTML). The format is basically an XMLified vCard with a few additions targetted at online/web communities. It is easy to parse and generate and therefore also suitable for profile exchange or import.
Theres also a more authoritative RFC-style text version of the current proposal, which provides further hints and explanations for implementors. Future extensions will get listed in the project Wiki however (field names in the XUP format are not regulated).
This effort is quite new, and therefore only very few actual (real-world) implementations are known so far.
Some software, like discussion boards (which mostly suffer from spaghetti code), are of course hard to extent with XML User Profiles. Even those that abstract their internal user database and UI logic reasonably well can often be difficult to adapt. It is however expected that the more professional systems will sooner than later be XUP compatible.
<<lessIt is best suited to so called "community" sites, where the account serves mainly for lax identification of people among each other. It does not stipulate strong authentication (while OpenID or LID can be used) and is therefore only useful for applications with mediocre security and privacy demands.
Chat and discussion sites are the main target, but profiles in different applications can often also be enriched with them. They are meant to get used secondarily (as alternative) to static/local user accounts.
The XML format of user profiles is extremely simple, as is the associated login service API. Both are outlined and explained in the introduction (HTML). The format is basically an XMLified vCard with a few additions targetted at online/web communities. It is easy to parse and generate and therefore also suitable for profile exchange or import.
Theres also a more authoritative RFC-style text version of the current proposal, which provides further hints and explanations for implementors. Future extensions will get listed in the project Wiki however (field names in the XUP format are not regulated).
This effort is quite new, and therefore only very few actual (real-world) implementations are known so far.
Some software, like discussion boards (which mostly suffer from spaghetti code), are of course hard to extent with XML User Profiles. Even those that abstract their internal user database and UI logic reasonably well can often be difficult to adapt. It is however expected that the more professional systems will sooner than later be XUP compatible.
Download (0.23MB)
Added: 2005-07-08 License: GPL (GNU General Public License) Price:
1570 downloads
showposition 0.5
showposition is a Web-based tool that shows (using Google Maps) the position provided in the URL. more>>
showposition is a Web-based tool that shows (using Google Maps) the position provided in the URL, with a comment provided in the URL.
showposition is useful if you want to explain to somebody (e.g. on Usenet) where something is.
<<lessshowposition is useful if you want to explain to somebody (e.g. on Usenet) where something is.
Download (0.003MB)
Added: 2006-06-14 License: GPL (GNU General Public License) Price:
1228 downloads
V language 0.004
V language is a tiny concatenative language implemented for experimentation. more>>
V language is a tiny concatenative language implemented for experimentation.
The source is under Public Domain (un-copyrighted.)
The full featured language is on top of JVM, A native version (in alpha state) is also there in the codebase.
To run it, extract the distribution in any directory and do #gmake run.
gmake
gmake run
V
|
The language is a close relative of postscript, forth and joy. and is stack based. ie:
|2 3 *
=6
|2 3 * 5 +
=11
See status for a tutorial and more info.
The Functions available in V are available in this page: functions
(The releases are out of date and multiple fixes have gone in. Please check out and build rather than use them.)
Example functions in V. getting the roots (with out using the stack shuffling word view)
[quad-formula
[a b c] let
[minisub 0 b -].
[radical b b * 4 a * c * - sqrt].
[divisor 2 a *].
[root1 minisub radical + divisor /].
[root2 minisub radical - divisor /].
root1 root2
].
|2 4 -30 quad-formula ??
=(-5.0 3.0)
using view
[quad-root
[a b c : [0 b - b b * 4 a * c * - sqrt + 2 a * /]] view i
].
|2 4 -30 quad-root ??
=(3)
contrast this with the definition in scheme here
(define quadratic-formula
(lambda (a b c)
(let ([minusb (- 0 b)]
[radical (sqrt (- (* b b) (* 4 ( * a c))))]
[divisor (* 2 a)] )
let ([root1 (/ (+ minusb radical) divisor)]
[root2 (/ (- minusb radical) divisor)])
(cons root1 root2)))))
Definition of Qsort.
[qsort
#definitions
[joinparts [pivot [*list1] [*list2] : [*list1 pivot *list2]] view].
[split_on_first_element uncons [>] split&].
#args starts for binrec. notice that 2 arguments (termination condition
#and its result) are on first line.
[small?] []
[split_on_first_element]
#binrec recurses on the result of split_on_first_element before applying joinparts.
[joinparts]
binrec].
Some explanations.
The first and second lines (terminated by .) are internal function definitions
(Notice how qsort is also terminated by .) . is the definition syntax in V.
The first function joinparts
============================
The function joinpart contains just an application of the operator view.
view is list translator. It takes a list of the form [template : result]
then it tries to apply the template to the current stack. If it can be applied on the
stack, then the arguments named in the template are bound to values in stack. The result is then processed, and all the bound elements in result are replaced by their values.
[pivot [*list1] [*list2] : [*list1 pivot *list2]] view expects 3 arguments on the stack,
the first a single element pivot, then two lists list1 and list2.
It returns a list that is composed of elements of list1 followed by pivot
followed by elements of list2 (as defined in result - RHS of :).
ie:
44 [1 2 3] [5 6 7] [pivot [*list1] [*list2] : [*list1 pivot *list2]] view ??
=> [1 2 3 44 5 6 7]
(The function ?? is used to print out the elements in the stack now.)
The second function split_on_first_element
==========================================
The definition is [uncons [>] split&]
The uncons splits a list into the first element and the rest of the list.
ie:
[1 2 3 4 5] uncons ??
=1 [2 3 4 5]
split& takes two arguments, the first is the function F to split a list with,
and the second the list itself. All elements in the list that passes the function F
is put into the first list, and all that do not are put into the second list.
ie:
[1 2 3 4 5 6 7] [4 >] split& ??
=[5 6 7] [1 2 3 4]
The function F can also take an argument from the stack. so this also works.
4 [1 2 3 4 5 6 7] [>] split& ??
=[5 6 7] [1 2 3 4]
Thus the split_on_first_element takes the first element of a list, and split that
list based on that element as a filter.
binrec
=======
binrec expects 4 arguments,
Arg1 is the terminating condition,
Arg2 is the result if the terminating condition is met.
Arg3 is an executable statement that returns two entities.
The entire binrec statement is performed on each of the
two entities until the terminating condition is met.
Arg4 is what to do with the result of the previous statement.
Algorithm.
Here, the small? checks if the list is empty or contains just one element.
if it is, then the result is arg2 - []
ie:
[] small? ??
=true
[1] small? ??
=true
[1 2 3 4] small? ??
=false
split_on_first_element takes is executed on all lists that are larger than size 1
and as explained above, splits them into two based on the first element.
on the resultent lists, the entire qsort is performed again due to binrec.
The last joinparts takes these elements (pivot list1 list2) which are present now
on the stack, and combines them to produce a single sorted list.
A slightly friendlier function (with out the binrec.)
[qsort
[joinparts [pivot [*list1] [*list2] : [*list1 pivot *list2]] view].
[split_on_first_element uncons [>] split&].
[small?]
[]
[split_on_first_element [list1 list2 : [list1 qsort list2 qsort joinparts]] view i]
ifte].
The binrec and friends are more powerful than the explicit recursion done above, but for people new to concatenative languages, this kind of recursion may look more intuitive.
Enhancements:
- The language has become relatively stable.
- Lots of bugfixes were made in scope handling.
- Tree operations were added.
- Generic combinators were moved out into a separate library.
<<lessThe source is under Public Domain (un-copyrighted.)
The full featured language is on top of JVM, A native version (in alpha state) is also there in the codebase.
To run it, extract the distribution in any directory and do #gmake run.
gmake
gmake run
V
|
The language is a close relative of postscript, forth and joy. and is stack based. ie:
|2 3 *
=6
|2 3 * 5 +
=11
See status for a tutorial and more info.
The Functions available in V are available in this page: functions
(The releases are out of date and multiple fixes have gone in. Please check out and build rather than use them.)
Example functions in V. getting the roots (with out using the stack shuffling word view)
[quad-formula
[a b c] let
[minisub 0 b -].
[radical b b * 4 a * c * - sqrt].
[divisor 2 a *].
[root1 minisub radical + divisor /].
[root2 minisub radical - divisor /].
root1 root2
].
|2 4 -30 quad-formula ??
=(-5.0 3.0)
using view
[quad-root
[a b c : [0 b - b b * 4 a * c * - sqrt + 2 a * /]] view i
].
|2 4 -30 quad-root ??
=(3)
contrast this with the definition in scheme here
(define quadratic-formula
(lambda (a b c)
(let ([minusb (- 0 b)]
[radical (sqrt (- (* b b) (* 4 ( * a c))))]
[divisor (* 2 a)] )
let ([root1 (/ (+ minusb radical) divisor)]
[root2 (/ (- minusb radical) divisor)])
(cons root1 root2)))))
Definition of Qsort.
[qsort
#definitions
[joinparts [pivot [*list1] [*list2] : [*list1 pivot *list2]] view].
[split_on_first_element uncons [>] split&].
#args starts for binrec. notice that 2 arguments (termination condition
#and its result) are on first line.
[small?] []
[split_on_first_element]
#binrec recurses on the result of split_on_first_element before applying joinparts.
[joinparts]
binrec].
Some explanations.
The first and second lines (terminated by .) are internal function definitions
(Notice how qsort is also terminated by .) . is the definition syntax in V.
The first function joinparts
============================
The function joinpart contains just an application of the operator view.
view is list translator. It takes a list of the form [template : result]
then it tries to apply the template to the current stack. If it can be applied on the
stack, then the arguments named in the template are bound to values in stack. The result is then processed, and all the bound elements in result are replaced by their values.
[pivot [*list1] [*list2] : [*list1 pivot *list2]] view expects 3 arguments on the stack,
the first a single element pivot, then two lists list1 and list2.
It returns a list that is composed of elements of list1 followed by pivot
followed by elements of list2 (as defined in result - RHS of :).
ie:
44 [1 2 3] [5 6 7] [pivot [*list1] [*list2] : [*list1 pivot *list2]] view ??
=> [1 2 3 44 5 6 7]
(The function ?? is used to print out the elements in the stack now.)
The second function split_on_first_element
==========================================
The definition is [uncons [>] split&]
The uncons splits a list into the first element and the rest of the list.
ie:
[1 2 3 4 5] uncons ??
=1 [2 3 4 5]
split& takes two arguments, the first is the function F to split a list with,
and the second the list itself. All elements in the list that passes the function F
is put into the first list, and all that do not are put into the second list.
ie:
[1 2 3 4 5 6 7] [4 >] split& ??
=[5 6 7] [1 2 3 4]
The function F can also take an argument from the stack. so this also works.
4 [1 2 3 4 5 6 7] [>] split& ??
=[5 6 7] [1 2 3 4]
Thus the split_on_first_element takes the first element of a list, and split that
list based on that element as a filter.
binrec
=======
binrec expects 4 arguments,
Arg1 is the terminating condition,
Arg2 is the result if the terminating condition is met.
Arg3 is an executable statement that returns two entities.
The entire binrec statement is performed on each of the
two entities until the terminating condition is met.
Arg4 is what to do with the result of the previous statement.
Algorithm.
Here, the small? checks if the list is empty or contains just one element.
if it is, then the result is arg2 - []
ie:
[] small? ??
=true
[1] small? ??
=true
[1 2 3 4] small? ??
=false
split_on_first_element takes is executed on all lists that are larger than size 1
and as explained above, splits them into two based on the first element.
on the resultent lists, the entire qsort is performed again due to binrec.
The last joinparts takes these elements (pivot list1 list2) which are present now
on the stack, and combines them to produce a single sorted list.
A slightly friendlier function (with out the binrec.)
[qsort
[joinparts [pivot [*list1] [*list2] : [*list1 pivot *list2]] view].
[split_on_first_element uncons [>] split&].
[small?]
[]
[split_on_first_element [list1 list2 : [list1 qsort list2 qsort joinparts]] view i]
ifte].
The binrec and friends are more powerful than the explicit recursion done above, but for people new to concatenative languages, this kind of recursion may look more intuitive.
Enhancements:
- The language has become relatively stable.
- Lots of bugfixes were made in scope handling.
- Tree operations were added.
- Generic combinators were moved out into a separate library.
Download (0.10MB)
Added: 2007-07-25 License: MIT/X Consortium License Price:
824 downloads
Sub::Slice::Manual 1.048
Sub::Slice::Manual is a Perl module with user guide for Sub::Slice. more>>
Sub::Slice::Manual is a Perl module with user guide for Sub::Slice.
USING Sub::Slice
Sub::Slice is a way of breaking down a long-running process and maintaining state across a stateless protocol. This allows the client to draw a progress bar or abort the process part-way through.
The mechanism used by Sub::Slice is similar to the session management used on many web user authentication systems. However rather than simply passing an ID back as a token as these systems do, in Sub::Slice a data structure with richer information is passed to the client, allowing the client to make some intelligent decisions rather than blindly maintain state.
Use of Sub::Slice is best explained with a minimal example. Assume that there is a remoting protocol between the client and server such as XML/HTTP. For the sake of brevity, assume that methods called in package Server:: on the client are magically remoted to the server.
The server does two things. The first is to issue a token for the client to use:
#Server
sub create_token {
my $job = new Sub::Slice();
return $job->token;
}
The second is to provide the routine into which the token is passed for each iteration:
sub do_work {
my $token = shift;
my $job = new Sub::Slice(token => $token);
at_start $job sub {
my $files = files_to_process();
#Store some data defining the work to do
$job->store("files", $files);
};
at_stage $job "each_iteration" sub {
#Get some work
my $files = $job->fetch("files");
my $file = shift @$files;
my $was_ok = process_file($file);
#Record we did the work
$job->store("files", $files);
#Check if theres any more work left to do
$job->done() unless(@$files);
};
}
The client somehow gets a token back from the server. It then passes this back to the server for each iteration. It can inspect the token to check if there is any more work left.
#Client
my $token = Server::create_token();
for(1 .. MAX_ITERATIONS) {
Server::do_work($token);
last if $token->{done};
}
<<lessUSING Sub::Slice
Sub::Slice is a way of breaking down a long-running process and maintaining state across a stateless protocol. This allows the client to draw a progress bar or abort the process part-way through.
The mechanism used by Sub::Slice is similar to the session management used on many web user authentication systems. However rather than simply passing an ID back as a token as these systems do, in Sub::Slice a data structure with richer information is passed to the client, allowing the client to make some intelligent decisions rather than blindly maintain state.
Use of Sub::Slice is best explained with a minimal example. Assume that there is a remoting protocol between the client and server such as XML/HTTP. For the sake of brevity, assume that methods called in package Server:: on the client are magically remoted to the server.
The server does two things. The first is to issue a token for the client to use:
#Server
sub create_token {
my $job = new Sub::Slice();
return $job->token;
}
The second is to provide the routine into which the token is passed for each iteration:
sub do_work {
my $token = shift;
my $job = new Sub::Slice(token => $token);
at_start $job sub {
my $files = files_to_process();
#Store some data defining the work to do
$job->store("files", $files);
};
at_stage $job "each_iteration" sub {
#Get some work
my $files = $job->fetch("files");
my $file = shift @$files;
my $was_ok = process_file($file);
#Record we did the work
$job->store("files", $files);
#Check if theres any more work left to do
$job->done() unless(@$files);
};
}
The client somehow gets a token back from the server. It then passes this back to the server for each iteration. It can inspect the token to check if there is any more work left.
#Client
my $token = Server::create_token();
for(1 .. MAX_ITERATIONS) {
Server::do_work($token);
last if $token->{done};
}
Download (0.027MB)
Added: 2006-09-18 License: Perl Artistic License Price:
1132 downloads
mirrorlinks 1.0.0
mirrorlinks is a small script that automatically mirrors the contents of a directory into another directory using symbolic links more>>
mirrorlinks project is a small script that automatically mirrors the contents of a directory into another directory using symbolic links, so you dont waste unnecessary disk space in copies.
This is better explained by example, of course:
You have directories Music, Movies and Shared.
You want to mirror both the contents of Music and the contents of Movies into Shared. For some specific reason, you dont want to place links to Movies and Music into Shared,
With mirrorlinks, thats easy to do:
mirrorlinks Music Shared
mirrorlinks Music Movies
Now Shared has the contents of both the Music and Movies directories. To be more accurate, Shared has the directory structure of both Music and Movies merged into one single directory, with symbolic links pointing to the actual files. So if you had files into Music/ATB, Shared would contain a folder named ATB, and this folder would contain links to the files in Music/ATB.
<<lessThis is better explained by example, of course:
You have directories Music, Movies and Shared.
You want to mirror both the contents of Music and the contents of Movies into Shared. For some specific reason, you dont want to place links to Movies and Music into Shared,
With mirrorlinks, thats easy to do:
mirrorlinks Music Shared
mirrorlinks Music Movies
Now Shared has the contents of both the Music and Movies directories. To be more accurate, Shared has the directory structure of both Music and Movies merged into one single directory, with symbolic links pointing to the actual files. So if you had files into Music/ATB, Shared would contain a folder named ATB, and this folder would contain links to the files in Music/ATB.
Download (0.002MB)
Added: 2006-06-30 License: GPL (GNU General Public License) Price:
1211 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above isosurfaces explained search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed