module

How do I register a service in OSGi (Apache Felix)?

Hello, everyone! I have successfully managed to start Apache Felix from code and register an own Bundle. Following relation between OSGI-projects is needed: [OsgiInterface] -- provides interfaces. [OsgiModuleA] -- (bundle) provides an implementation of those interfaces. knows [OsgiInterface] [OsgiUsage] -- makes use of one or more b...

Modules and Delphi

Hi dudes, I'm using dynamic link to load (BPL) modules into my app, the loading works fine with simple forms built into those moudles, but when adding more and more (third-) components and code to one form I get this error message "Invalid class typecast" for tha first time, 'cause for the second time the loading works ok, so I caught t...

(In Ruby) allowing mixed-in class methods access to class constants

Hi. I have a class with a constant defined for it. I then have a class method defined that accesses that class constant. This works fine. An example: #! /usr/bin/env ruby class NonInstantiableClass Const = "hello, world!" class << self def shout_my_constant puts Const.upcase end end ...

How to access a builtin module in Python when there is a local module with the same name?

How can a built-in module (say math) be accessed when a file prog.py is placed in the same directory as a local module with the same name (math.py)? I'm asking this question because I would like to create a package uncertainties that one can use as import uncertainties from uncertainties.math import * Thus, there is a local math modu...

slideshow module for drupal

hi! i'm in need of a drupal module which gives a slideshow from the images uploaded by the user..i saw the slideshow module but can't understand where to apply the settings.. thanks for ur help.. slideshow format: current image displayed here previous_button image image image image image image image image ne...

JAR for three classes?

I reuse a handful of classes for multiple projects, like Postal Address, State, Zip Code and Phone Number. Associated to them maybe parse/format classes (like Phone Number Formatting). Is it okay to have a JAR with only a couple of classes? An alternative would be to have one "Miscellaneous" JAR with all the classes however it feels...

Expressing an SConscript's Own Dependencies

I have an SCons project set up as follows: Project/ SConstruct # "SConscript('stuff/SConscript', variant_dir = 'build') stuff/ SConscript # "import configuration" configuration/ __init__.py Thing.py When building, the SConscript is copied to the build directory, but the "configuration" ...

How can I dynamically include Perl modules without using eval?

Hi, I need to dynamically include a Perl module, but if possible would like to stay away from eval due to work coding standards. This works: $module = "My::module"; eval("use $module;"); But I need a way to do it without eval if possible. All google searches lead to the eval method, but none in any other way. Is it possible to do it...

Python import mechanics

I have two related Python 'import' questions. They are easily testable, but I want answers that are language-defined and not implementation-specific, and I'm also interested in style/convention, so I'm asking here instead. 1) If module A imports module B, and module B imports module C, can code in module A reference module C without an...

How can I get the version and location of an installed Perl module?

Is there a smart way to detect whether a certain Perl module has been installed in your system? My old sutpid way is to write a Perl script in which the only thing I do is just to use the module. If nothing croaks when I run the detect script, then I know the module has been installed, although I still don't know which version and wher...

Why can't XML::Schematron::XPath find XML::XPath?

After installing the XML::Schematron::XPath module from CPAN I am getting the "Can't locate XML/XPath.pm in @INC) message. ]$sudo ls /usr/lib/perl5/site_perl/5.10.0/XML/ ESISParser.pm Filter Handler Parser PatAct Perl2SAX.pm SAX2Perl.pm Schematron Schematron.pm Validator There is the Schematron directory, and inside of it is X...

Drupal not printing view inside panel

I inherited a D5 site with Printer, e-mail and PDF versions module enabled that is used for printing. I have a Country page which contains a view with most recent country news inserted in a panel for placement purposes. When I print the page, the view is absent from both screen and source code. One thing I noticed is that each content...

How does/should global data in modules across packages be managed in Python/other languages?

I am trying to design the package and module system for a programming language (Heron) which can be both compiled and interpreted, and from what I have seen I really like the Python approach. Python has a rich choice of modules, which seems to contribute largely to its success. What I don`t know is what happens in Python if a module is ...

prestashop and OSL 3.0: license for modules?

I'm currently looking at Prestashop, that uses an OSL 3.0 open source license. That license requires you to share the code even with users (so it plugs the famous "asp hole"). My question regards to it's plugin architecture for modules. Would the OSL 3.0 license apply also to modules, or it wouldn't be considered part of the distributio...

call python modules from java classes?

Hi is it possible, by using jython to call jython classes from java code? If yes, how please? ...

Best way to set up a modular program in C#

Me and my friend, are writing an IRC C# bot, and we are looking for a way to include a module system.. so that people can write modules, load them into the bot. Here is the end result im looking for.. Basically, the bot uses Regex to split up all raw data from the server, and then triggers an event with the data. Then, another class tha...

Module communication ….

I’m working on a single modular application which has several levels and on these levels I do have a module which I use as a ‘Main Carrier module *’ for other sub modules. Now one of these Sub modules has a component attached, and I do need to ‘CLICK’ a button in that component which in return activates a certain ‘Click of a Button’ in t...

How to create module-wide variables in Python?

Is there a way to set up a global variable inside of a module? When I tried to do it the most obvious way as appears below, the Python interpreter said the variable __DBNAME__ did not exist. ... __DBNAME__ = None def initDB(name): if not __DBNAME__: __DBNAME__ = name else: raise RuntimeError("Database name has a...

Whats a good ruby idiom for breaking up a large class into modules?

I have a large class with lots of methods and it's starting to get a bit unorganized and hard to navigate. I'd like to break it up into modules, where each module is a collection of class and instance methods. Perhaps something like this: UPDATE: I've now realized that this is a pretty poor example. You probably wouldn't want to move va...

Why do many django contain a '__init__.py'

Many directories in a django project contain a __init__.py and I think it will be used as initialization for something. Where is this __init__.py used? ...