myspace falling object codes
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 7251
MySpace Blog Editor 0.3
MySpace Blog Editor is an extension which allows you to post directly from within Firefox to your MySpace blog. more>>
MySpace Blog Editor is an extension which allows you to post directly from within Firefox to your MySpace blog.
The MySpace Blog Editor allows you to post directly from within Firefox to your MySpace blog aswell as save notes, drag and drop formatted text from webpages, handle images and much more.
<<lessThe MySpace Blog Editor allows you to post directly from within Firefox to your MySpace blog aswell as save notes, drag and drop formatted text from webpages, handle images and much more.
Download (0.030MB)
Added: 2007-04-10 License: MPL (Mozilla Public License) Price:
975 downloads
MySpace Feed 1.01
MySpace Feed tool lets you important headlines from your blog, LiveJournal, a news feed, or other source into your MySpace. more>>
MySpace Feed tool lets you important headlines from your blog, LiveJournal, a news feed, or other source into your MySpace (or Friendster) page.
MySpace Feed converts the headline text into an image. We have a script that updates the images once a day.
<<lessMySpace Feed converts the headline text into an image. We have a script that updates the images once a day.
Download (0.072MB)
Added: 2006-09-07 License: GPL (GNU General Public License) Price:
1146 downloads
Falling 1.0 RC1
Falling is a fast-paced survival game involving a ball falling through wooden planks. more>>
Falling is a fast-paced survival game involving a ball falling through wooden planks.
Falling is a survival game where the user controls a small steel ball and tries to roll it through holes in floors which are constantly moving up.
Avoid being crushed between the top of the window and a floor, avoid mechanical sticks of TNT that explode on contact, and avoid magnetic balloons which pull you to the top of the screen.
Collect jewels for extra points. Try to survive as long as possible!
<<lessFalling is a survival game where the user controls a small steel ball and tries to roll it through holes in floors which are constantly moving up.
Avoid being crushed between the top of the window and a floor, avoid mechanical sticks of TNT that explode on contact, and avoid magnetic balloons which pull you to the top of the screen.
Collect jewels for extra points. Try to survive as long as possible!
Download (1.0MB)
Added: 2006-11-06 License: GPL (GNU General Public License) Price:
1083 downloads
Yet Another Object Request Broker 0.2
Yet Another Object Request Broker is an implementation of the CORBA ORB. more>>
Yet Another Object Request Broker is an implementation of the CORBA ORB.
YaOrb advanced installation
YaOrb uses the GNU tools (Autoconf, Automake, ...).
See the GNU documentation for complete instructions, in file $/INSTALL.GNU.
Optional features
The configure script also supports package specific options :
-enable-yoconf=DEV : build in "Development" configuration
-enable-yoconf=TCOV : build in "Coverage" configuration
-enable-yoconf=GPROF : build in "Profiling" configuration
These options are private for the maintainer of this package, and will only work in a specific environment (since assumptions are made about which compiler is used, ...). You may try them, but dont need them to make a build.
The "DEV" (Development) configuration is used to perform a build with all the possible warning options turned on, and warnings are considered errors (using gcc with -Wall -Werror). This configuration is used to enforce that the code is as clean as possible.
The "TCOV" (Coverage) configuration is used to collect code coverage statistics, and also depend on gcc. After running tests, use make profiling to collect code coverage, and read the resulting files :
- $/.SCORE
- $/.MISSING
The "GPROF" (Profiling) configuration is used to collect performance data, and relies on specific gcc options and gprof. After running tests, use make profiling to collect statistics generated.
Enhancements:
- First public release of Yet Another Object Request Broker. Pre alpha, release 0.2
<<lessYaOrb advanced installation
YaOrb uses the GNU tools (Autoconf, Automake, ...).
See the GNU documentation for complete instructions, in file $/INSTALL.GNU.
Optional features
The configure script also supports package specific options :
-enable-yoconf=DEV : build in "Development" configuration
-enable-yoconf=TCOV : build in "Coverage" configuration
-enable-yoconf=GPROF : build in "Profiling" configuration
These options are private for the maintainer of this package, and will only work in a specific environment (since assumptions are made about which compiler is used, ...). You may try them, but dont need them to make a build.
The "DEV" (Development) configuration is used to perform a build with all the possible warning options turned on, and warnings are considered errors (using gcc with -Wall -Werror). This configuration is used to enforce that the code is as clean as possible.
The "TCOV" (Coverage) configuration is used to collect code coverage statistics, and also depend on gcc. After running tests, use make profiling to collect code coverage, and read the resulting files :
- $/.SCORE
- $/.MISSING
The "GPROF" (Profiling) configuration is used to collect performance data, and relies on specific gcc options and gprof. After running tests, use make profiling to collect statistics generated.
Enhancements:
- First public release of Yet Another Object Request Broker. Pre alpha, release 0.2
Download (0.94MB)
Added: 2006-03-01 License: GPL (GNU General Public License) Price:
1332 downloads
Perlbug::Object 2.93
Perlbug::Object is a object handler for Perlbug database. more>>
Perlbug::Object is a object handler for Perlbug database.
Handles Perlbug database objects, typically bug, group, message, patch, note, test, user, and severity, status etc....
Methods included to recognise objects by their id or by their also unique name.
SYNOPSIS
my $o_obj = Perlbug::Object->new(%init); # see L
$o_obj = $o_obj->read($oid); # data
my $name = $o_obj->data(name); # Bug
# ALL bugids (optionally) constrained by sql where clause
my @ids = $o_obj->ids($where); # where
# Relation ids
my @patchids = $o_obj->rel_ids(patch); # relids
print = $o_obj->format(h);
<<lessHandles Perlbug database objects, typically bug, group, message, patch, note, test, user, and severity, status etc....
Methods included to recognise objects by their id or by their also unique name.
SYNOPSIS
my $o_obj = Perlbug::Object->new(%init); # see L
$o_obj = $o_obj->read($oid); # data
my $name = $o_obj->data(name); # Bug
# ALL bugids (optionally) constrained by sql where clause
my @ids = $o_obj->ids($where); # where
# Relation ids
my @patchids = $o_obj->rel_ids(patch); # relids
print = $o_obj->format(h);
Download (0.49MB)
Added: 2007-07-08 License: Perl Artistic License Price:
841 downloads
Falling Up 004
Falling Up its another tetris clone. more>>
Falling Up its another tetris clone. No, Im not trying to make any money off of it or claim it as particularly unique. It is fun. Try it. Its evil. Im told that frequently.
People have even praised it. I wrote it as a precursor to other games, a way to learn new technologies (GLUT, OpenGL, OpenAL, NSIS, ...), and to brush up on old ones (c, for that matter).
The source code is essentially free to do with as you please, if you like. If you "steal" most of it, Id prefer you give credit back to here, but really... whatever. I learned from lots of places and anything I can do to pay that back is cool.
The game is... tetris. You have the same old blocks, and they fall down. You use left and right to move blocks left and right, up to rotate, down to move down a line, and spacebar to drop.
Theres a next item (optional), sound (optional), and... stuff like that. Please, just download it and play it already! Geeze! Youd think I was just rambling...
Enhancements:
- The score file was adding 1 to the "level" the score was attained at every time a new high score was made, give or take; that is fixed.
- I added a background image (doesnt work with trails, may slow down on slower systems), and made F4 quit out of playing the game.
<<lessPeople have even praised it. I wrote it as a precursor to other games, a way to learn new technologies (GLUT, OpenGL, OpenAL, NSIS, ...), and to brush up on old ones (c, for that matter).
The source code is essentially free to do with as you please, if you like. If you "steal" most of it, Id prefer you give credit back to here, but really... whatever. I learned from lots of places and anything I can do to pay that back is cool.
The game is... tetris. You have the same old blocks, and they fall down. You use left and right to move blocks left and right, up to rotate, down to move down a line, and spacebar to drop.
Theres a next item (optional), sound (optional), and... stuff like that. Please, just download it and play it already! Geeze! Youd think I was just rambling...
Enhancements:
- The score file was adding 1 to the "level" the score was attained at every time a new high score was made, give or take; that is fixed.
- I added a background image (doesnt work with trails, may slow down on slower systems), and made F4 quit out of playing the game.
Download (0.45MB)
Added: 2005-12-06 License: GPL (GNU General Public License) Price:
1422 downloads
Lazarus Object Builder 0.10
Object Builder is a tool I wrote to make building and maintaining CeaMuS easier. more>>
Object Builder is a tool I wrote to make building and maintaining CeaMuS easier. I stole the idea (but not the code, which is in another language) wholesale from a tool that I wrote to manage the task of making data objects for an enterprise management system.
Object Builder project is a generic, language-neutral implementation of the Active Record software design pattern. Given a database, Object Builder tools will extract the schema to a generic form, then transform that schema into application code to manipulate database records.
If the phrase Active Record sounds familiar, but you dont seem to recall it from any of your computer science courses and it doesnt show up anywhere in Erich Gamma et. al.s Design Patterns, its because youve heard it from the Ruby On Rails crowd. According to its proponents Active Record is what makes Ruby on Rails the best thing since buttered toast (to be fair, there are other advantages; a lot of people seem to like to work in Ruby).
Funny thing is, Ive been using this design pattern for several years now, long before I ever heard of Active Record or Ruby on Rails. Not that it makes me special. Thats what design patterns are: a lot of people come up with a similar way of solving the same problem, so somebody sticks a label on it and weve got a new design pattern. The Ruby On Rails people just had the good sense to get their name behind it.
Object Builder is a great way to make sure that your application code is always in synch with your database schema. Because its made of command line tools, its easy to incorporate it into your build process.
If your application only has a couple of tables, Object Builder might be overkill. If you have half a dozen tables or more though, and you make changes from time to time, Object Builder can make your life a lot easier by incorporating those changes into code automatically.
<<lessObject Builder project is a generic, language-neutral implementation of the Active Record software design pattern. Given a database, Object Builder tools will extract the schema to a generic form, then transform that schema into application code to manipulate database records.
If the phrase Active Record sounds familiar, but you dont seem to recall it from any of your computer science courses and it doesnt show up anywhere in Erich Gamma et. al.s Design Patterns, its because youve heard it from the Ruby On Rails crowd. According to its proponents Active Record is what makes Ruby on Rails the best thing since buttered toast (to be fair, there are other advantages; a lot of people seem to like to work in Ruby).
Funny thing is, Ive been using this design pattern for several years now, long before I ever heard of Active Record or Ruby on Rails. Not that it makes me special. Thats what design patterns are: a lot of people come up with a similar way of solving the same problem, so somebody sticks a label on it and weve got a new design pattern. The Ruby On Rails people just had the good sense to get their name behind it.
Object Builder is a great way to make sure that your application code is always in synch with your database schema. Because its made of command line tools, its easy to incorporate it into your build process.
If your application only has a couple of tables, Object Builder might be overkill. If you have half a dozen tables or more though, and you make changes from time to time, Object Builder can make your life a lot easier by incorporating those changes into code automatically.
Download (0.029MB)
Added: 2006-01-17 License: Freeware Price:
776 downloads
Rose::Object 0.84
Rose::Object is a simple object base class. more>>
Rose::Object is a simple object base class.
SYNOPSIS
package MyObject;
use Rose::Object;
our @ISA = qw(Rose::Object);
sub foo { ... }
sub bar { ... }
...
my $o = MyObject->new(foo => abc, bar => 5);
...
Rose::Object is a generic object base class. It provides very little functionality, but a healthy dose of convention.
METHODS
new PARAMS
Constructs a new, empty, hash-based object based on PARAMS, where PARAMS are name/value pairs, and then calls init (see below), passing PARAMS to it unmodified.
init PARAMS
Given a list of name/value pairs in PARAMS, calls the object method of each name, passing the corresponding value as an argument. The methods are called in the order that they appear in PARAMS. For example:
$o->init(foo => 1, bar => 2);
is equivalent to the sequence:
$o->foo(1);
$o->bar(2);
<<lessSYNOPSIS
package MyObject;
use Rose::Object;
our @ISA = qw(Rose::Object);
sub foo { ... }
sub bar { ... }
...
my $o = MyObject->new(foo => abc, bar => 5);
...
Rose::Object is a generic object base class. It provides very little functionality, but a healthy dose of convention.
METHODS
new PARAMS
Constructs a new, empty, hash-based object based on PARAMS, where PARAMS are name/value pairs, and then calls init (see below), passing PARAMS to it unmodified.
init PARAMS
Given a list of name/value pairs in PARAMS, calls the object method of each name, passing the corresponding value as an argument. The methods are called in the order that they appear in PARAMS. For example:
$o->init(foo => 1, bar => 2);
is equivalent to the sequence:
$o->foo(1);
$o->bar(2);
Download (0.028MB)
Added: 2007-05-21 License: Perl Artistic License Price:
886 downloads
Virtual Object System 0.23.0
Virtual Object System projects goal is to develop a open platform for multi-user 3D virtual reality games. more>>
The Interreality project is a collection of Open Source, Free Software projects based on the Virtual Object System (VOS) platform. Virtual Object System projects goal is to develop a open platform for multi-user 3D virtual reality games, applications, and interactive, collaborative 3D virtual spaces. VOS is a powerful and generic network object framework designed to support a variety of high-performance applications. It is the basis for TerAngreal, a general-purpose browser application for entering and participating in 3D worlds.
<<less Download (2.7MB)
Added: 2006-04-17 License: LGPL (GNU Lesser General Public License) Price:
1287 downloads
Php Object Generator 3.0
PHP Object Generator (POG) is a PHP code generator which generates clean and tested object oriented code for your PHP4/PHP5. more>>
Php Object Generator on short POG is an open source PHP code generator which automatically generates clean & tested Object Oriented code for your PHP4/PHP5 application.
Over the years, we realized that a large portion of a PHP programmers time is wasted on repetitive coding of the Database Access Layer of an application simply because different applications require different objects.
By generating PHP objects with integrated CRUD methods, POG gives you a head start in any project and saves you from writing and testing SQL queries. The time you save can be spent on more interesting areas of your project. But dont take our word for it, give it a try!
Main features:
- Generates clean & tested code
- Generates CRUD methods
- Compatible with PHP4 & PHP5
- Compatible with PDO
- Free for personal use
- Free for commercial use
- Open Source
Enhancements:
- POG now fetches result set arrays where possible (which provides a big performance boost).
- Data encoding is handled within the database.
- A new plugin interface is used.
- A data encoding sanity check was added to setup.
- Siblings can be deleted without deleting children.
- Getlist() accepts column names as filters.
- Getlist(), GetChild(), and GetSibling() return all results if no arguments are passed.
- A database wrapper class for PDO was added.
- The PDO performance was improved.
- The plugin API, POG base API, and database API were made uniform to prevent plugin versioning.
<<lessOver the years, we realized that a large portion of a PHP programmers time is wasted on repetitive coding of the Database Access Layer of an application simply because different applications require different objects.
By generating PHP objects with integrated CRUD methods, POG gives you a head start in any project and saves you from writing and testing SQL queries. The time you save can be spent on more interesting areas of your project. But dont take our word for it, give it a try!
Main features:
- Generates clean & tested code
- Generates CRUD methods
- Compatible with PHP4 & PHP5
- Compatible with PDO
- Free for personal use
- Free for commercial use
- Open Source
Enhancements:
- POG now fetches result set arrays where possible (which provides a big performance boost).
- Data encoding is handled within the database.
- A new plugin interface is used.
- A data encoding sanity check was added to setup.
- Siblings can be deleted without deleting children.
- Getlist() accepts column names as filters.
- Getlist(), GetChild(), and GetSibling() return all results if no arguments are passed.
- A database wrapper class for PDO was added.
- The PDO performance was improved.
- The plugin API, POG base API, and database API were made uniform to prevent plugin versioning.
Download (1.0MB)
Added: 2007-07-26 License: BSD License Price:
516 downloads
The Cookies Are Falling! 1.03
The Cookies Are Falling! 1.03 brings you a new tetris clone. The game is written in Python and PyGame. more>> The Cookies Are Falling! 1.03 brings you a new tetris clone. The game is written in Python and PyGame.
Enhancements
- Some bugs are fixed
- A menu is added
Requirements:
- Python
- Pygame
Added: 2009-06-28 License: Freeware Price: FREE
1 downloads
Other version of The Cookies Are Falling!
Price: FREE
License:Freeware
License:Freeware
Basset::Object 1.04
Basset::Object is a Perl module used to create objects. more>>
Basset::Object is a Perl module used to create objects.
This is my ultimate object creation toolset to date. It has roots in Mail::Bulkmail, Text::Flowchart, and the unreleased abstract object constructors that Ive tooled around with in the past.
If you want an object to be compatible with anything else Ive written, then subclass it off of here.
Of course, you dont have to use this to create subclasses, but youll run the risk of making something with an inconsistent interface vs. the rest of the system. Thatll confuse people and make them unhappy. So I recommend subclassing off of here to be consistent. Of course, you may not like these objects, but they do work well and are consistent. Consistency is very important in interface design, IMHO.
<<lessThis is my ultimate object creation toolset to date. It has roots in Mail::Bulkmail, Text::Flowchart, and the unreleased abstract object constructors that Ive tooled around with in the past.
If you want an object to be compatible with anything else Ive written, then subclass it off of here.
Of course, you dont have to use this to create subclasses, but youll run the risk of making something with an inconsistent interface vs. the rest of the system. Thatll confuse people and make them unhappy. So I recommend subclassing off of here to be consistent. Of course, you may not like these objects, but they do work well and are consistent. Consistency is very important in interface design, IMHO.
Download (0.14MB)
Added: 2007-06-20 License: GPL (GNU General Public License) Price:
856 downloads
XLObject 2.0.2a
XLObject is a clone of basic services offered by the Qt object model, redesigned around modern features of the C++ language. more>>
XLObject is a clone of basic services offered by the Qt object model, redesigned around modern features of the C++ language. Signals and slots are used for communication between objects. There are instances when we want some objects to know the changes of a particular object without having to write code for each interested object.
This design is common in GUI programming, where another widget needs to be notified implicitly of the change of one widget. Since the widget needs to be usable everywhere, the design should be as generic as possible. The event-generating widget should not need to know how or which widgets are informed of the event.
In older C-based toolkits, this functionality is achieved by using "callbacks" - registering pointers to functions to a processing function. The problem with callbacks is that they are not type safe, prone to crashes, and are strongly tied to the processing function.
Signal and Slots is an implementation of the Observer design pattern made popular by the Qt toolkit. It provides a much safer alternative to callbacks in addition to being built on the principles of object-oriented programming. Qt implemented this feature by dynamically adding extra information to classes during compile time with the help of an external meta object compiler.
XL Signal and Slots achieves the same functionality without the meta compiler by taking advantage of C++ templates. This direct approach is very fast compared to Qts string-based approach with the added benefit of:
Allowing all member functions to be treated as slots.
No longer needing specification of non-standard macros during class definitions.
At the same time, the library tries to follow the design of Qt as closely as possible where it:
Automatically severs the connection if either receiver or sender is destroyed so your program does not crash during the process of emitting a signal.
Lets receiver objects know which sender Object emitted the signal
Lets the compiler catch type mismatches.
Allows a slot to have a shorter signature than the signal without having to rebind types.
Optionally allows objects to be organized as object trees and achieving a concept that is more or less similar to garbage-collection.
The library aims to achieve the core signal and slots functionality very well and at the same time be as less complicated as possible. In around a thousand lines of code, the library is capable of being embedded into the application in a very tiny amount of space.
Enhancements:
- This release fixes a severe memory leak in the thread class.
- The documentation was improved in some of the utility classes.
- Options are provided to specify an optional address in server sockets.
- Some additional fixes were made in the core socket classes.
<<lessThis design is common in GUI programming, where another widget needs to be notified implicitly of the change of one widget. Since the widget needs to be usable everywhere, the design should be as generic as possible. The event-generating widget should not need to know how or which widgets are informed of the event.
In older C-based toolkits, this functionality is achieved by using "callbacks" - registering pointers to functions to a processing function. The problem with callbacks is that they are not type safe, prone to crashes, and are strongly tied to the processing function.
Signal and Slots is an implementation of the Observer design pattern made popular by the Qt toolkit. It provides a much safer alternative to callbacks in addition to being built on the principles of object-oriented programming. Qt implemented this feature by dynamically adding extra information to classes during compile time with the help of an external meta object compiler.
XL Signal and Slots achieves the same functionality without the meta compiler by taking advantage of C++ templates. This direct approach is very fast compared to Qts string-based approach with the added benefit of:
Allowing all member functions to be treated as slots.
No longer needing specification of non-standard macros during class definitions.
At the same time, the library tries to follow the design of Qt as closely as possible where it:
Automatically severs the connection if either receiver or sender is destroyed so your program does not crash during the process of emitting a signal.
Lets receiver objects know which sender Object emitted the signal
Lets the compiler catch type mismatches.
Allows a slot to have a shorter signature than the signal without having to rebind types.
Optionally allows objects to be organized as object trees and achieving a concept that is more or less similar to garbage-collection.
The library aims to achieve the core signal and slots functionality very well and at the same time be as less complicated as possible. In around a thousand lines of code, the library is capable of being embedded into the application in a very tiny amount of space.
Enhancements:
- This release fixes a severe memory leak in the thread class.
- The documentation was improved in some of the utility classes.
- Options are provided to specify an optional address in server sockets.
- Some additional fixes were made in the core socket classes.
Download (0.045MB)
Added: 2006-09-18 License: GPL (GNU General Public License) Price:
1132 downloads
Net::DBus::Tutorial::ExportingObjects 0.33.4
Net::DBus::Tutorial::ExportingObjects is a Perl module that contains tutorials on providing a DBus service. more>>
Net::DBus::Tutorial::ExportingObjects is a Perl module that contains tutorials on providing a DBus service.
This document provides a tutorial on providing a DBus service using the Perl Net::DBus application bindings. This examples in this document will be based on the code from the Music::Player distribution, which is a simple DBus service providing a music track player.
CREATING AN OBJECT
The first step in creating an object is to create a new package which inherits from Net::DBus::Object. The Music::Player::Manager object provides an API for managing the collection of music player backends for different track types. To start with, lets create the skeleton of the package & its constructor. The constructor of the super type, Net::DBus::Object expects to be given to parameters, a handle to the Net::DBus::Service owning the object, and a path under which the object shall be exported. Since the manager class is intended to be a singleton object, we can hard code the path to it within the constructor:
package Music::Player::Manager;
use base qw(Net::DBus);
sub new {
my $class = shift;
my $service = shift;
my $self = $class->SUPER::new($service, "/music/player/manager");
bless $self, $class;
return $self;
}
1;
Now, as mentioned, the manager with handle a number of different player backends. So we need to provide methods for registering new backends, and querying for backends capable of playing a particular file type. So modifying the above code we add a hash table in the constructor, to store the backends:
sub new {
my $class = shift;
my $service = shift;
my $self = $class->SUPER::new($service, "/music/player/manager");
$self->{backends} = {};
bless $self, $class;
return $self;
}
And now a method to register a new backend. This takes a Perl module name and uses it to instantiate a backend. Since the backends are also going to be DBus objects, we need to pass in a reference to the service we are attached to, along with a path under which to register the backend.
We use the get_service method to retreieve a reference to the service the manager is attached to, and attach the player backend to this same service: When a method on DBus object is invoked, the first parameter is the object reference ($self), and the remainder are the parameters provided to the method call. Thus writing a method implementation on a DBUs is really no different to normal object oriented Perl (cf perltoot):
sub register_backend {
my $self = shift;
my $name = shift;
my $module = shift;
eval "use $module";
if ($@) {
die "cannot load backend $module: $@" ;
}
$self->{backends} = $module->new($self->get_service,
"/music/player/backend/$name");
}
Looking at this one might wonder what happens if the die method is triggered. In such a scenario, rather than terminating the service process, the error will be caught and propagated back to the remote caller to deal with.
The player backends provide a method get_track_types which returns an array reference of the music track types they support. We can use this method to provide an API to allow easy retrieval of a backend for a particular track type. This method will return a path with which the backend object can be accessed
sub find_backend {
my $self = shift;
my $extension = shift;
foreach my $name (keys %{$self->{backends}}) {
my $backend = $self->{backends}->{$name};
foreach my $type (@{$backend->get_track_types}) {
if ($type eq $extension) {
return $backend->get_object_path;
}
}
}
die "no backend for type $extension";
}
Lets take a quick moment to consider how this method would be used to play a music track. If youve not already done so, refresh your memory from Net::DBus::Tutorial::UsingObjects. Now, we have an MP3 file which we wish to play, so we search for the path to a backend, then retrieve the object for it, and play the track:
...get the music player service...
# Ask for a path to a player for mp3 files
my $path = $service->find_backend("mp3");
# $path now contains /music/player/backend/mpg123
# and we can get the backend object
my $backend = $service->get_object($path);
# and finally play the track
$backend->play("/vol/music/beck/guero/09-scarecrow.mp3");
<<lessThis document provides a tutorial on providing a DBus service using the Perl Net::DBus application bindings. This examples in this document will be based on the code from the Music::Player distribution, which is a simple DBus service providing a music track player.
CREATING AN OBJECT
The first step in creating an object is to create a new package which inherits from Net::DBus::Object. The Music::Player::Manager object provides an API for managing the collection of music player backends for different track types. To start with, lets create the skeleton of the package & its constructor. The constructor of the super type, Net::DBus::Object expects to be given to parameters, a handle to the Net::DBus::Service owning the object, and a path under which the object shall be exported. Since the manager class is intended to be a singleton object, we can hard code the path to it within the constructor:
package Music::Player::Manager;
use base qw(Net::DBus);
sub new {
my $class = shift;
my $service = shift;
my $self = $class->SUPER::new($service, "/music/player/manager");
bless $self, $class;
return $self;
}
1;
Now, as mentioned, the manager with handle a number of different player backends. So we need to provide methods for registering new backends, and querying for backends capable of playing a particular file type. So modifying the above code we add a hash table in the constructor, to store the backends:
sub new {
my $class = shift;
my $service = shift;
my $self = $class->SUPER::new($service, "/music/player/manager");
$self->{backends} = {};
bless $self, $class;
return $self;
}
And now a method to register a new backend. This takes a Perl module name and uses it to instantiate a backend. Since the backends are also going to be DBus objects, we need to pass in a reference to the service we are attached to, along with a path under which to register the backend.
We use the get_service method to retreieve a reference to the service the manager is attached to, and attach the player backend to this same service: When a method on DBus object is invoked, the first parameter is the object reference ($self), and the remainder are the parameters provided to the method call. Thus writing a method implementation on a DBUs is really no different to normal object oriented Perl (cf perltoot):
sub register_backend {
my $self = shift;
my $name = shift;
my $module = shift;
eval "use $module";
if ($@) {
die "cannot load backend $module: $@" ;
}
$self->{backends} = $module->new($self->get_service,
"/music/player/backend/$name");
}
Looking at this one might wonder what happens if the die method is triggered. In such a scenario, rather than terminating the service process, the error will be caught and propagated back to the remote caller to deal with.
The player backends provide a method get_track_types which returns an array reference of the music track types they support. We can use this method to provide an API to allow easy retrieval of a backend for a particular track type. This method will return a path with which the backend object can be accessed
sub find_backend {
my $self = shift;
my $extension = shift;
foreach my $name (keys %{$self->{backends}}) {
my $backend = $self->{backends}->{$name};
foreach my $type (@{$backend->get_track_types}) {
if ($type eq $extension) {
return $backend->get_object_path;
}
}
}
die "no backend for type $extension";
}
Lets take a quick moment to consider how this method would be used to play a music track. If youve not already done so, refresh your memory from Net::DBus::Tutorial::UsingObjects. Now, we have an MP3 file which we wish to play, so we search for the path to a backend, then retrieve the object for it, and play the track:
...get the music player service...
# Ask for a path to a player for mp3 files
my $path = $service->find_backend("mp3");
# $path now contains /music/player/backend/mpg123
# and we can get the backend object
my $backend = $service->get_object($path);
# and finally play the track
$backend->play("/vol/music/beck/guero/09-scarecrow.mp3");
Download (0.092MB)
Added: 2006-11-13 License: Perl Artistic License Price:
1075 downloads
Locale::Object::Currency::Converter 0.74
Locale::Object::Currency::Converter is a Perl module that can convert between currencies. more>>
Locale::Object::Currency::Converter is a Perl module that can convert between currencies.
Locale::Object::Currency::Converter allows you to convert between values of currencies represented by Locale::Object::Currency objects.
SYNOPSIS
use Locale::Object::Currency;
use Locale::Object::Currency::Converter;
my $usd = Locale::Object::Currency->new( code => USD );
my $gbp = Locale::Object::Currency->new( code => GBP );
my $eur = Locale::Object::Currency->new( code => EUR );
my $jpy = Locale::Object::Currency->new( code => JPY );
my $converter = Locale::Object::Currency::Converter->new(
from => $usd,
to => $gbp,
service => XE
);
my $result = $converter->convert(5);
my $rate = $converter->rate;
my $timestamp = $converter->timestamp;
print $converter->use_xe;
print $converter->use_yahoo;
$converter->from($eur);
$converter->to($jpy);
$converter->service(Yahoo);
$converter->refresh;
<<lessLocale::Object::Currency::Converter allows you to convert between values of currencies represented by Locale::Object::Currency objects.
SYNOPSIS
use Locale::Object::Currency;
use Locale::Object::Currency::Converter;
my $usd = Locale::Object::Currency->new( code => USD );
my $gbp = Locale::Object::Currency->new( code => GBP );
my $eur = Locale::Object::Currency->new( code => EUR );
my $jpy = Locale::Object::Currency->new( code => JPY );
my $converter = Locale::Object::Currency::Converter->new(
from => $usd,
to => $gbp,
service => XE
);
my $result = $converter->convert(5);
my $rate = $converter->rate;
my $timestamp = $converter->timestamp;
print $converter->use_xe;
print $converter->use_yahoo;
$converter->from($eur);
$converter->to($jpy);
$converter->service(Yahoo);
$converter->refresh;
Download (0.045MB)
Added: 2006-08-07 License: Perl Artistic License Price:
1174 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 myspace falling object codes 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