module

Perl, dynamically include package

Let's say I have a perl module file and I want to include and use it dynamically at runtime. Said module includes a class that I need to instantiate without knowing its name until runtime. For example, #inside module.pm package module; sub new { #setup object } #inside main.pl #get module.pm as argument my $module_var = #load refe...

Python Class in module not loading in one computer, but the other.

So I have two files: File 1 has this method in it: import MyGlobals global old_function def init(): import ModuleB global old_function MyGlobals.SomeNumber = 0 old_function = ModuleB.someClass.function ModuleB.someClass.function = someNewFunction File 2 has a class "someClass" and a class "someOtherClass". That be...

Importing a module in python - How to avoid writing the name of the module all the time?

I use the math module a lot lately. I don't want to write math.sqrt(x) and math.sin(x) all the time. I would like to shorten it and write sqrt(x) and sin(x). How? ...

Zend Franework Layout and Modules

I have a some modules and 1 layout. How can i do this thing?: For each module content of the site should be individual. ...

How do you list included Modules in a Ruby Class?

How would you list out the modules that have been included in a specific class in a class hierarchy in Ruby? Something like this: module SomeModule end class ParentModel < Object include SomeModule end class ChildModel < ParentModel end p ChildModel.included_modules #=> [SomeModule] p ChildModel.included_modules(false) #=> [] Li...

Python Module Importing Issues

I run Windows 7, and I can import built-in modules, but when I save my own script and try to import it in IDLE, I get an error saying that the module doesn't exist. I use the Python text editor found by clicking "File" and "New Window" from the Python Shell. I save it as a .py file within a Module folder I created within the Python dire...

PHP Function Organization

I am writing a pretty basic php app and have created a pretty big mess of functions to do various things, e.g. display_user_nav(), display_user_list() etc. I want a way to organize these in a logical way. What I really need is something like a ruby module, but I haven't been able to find a php equivalent. I also feel that from a programm...

F#: What is the difference between module let and type static let?

Given the following: module MyModule = let myObj = new MyObj() type MyType() = static let myObj_ = new MyObj() static member myObj = myObj_ ... are MyModule.myObj and MyType.myObj functionally (no pun intended) equivalent? Whenever I call MyModule.myObj or MyType.myObj, I don't want the code to actually create a new obje...

Can not find InternationalizationShoppingContextServlet.java

Hi, In ATG Mobile-Server module InternationalizationShoppingContextServlet.java class is missing? What is the impace of this class? cannot find symbol [javac] symbol: class InternationalizationShoppingContextServlet Regds, Sudhahar.S ...

How can I modify a CCK fields display via a module?

Hi. I'm working on a drupal module, and one thing that it needs to do is modify the display of cck file fields automatically (using template files is not an option). For example, this array: $node->field_images[0]['view']; That is what I would like to get into. The 'view' part will output an image based on the display settings for ...

How do I create a product attribute out of my custom module in Magento?

How do I create a product attribute out of my custom module in Magento? I'm working on a "record store" in magento and I've created an "artists module" to store artist information. Now I want to have an "Artist" dropdown attribute for the catalog items that is fed from this module. I understand how to create custom attributes in the m...

organising classes and modules in python

I'm getting a bit of a headache trying to figure out how to organise modules and classes together. Coming from C++, I'm used to classes encapsulating all the data and methods required to process that data. In python there are modules however and from code I have looked at, some people have a lot of loose functions stored in modules, wh...

ExpressionEngine 1.6.9: LG Polls module; display question and assign poll id from control panel

Hi friends, I'm a real newbie at EE. Having trouble about LG Polls module I followed the steps from the official module guide. I set up everything as it was told at doc. You can see below my code (taken from doc again). the current code below displays answers, I also can vote, everything is working great. It just doesn't display the qu...

I have a series of python modules I would like to put into a package, how can I do this?

I have a series of python modules I would like to put into a package. I would like to set it up such that anyone interested can just download it and install it (on unix). How can I do this? ...

How to control glassfish module startup order

I have several web modules. There are dependency between them, say during startup, module B will use MBean exposed by module A. How to configure glassfish to enable it start them by specific order? Or is it possible to configure it to load them concurrently. I searched quite a lot via google, but not result. BTW, I'm using glassfish-2 ...

Are Modules still commonly used in program structures?

I am not a program designer by any means but I would really like to start getting a better grasp of how to do it and a better understanding of the .NET languages in general (VB, C#). I was reading a book by Wrox - Professional Visual Basic 2008. In it I believed it mentioned that Modules are slowly going out of existence. I can see why m...

Get Flex modules from ASP MVC

Hi, We´re developing an ASP MVC application witch the View (aspx) has a Flex embed. This aspx/flex view is composed by a flex application and several modules. So, when we call the application url (http://localhost:9090/MyProject/Flex/Index), the server invoke the method the will return the ActionResult that represents this action, in ...

Should a C++ embedded application use a common header with typedefs for built-in C++ types?

It's common practice where I work to avoid directly using built-in types and instead include a standardtypes.h that has items like: // \Common\standardtypes.h typedef double Float64_T; typedef int SInt32_T; Almost all components and source files become dependent on this header, but some people argue that it'...

What apache2 module to use for traffic limiting?

I'm looking for a module for Apache2 which can limit bandwidth for a given period after a certain amount of traffic has passed. Does anybody know of one? The system is Debian (Lenny). I already looked into: - mod_cband : old, buggy, not being developed anymore - mod_bw : Only for bandwidth throtteling - mod_throttle : was promising, bu...

Python module search path

I have a project like that : foo/ | main.py | bar/ | | module1.py | | module2.py | | __init__.py with main.py doing import bar.module1 and module1.py doing import module2. This works using python 2.6 but not with python 3.1 (ImportError: No module named module2) Why did the behaviour change ? How to restore it ? ...