code blocks
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 5847
Code::Blocks 1.0 RC2
Code::Blocks is a C/C++ IDE built with configurability and extensibility in mind. more>>
Code::Blocks is a free C++ IDE built specifically to meet the most demanding needs of its users. The Code::Blocks project was designed, right from the start, to be extensible and configurable.
Built around a plugin framework, Code::Blocks can be extended with plugin DLLs. It includes a plugin wizard so you can compile your own plugins! (Free SDK downloaded separately)
Main features:
- Open Source! GPL2, no hidden costs.
- Cross-platform. Runs on Linux or Windows (uses wxWidgets).
- Made in GNU C++. No interpreted languages or proprietary libs needed.
- Comes in two presentations: Standalone, and MinGW bundle
- Devpack support (optional)
- Extensible thru plugins (SDK available in the downloads section)
- Multiple compiler support:
- GCC (MingW / Linux GCC)
- MSVC++
- Digital Mars
- Borland C++ 5.5
- Open Watcom
- Compiles directly or with makefiles
- Predefined project templates
- Custom template support
- Uses XML format for project files.
- Multi-target projects
- Workspaces support
- Imports MSVC projects and workspaces (NOTE: assembly code and inter-project dependencies not supported yet)
- Imports Dev-C++ projects
- Integrates with GDB for debugging
- Syntax highlighting, customizable and extensible
- Code folding for C++ and XML files.
- Tabbed interface
- Code completion plugin
- Class Browser
- Smart indent
- One-key swap between .h and .c/.cpp files
- Open files list for quick switching between files (optional)
- External customizable "Tools"
- To-do list management with different users
<<lessBuilt around a plugin framework, Code::Blocks can be extended with plugin DLLs. It includes a plugin wizard so you can compile your own plugins! (Free SDK downloaded separately)
Main features:
- Open Source! GPL2, no hidden costs.
- Cross-platform. Runs on Linux or Windows (uses wxWidgets).
- Made in GNU C++. No interpreted languages or proprietary libs needed.
- Comes in two presentations: Standalone, and MinGW bundle
- Devpack support (optional)
- Extensible thru plugins (SDK available in the downloads section)
- Multiple compiler support:
- GCC (MingW / Linux GCC)
- MSVC++
- Digital Mars
- Borland C++ 5.5
- Open Watcom
- Compiles directly or with makefiles
- Predefined project templates
- Custom template support
- Uses XML format for project files.
- Multi-target projects
- Workspaces support
- Imports MSVC projects and workspaces (NOTE: assembly code and inter-project dependencies not supported yet)
- Imports Dev-C++ projects
- Integrates with GDB for debugging
- Syntax highlighting, customizable and extensible
- Code folding for C++ and XML files.
- Tabbed interface
- Code completion plugin
- Class Browser
- Smart indent
- One-key swap between .h and .c/.cpp files
- Open files list for quick switching between files (optional)
- External customizable "Tools"
- To-do list management with different users
Download (2.6MB)
Added: 2005-11-28 License: GPL (GNU General Public License) Price:
1591 downloads
MIM Blocks 0.1
MIM Blocks is a set of blocks games (sokoban, taquin and various others) in 3D. more>>
MIM Blocks is a set of blocks games (sokoban, taquin and various others) in 3D.
Mim-Blocks is reflexion game, where the goal is to merge different blocks of the same color, by moving them inside a maze. Its still at an early stage of developement, but looks promising!
<<lessMim-Blocks is reflexion game, where the goal is to merge different blocks of the same color, by moving them inside a maze. Its still at an early stage of developement, but looks promising!
Download (0.67MB)
Added: 2005-08-26 License: GPL (GNU General Public License) Price:
1519 downloads
Task Blocks 0.5
Task Blocks software can help you schedule projects consisted of many tasks. more>> <<less
Download (0.12MB)
Added: 2007-08-13 License: GPL (GNU General Public License) Price:
804 downloads
Gnome Memory Blocks 0.2
Gnome Memory Blocks project is a concentration game for GNOME. more>>
Gnome Memory Blocks project is a concentration game for GNOME.
This is GNOMEs version of the `memory blocks game originaly come from Semantec game pack for Win-3.11
<<lessThis is GNOMEs version of the `memory blocks game originaly come from Semantec game pack for Win-3.11
Download (0.42MB)
Added: 2006-12-05 License: GPL (GNU General Public License) Price:
1062 downloads
Puzzle Blocks 0.5.3
Puzzle Blocks is a multi-platform puzzle game, designed for both Linux and Windows. more>>
Turts Puzzle Blocks multi-platform puzzle game, designed for both Linux and Windows. Turts Puzzle Blocks is also the current project of Turt99 Productions. The goal of the project is to gain experience C++ and Object Oriented Design, as well as to help in the learn process of Linux as a development platform.
Turts Puzzle Blocks has actually gone through many stages; it started its life as "Turts Breakdown". At this point the graphics where being designed so the "blocks" didnt exists. Once the "blocks" where created there was a need for the name to be changed, and a lot of new modes (or mini games) seemed to fall into the design. As of the Beta release you are basically seeing what "Turts Breakdown" was to be, however there are many more plans for Turts Puzzle Blocks.
Turts Puzzle Blocks is created using KDevelop 2.1 under Linux Redhat 9.0, and uses the SDL libraries. SDL was chosen because it is a multi-platform library that would allow the seamless development for 2 operating systems. SDL main library supplies the support for the windows and the display, but Turts Puzzle Blocks also uses two additional SDL libraries SDL_image and SDL_Mixer. SDL_image supports the use for PNG and TGA files, which allows for Alpha blending and results in clean lines and smooth graphics. SDL_mixer is used for playing sounds and the background music.
<<lessTurts Puzzle Blocks has actually gone through many stages; it started its life as "Turts Breakdown". At this point the graphics where being designed so the "blocks" didnt exists. Once the "blocks" where created there was a need for the name to be changed, and a lot of new modes (or mini games) seemed to fall into the design. As of the Beta release you are basically seeing what "Turts Breakdown" was to be, however there are many more plans for Turts Puzzle Blocks.
Turts Puzzle Blocks is created using KDevelop 2.1 under Linux Redhat 9.0, and uses the SDL libraries. SDL was chosen because it is a multi-platform library that would allow the seamless development for 2 operating systems. SDL main library supplies the support for the windows and the display, but Turts Puzzle Blocks also uses two additional SDL libraries SDL_image and SDL_Mixer. SDL_image supports the use for PNG and TGA files, which allows for Alpha blending and results in clean lines and smooth graphics. SDL_mixer is used for playing sounds and the background music.
Download (1.0MB)
Added: 2005-09-05 License: GPL (GNU General Public License) Price:
1515 downloads
X11Blocks 0.0.1
X11Blocks package is an Objective-C Block oriented X Window System Toolkit. more>>
X11Blocks package is an Objective-C Block oriented X Window System Toolkit.
X11Blocks is a layer above "Xlib" (version 11) and provides functionality that is similar to the "Xt" (X Intrinsics) and Xaw widget libraries.
Whereas much of the X Intrinsics is dedicated to implementing a classing system in C, X11Blocks uses Objective-C (an extension of C) for this purpose.
X11Blocks makes extensive use of Objective-C "Blocks", where Blocks play a role similar to callbacks in the Intrinsics.
Objective-C Blocks, also known as Block closures or Action Expressions, are pieces of code represented by instances of an Objective-C class (called Block) for delayed evaluation.
For example, the action in a "MenuItem" object is a Block.
Blocks are useful for "event-based" programming and offer a significant advantage over "callbacks" in that Blocks can refer to and alter the context in which a Block was created.
<<lessX11Blocks is a layer above "Xlib" (version 11) and provides functionality that is similar to the "Xt" (X Intrinsics) and Xaw widget libraries.
Whereas much of the X Intrinsics is dedicated to implementing a classing system in C, X11Blocks uses Objective-C (an extension of C) for this purpose.
X11Blocks makes extensive use of Objective-C "Blocks", where Blocks play a role similar to callbacks in the Intrinsics.
Objective-C Blocks, also known as Block closures or Action Expressions, are pieces of code represented by instances of an Objective-C class (called Block) for delayed evaluation.
For example, the action in a "MenuItem" object is a Block.
Blocks are useful for "event-based" programming and offer a significant advantage over "callbacks" in that Blocks can refer to and alter the context in which a Block was created.
Download (0.050MB)
Added: 2007-02-15 License: GPL (GNU General Public License) Price:
981 downloads
Building Block 1-0-0
Building Block ist the Open Source Content Management Software for your website. more>>
Building Block ist the Open Source Content Management Software for your website. It is lightweight and has minimal hardware requirements.
At the same time it is powerful and delivers high performance. Building Blocks diversity allows you to create and manage professional web projects directly in your browser.
Enhancements:
- This initial release is stable and is recommended for production use on non-critical data.
<<lessAt the same time it is powerful and delivers high performance. Building Blocks diversity allows you to create and manage professional web projects directly in your browser.
Enhancements:
- This initial release is stable and is recommended for production use on non-critical data.
Download (0.064MB)
Added: 2006-06-26 License: GPL (GNU General Public License) Price:
1216 downloads
Bio::NEXUS::Block 0.67
Bio::NEXUS::Block is a Perl module that provides useful functions for blocks in NEXUS file (parent class). more>>
Bio::NEXUS::Block is a Perl module that provides useful functions for blocks in NEXUS file (parent class).
SYNOPSIS
This module is the super class of all NEXUS block classes. It is not used specifically from a program; in other words, you dont create a new Bio::NEXUS::Block object. Other modules, like AssumptionsBlock, simply inherit subroutines from this module.
Provides a few useful functions for general blocks (to be used by sub-classes).
METHODS
clone
Title : clone
Usage : my $newblock = $block->clone();
Function: clone a block object (shallow)
Returns : Block object
Args : none
get_type
Title : get_type
Usage : print $block->get_type();
Function: Returns a string containing the block type
Returns : type (string)
Args : none
set_ntax
Title : set_ntax
Usage : print $block->set_ntax();
Function: Sets the value of Dimensions:ntax
Returns : none
Args : number of taxa (scalar)
set_dimensions
Title : set_dimensions
Usage : $block->set_dimensions($dimensions);
Function: set a dimensions command
Returns : none
Args : hash content of dimensions command
get_dimensions
Title : get_dimensions
Usage : $block->get_dimensions($attribute);
Function: get a dimensions command
Returns : hash content of dimensions command, or the value for a particular attribute if specified
Args : none, or a string
set_command
Title : set_command
Usage : $block->set_command($command, $content);
Function: Set a command
Returns : none
Args : comand name, and content (string)
set_title
Title : set_title
Usage : $block->set_title($name);
Function: Set the block name
Returns : none
Args : block name (string)
get_title
Title : get_title
Usage : $block->get_title();
Function: Returns a string containing the block title
Returns : name (string)
Args : none
set_link
Title : set_link
Usage : $block->set_link($link_hashref);
Function: Set the block link commands
Returns : none
Args : block link (hash)
add_link
Title : add_link
Usage : $block->add_link($linkname, $title);
Function: add a link command
Returns : none
Args : $link, $title (of another block)
get_link
Title : get_link
Usage : $block->get_link();
Function: Returns a hash containing the block links
Returns : link (hash)
Args : none
set_taxlabels
Title : set_taxlabels
Usage : $block->set_taxlabels($labels);
Function: Set the taxa names
Returns : none
Args : array of taxa names
add_taxlabel
Title : add_taxlabel
Usage : $block->add_taxlabel($label);
Function: add a taxon name
Returns : none
Args : a taxon name
get_taxlabels
Title : get_taxlabels
Usage : $block->get_taxlabels();
Function: Returns an array of taxa labels
Returns : taxa names
Args : none
set_otus
Title : set_otus
Usage : $block->set_otus($otus);
Function: sets the list of OTUs
Returns : none
Args : array of OTUs
get_otus
Title : get_otus
Usage : $block->get_otus();
Function: Returns array of otus
Returns : all otus
Args : none
set_otuset
Title : set_otuset
Usage : $block->set_otuset($otuset);
Function: Set the otus
Returns : none
Args : TaxUnitSet object
get_otuset
Title : get_otuset
Usage : $block->get_otuset();
Function: get the OTUs
Returns : TaxUnitSet object
Args : none
select_otus
Title : select_otus
Usage : $block->select_otus($names);
Function: select a subset of OTUs
Returns : array of OTUs
Args : OTU names
rename_otus
Title : rename_otus
Usage : $block->rename_otus($names);
Function: rename all OTUs
Returns : none
Args : hash of OTU names
set_comments
Title : set_comments
Usage : $block->set_comments($comments);
Function: Set the block comments
Returns : none
Args : block comments (array of strings)
get_comments
Title : get_comments
Usage : $block->get_comments();
Function: Returns block comments
Returns : comments (array of strings)
Args : none
add_comment
Title : add_comment
Usage : $block->add_comment($comment);
Function: add a comment
Returns : none
Args : comment (string)
equals
Name : equals
Usage : $block->equals($another);
Function: compare if two Block objects are equal
Returns : boolean
Args : a Block object
<<lessSYNOPSIS
This module is the super class of all NEXUS block classes. It is not used specifically from a program; in other words, you dont create a new Bio::NEXUS::Block object. Other modules, like AssumptionsBlock, simply inherit subroutines from this module.
Provides a few useful functions for general blocks (to be used by sub-classes).
METHODS
clone
Title : clone
Usage : my $newblock = $block->clone();
Function: clone a block object (shallow)
Returns : Block object
Args : none
get_type
Title : get_type
Usage : print $block->get_type();
Function: Returns a string containing the block type
Returns : type (string)
Args : none
set_ntax
Title : set_ntax
Usage : print $block->set_ntax();
Function: Sets the value of Dimensions:ntax
Returns : none
Args : number of taxa (scalar)
set_dimensions
Title : set_dimensions
Usage : $block->set_dimensions($dimensions);
Function: set a dimensions command
Returns : none
Args : hash content of dimensions command
get_dimensions
Title : get_dimensions
Usage : $block->get_dimensions($attribute);
Function: get a dimensions command
Returns : hash content of dimensions command, or the value for a particular attribute if specified
Args : none, or a string
set_command
Title : set_command
Usage : $block->set_command($command, $content);
Function: Set a command
Returns : none
Args : comand name, and content (string)
set_title
Title : set_title
Usage : $block->set_title($name);
Function: Set the block name
Returns : none
Args : block name (string)
get_title
Title : get_title
Usage : $block->get_title();
Function: Returns a string containing the block title
Returns : name (string)
Args : none
set_link
Title : set_link
Usage : $block->set_link($link_hashref);
Function: Set the block link commands
Returns : none
Args : block link (hash)
add_link
Title : add_link
Usage : $block->add_link($linkname, $title);
Function: add a link command
Returns : none
Args : $link, $title (of another block)
get_link
Title : get_link
Usage : $block->get_link();
Function: Returns a hash containing the block links
Returns : link (hash)
Args : none
set_taxlabels
Title : set_taxlabels
Usage : $block->set_taxlabels($labels);
Function: Set the taxa names
Returns : none
Args : array of taxa names
add_taxlabel
Title : add_taxlabel
Usage : $block->add_taxlabel($label);
Function: add a taxon name
Returns : none
Args : a taxon name
get_taxlabels
Title : get_taxlabels
Usage : $block->get_taxlabels();
Function: Returns an array of taxa labels
Returns : taxa names
Args : none
set_otus
Title : set_otus
Usage : $block->set_otus($otus);
Function: sets the list of OTUs
Returns : none
Args : array of OTUs
get_otus
Title : get_otus
Usage : $block->get_otus();
Function: Returns array of otus
Returns : all otus
Args : none
set_otuset
Title : set_otuset
Usage : $block->set_otuset($otuset);
Function: Set the otus
Returns : none
Args : TaxUnitSet object
get_otuset
Title : get_otuset
Usage : $block->get_otuset();
Function: get the OTUs
Returns : TaxUnitSet object
Args : none
select_otus
Title : select_otus
Usage : $block->select_otus($names);
Function: select a subset of OTUs
Returns : array of OTUs
Args : OTU names
rename_otus
Title : rename_otus
Usage : $block->rename_otus($names);
Function: rename all OTUs
Returns : none
Args : hash of OTU names
set_comments
Title : set_comments
Usage : $block->set_comments($comments);
Function: Set the block comments
Returns : none
Args : block comments (array of strings)
get_comments
Title : get_comments
Usage : $block->get_comments();
Function: Returns block comments
Returns : comments (array of strings)
Args : none
add_comment
Title : add_comment
Usage : $block->add_comment($comment);
Function: add a comment
Returns : none
Args : comment (string)
equals
Name : equals
Usage : $block->equals($another);
Function: compare if two Block objects are equal
Returns : boolean
Args : a Block object
Download (0.15MB)
Added: 2006-12-20 License: Perl Artistic License Price:
1038 downloads
XML::Code 0.04
XML::Diff is a Perl module for XML DOM-Tree based Diff & Patch Module. more>>
XML::Diff is a Perl module for XML DOM-Tree based Diff & Patch Module.
SYNOPSIS
my $diff = XML::Diff->new();
# to generate a diffgram of two XML files, use compare.
# $old and $new can be filepaths, XML as a string,
# XML::LibXML::Document or XML::LibXML::Element objects.
# The diffgram is a XML::LibXML::Document by default.
my $diffgram = $diff->compare(
-old => $old_xml,
-new => $new_xml,
);
# To patch an XML document, an patch. $old and $diffgram
# follow the same formatting rules as compare.
# The resulting XML is a XML::LibXML::Document by default.
my $patched = $diff->patch(
-old => $old,
-diffgram => $diffgram,
);
This module provides methods for generating and applying an XML diffgram of two related XML files. The basis of the algorithm is tree-wise comparison using the DOM model as provided by XML::LibXML.
The Diffgram is well-formed XML in the XVCS namespance and supports update, insert, delete and move operations. It is meant to be human and machine readable. It uses XPath expressions for locating the nodes to operate on.
<<lessSYNOPSIS
my $diff = XML::Diff->new();
# to generate a diffgram of two XML files, use compare.
# $old and $new can be filepaths, XML as a string,
# XML::LibXML::Document or XML::LibXML::Element objects.
# The diffgram is a XML::LibXML::Document by default.
my $diffgram = $diff->compare(
-old => $old_xml,
-new => $new_xml,
);
# To patch an XML document, an patch. $old and $diffgram
# follow the same formatting rules as compare.
# The resulting XML is a XML::LibXML::Document by default.
my $patched = $diff->patch(
-old => $old,
-diffgram => $diffgram,
);
This module provides methods for generating and applying an XML diffgram of two related XML files. The basis of the algorithm is tree-wise comparison using the DOM model as provided by XML::LibXML.
The Diffgram is well-formed XML in the XVCS namespance and supports update, insert, delete and move operations. It is meant to be human and machine readable. It uses XPath expressions for locating the nodes to operate on.
Download (0.017MB)
Added: 2006-09-14 License: Perl Artistic License Price:
1138 downloads
Pretty Code Web 1.00
Pretty Code Web is a syntax highlighter for publishing code, written in any programming language, to the Web. more>>
Pretty Code Web is a syntax highlighter for publishing code, written in any programming language, to the web.
Written in php it uses syntax files separate from the main code to highlight a specified language.
Main features:
- Syntax highlighting for (potentially) any language.
- User defined syntax files.
- User defined colors
- Separate colors for:
- 6 Keyword Groups
- Text Strings
- Operators
- Block and Line Comments
- Bracket Characters
<<lessWritten in php it uses syntax files separate from the main code to highlight a specified language.
Main features:
- Syntax highlighting for (potentially) any language.
- User defined syntax files.
- User defined colors
- Separate colors for:
- 6 Keyword Groups
- Text Strings
- Operators
- Block and Line Comments
- Bracket Characters
Download (0.024MB)
Added: 2005-10-20 License: Free for non-commercial use Price:
1470 downloads
Code::Perl 0.03
Code::Perl is a Perl module to produce Perl code from a tree. more>>
Code::Perl is a Perl module to produce Perl code from a tree.
SYNOPSIS
use Code::Perl::Expr qw( :easy );
my $c = derefh(scal(hash), calls(getkey));
print $c->perl; # ($hash)->{getkey()}
Code::Perl allows you to build chunks of Perl code as a tree and then when youre finished building, the tree can output the Perl code. This is useful if you have built your own mini-language and you want to generate Perl from it. Rather than generating the Perl at parse time and having to worry about quoting, escaping, parenthese etc, you can just build a tree using Code::Perl and then dump out the correct Perl at the end.
<<lessSYNOPSIS
use Code::Perl::Expr qw( :easy );
my $c = derefh(scal(hash), calls(getkey));
print $c->perl; # ($hash)->{getkey()}
Code::Perl allows you to build chunks of Perl code as a tree and then when youre finished building, the tree can output the Perl code. This is useful if you have built your own mini-language and you want to generate Perl from it. Rather than generating the Perl at parse time and having to worry about quoting, escaping, parenthese etc, you can just build a tree using Code::Perl and then dump out the correct Perl at the end.
Download (0.017MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1127 downloads

Html Code Convert 3.3
Speed up the conversion of HTML code into different format more>>
HTML Code Convert helps speed up the conversion of HTML code into different format including Java Script, JavaServer Pages, Microsoft ASP, PHP, Perl, Python, and the UNIX Shell. It is particularly useful in CGI scripting.
Enhancements:
- Colors and font selected in prefeferences box.
- Fixe bug with Quit button. First try to support accessibility.
- Updated schemas.
<<lessEnhancements:
- Colors and font selected in prefeferences box.
- Fixe bug with Quit button. First try to support accessibility.
- Updated schemas.
Download (184KB)
Added: 2009-04-29 License: Freeware Price:
198 downloads
Block Rage 0.2.3
Block Rage will be a falling blocks game with detailed graphics and animated plasmatic backgrounds. more>>
Block Rage will be a falling blocks game with detailed graphics and animated plasmatic backgrounds.
You will be able to challenge your friend in a 2-player hotseat mode! It is strongly inspired by a superb DOS classic.
At present, the game is fully playable, but theres no real graphics nor sounds and absolutely no music.
Enhancements:
- New tile graphics
- Enhanced 2-player screen
- Improved sound module
- Fixed caps lock handling
- Sets window caption
- Other fixes
<<lessYou will be able to challenge your friend in a 2-player hotseat mode! It is strongly inspired by a superb DOS classic.
At present, the game is fully playable, but theres no real graphics nor sounds and absolutely no music.
Enhancements:
- New tile graphics
- Enhanced 2-player screen
- Improved sound module
- Fixed caps lock handling
- Sets window caption
- Other fixes
Download (0.063MB)
Added: 2005-10-25 License: GPL (GNU General Public License) Price:
1462 downloads
Code::Splice 0.01
Code::Splice injects the contents of one subroutine at a specified point elsewhere. more>>
Code::Splice injects the contents of one subroutine at a specified point elsewhere.
SYNOPSIS
use Code::Splice;
Code::Splice::inject(
code => sub { print "fredn"; },
package => main,
method => foo,
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
postcondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/five/;
},
);
sub foo {
print "onen";
print "twon";
print "threen";
print "fourn";
print "fiven";
}
This module removes the contents of a subroutine (usually an anonymous subroutine created just for the purpose) and splices in into the program elsewhere.
Why, you ask?
Write stronger unit tests than the granularity of the API would otherwise allow
Write unit tests for nasty, interdependant speghetti code (my motivation -- hey, you gotta have tests before you can start refactoring, and if you cant write tests for the code, youre screwed)
Fix stupid bugs and remove stupid restrictions in other peoples code in a way thats more resiliant across upgrades than editing files you dont own
Be what "aspects" should be
Screw with your cow-orkers by introducing monster heisenbugs
Play with self-modifying code
Write self-replicating code (but be nice, were all friends here, right?)
The specifics:
The body of the code { } block are extracted from the subroutine and inserted in a place in the code specified by the call to the splice() function. Where the new code is spliced in, the old code is spliced out. The package and method arguments are required and tell the thing how to find the code to be modified. The code argument is required as it specifies the code to be spliced in. That same code block should not be used for anything else under penalty of coredump.
The rest of the argumets specify where the code is to be inserted. Any number of precondition and postcondition arguments provide callbacks to help locate the exact area to splice the code in at. Before the code can e spliced in, all of the precondition blocks must have returned true, and none of the postcondition blocks may have yet returned true. If a postcondition returns true before all of the precondition blocks have, an error is raised. Both blocks get called numerous times per line and get passed a reference to the B OP object currently under consideration and the text of the current line:
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
... or...
precondition => sub { my $op = shift; $op->name eq padsv and $op->sv->sv =~ m/fred/; },
Its possible to insert code in the middle of an expression when testing ops, but when testing the text of the line of code, the spliced in code will always replace the whole line.
Ill probably drop sending in the opcode in a future version, at least for the precondition/postcondition blocks, or maybe Ill swap them to the 2nd arg so theyre more optional.
Do not attempt to match text in comments as it wont be there. The code in $line is re-generated from the bytecode using B::Deparse and will vary from the original source code in a few ways, including changes to formatting, changes to some idioms and details of the expressions, and formatting of the code with regards to whitespace.
The splicing code will die if it fails for any reason. This will likely change in possible future versions.
There are also label and line arguments that create preconditions for you, for simple cases. Of course, you shouldnt use line for anything other than simple experimentation.
References to lexical variables in the code to be injected are replaced with references to the lexical variables of the same name in the location the code is inserted into. If a variable of the same name doesnt exist there, its an error. ... but it probably shouldnt be an error, at least in the cases where the code being spliced in declares that lexical with my, or when the variable was initiailized entirely outside of the sub block being spliced in and was merely closed over by it.
See the comments in the source code (at the top, in a nice block) for my todo/desired features. Let me know if there are any features in there or yet unsuggested that you want. I wont promise them, but I would like to hear about them.
<<lessSYNOPSIS
use Code::Splice;
Code::Splice::inject(
code => sub { print "fredn"; },
package => main,
method => foo,
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
postcondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/five/;
},
);
sub foo {
print "onen";
print "twon";
print "threen";
print "fourn";
print "fiven";
}
This module removes the contents of a subroutine (usually an anonymous subroutine created just for the purpose) and splices in into the program elsewhere.
Why, you ask?
Write stronger unit tests than the granularity of the API would otherwise allow
Write unit tests for nasty, interdependant speghetti code (my motivation -- hey, you gotta have tests before you can start refactoring, and if you cant write tests for the code, youre screwed)
Fix stupid bugs and remove stupid restrictions in other peoples code in a way thats more resiliant across upgrades than editing files you dont own
Be what "aspects" should be
Screw with your cow-orkers by introducing monster heisenbugs
Play with self-modifying code
Write self-replicating code (but be nice, were all friends here, right?)
The specifics:
The body of the code { } block are extracted from the subroutine and inserted in a place in the code specified by the call to the splice() function. Where the new code is spliced in, the old code is spliced out. The package and method arguments are required and tell the thing how to find the code to be modified. The code argument is required as it specifies the code to be spliced in. That same code block should not be used for anything else under penalty of coredump.
The rest of the argumets specify where the code is to be inserted. Any number of precondition and postcondition arguments provide callbacks to help locate the exact area to splice the code in at. Before the code can e spliced in, all of the precondition blocks must have returned true, and none of the postcondition blocks may have yet returned true. If a postcondition returns true before all of the precondition blocks have, an error is raised. Both blocks get called numerous times per line and get passed a reference to the B OP object currently under consideration and the text of the current line:
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
... or...
precondition => sub { my $op = shift; $op->name eq padsv and $op->sv->sv =~ m/fred/; },
Its possible to insert code in the middle of an expression when testing ops, but when testing the text of the line of code, the spliced in code will always replace the whole line.
Ill probably drop sending in the opcode in a future version, at least for the precondition/postcondition blocks, or maybe Ill swap them to the 2nd arg so theyre more optional.
Do not attempt to match text in comments as it wont be there. The code in $line is re-generated from the bytecode using B::Deparse and will vary from the original source code in a few ways, including changes to formatting, changes to some idioms and details of the expressions, and formatting of the code with regards to whitespace.
The splicing code will die if it fails for any reason. This will likely change in possible future versions.
There are also label and line arguments that create preconditions for you, for simple cases. Of course, you shouldnt use line for anything other than simple experimentation.
References to lexical variables in the code to be injected are replaced with references to the lexical variables of the same name in the location the code is inserted into. If a variable of the same name doesnt exist there, its an error. ... but it probably shouldnt be an error, at least in the cases where the code being spliced in declares that lexical with my, or when the variable was initiailized entirely outside of the sub block being spliced in and was merely closed over by it.
See the comments in the source code (at the top, in a nice block) for my todo/desired features. Let me know if there are any features in there or yet unsuggested that you want. I wont promise them, but I would like to hear about them.
Download (0.010MB)
Added: 2007-08-14 License: Perl Artistic License Price:
806 downloads
Block Attack - Raise of the Blocks 1.3.0
Block Attack - Raise of the Blocks is another block fall game based on Tetris Attack. more>>
Block Attack - Raise of the Blocks is another block fall game based on Tetris Attack.
Block Attack - Raise of the Blocks is a block fall game. Like Tetris Attack and Crack Attack, block are raising from the floor and the player must clear them before they touch the roof.
Blocks are cleared by making a line of three blocks in the same color horizontally or vertically, and blocks can only be changed horizontally.
The goal is to either get as much points as possible, get as much point in two minutes, clear all blocks in limited moves and clear a number of lines.
Two player slit screen is available. Two players can compete in Time Trial (who gets most points in two minutes) or Vs. mode where clearing more than 3 blocks trows blocks at the opponent.
<<lessBlock Attack - Raise of the Blocks is a block fall game. Like Tetris Attack and Crack Attack, block are raising from the floor and the player must clear them before they touch the roof.
Blocks are cleared by making a line of three blocks in the same color horizontally or vertically, and blocks can only be changed horizontally.
The goal is to either get as much points as possible, get as much point in two minutes, clear all blocks in limited moves and clear a number of lines.
Two player slit screen is available. Two players can compete in Time Trial (who gets most points in two minutes) or Vs. mode where clearing more than 3 blocks trows blocks at the opponent.
Download (4.8MB)
Added: 2006-08-29 License: GPL (GNU General Public License) Price:
1151 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 code blocks 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