module

Best way to handle reload-ing of objects, not modules

Hi, I'm doing a lot of development in IPython where In[3]: from mystuff import MyObject and then I make lots of changes in mystuff.py. In order to update the namespace, I have to do In[4]: reload(mystuff) In[5]: from mystuff import MyObject Is there a better way to do this? Note that I cannot import MyObject by referencing mystuff...

Why do I get this module error: "Can't locate Error.pm in @INC"?

I tried running: perl -e "use Error;" from cmd in windows 7. (active perl 5.12 installed on system) and I am getting the error Can't locate Error.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib ) I manually searched and found Error.pm in C:/Perl64/lib/CPANPLUS. Does anyone have an idea what could be going o...

Windows equivalent of perl modules required (not available in activestate ppm) such as file::finder

Hi All, I'm attempting to import code written in linux into eclipse's perl plugin 'epic', and have installed activestate perl in windows. Most of the modules have an activestate equivalent, but some of them I can't find in ppm. Does anyone know how I can get the following modules so that the code can compile? File::Finder Spread...

Django: Calling another modules function passed through a parameter

I have a list of functions as: FUNCS=[{'someattr':'somedetail', 'func':baseapp.module.function_name}, {...}, ...] Unfortunately it doesnt work if i try calling the func with FUNCS[0]['func'] I get the error Tried function_name in module baseapp.module Error was: 'module' object has no attribute 'function_name' I presume there mus...

Dump Contents of Python Module loaded in memory

I ran the Python REPL tool and imported a Python Module. Can I can dump the contents of that Module into a file? Is this possible? Thanks in advance. ...

Incorrect Nested Module Routes

I'll preface this with the fact that I'm new to RoR. I have a class that resides in a nested module, ::Physical::Users::User. The code is organized into paths such as app\controllers\physical\users. My problem comes when I try to use form_for like this: <% form_for @user do |f| %> ... <% end %> I get the error ActionView::Templ...

DotNetNuke Blog urls and links

Hi there, I'm not sure why, but we have a dedicated Blog page on our site with some latest entires showing on the home page. Suddenly all links like the title of the entry and the Read More link are pointing to the home page to show the blog entry instead of the blog page. I've tried regenerating the permalinks but that didn't help. ...

Python import inconsistent behavior

I have a py file like this, which errors out. from world import acme def make_stuff_happen(): acme.account.foo() # Works acme.subscription.bar() # FAIL: "module 'object' has no attribute 'subscription'" make_stuff_happen() But this works! from world import acme from world.acme import subscription def make_stuff_hap...

Implementing Load Balancing Using Python

I am doing some research this summer and working on parallelizing pre-existing code. The main focus right now is a way to load balance the code so that it will run more efficient on the cluster. The current task is to make a proof of concept that creates several processes with each one having their own stack available and when the proces...

How to link library to compile/install a Perl module manually?

I want to compile/install a Perl module that depends on a library that is not in Strawberry Perl 5.12. I used Strawberry on a Windows box to install the module (Net-SSH2). The installation failed because it requires the library (libssh2). My issue is similar to this guy's http://www.perlmonks.org/bare/?node_id=814455. But I cannot use th...

strange inheritance in ruby mixins

Hi, I am wondering, why is an included module's methods mixed in to any subsequent class definitions (as if the class included it in itself)? module Foo def bar print "#{self}\n" end end class Bar end begin Bar.bar rescue NoMethodError puts "There is no Bar.bar\n" end include Foo bar Bar.bar Bar.new.bar prints: There...

Understanding functors in OCaml

Hello, I'm quite stuck with the following functor problem in OCaml. I paste some of the code just to let you understand. Basically I defined these two modules in pctl.ml: module type ProbPA = sig include Hashtbl.HashedType val next: t -> (t * float) list val print: t -> float -> unit end module type M = sig type s val s...

Python: Sharing global variables between modules and classes therein.

I know that it's possible to share a global variable across modules in Python. However, I would like to know the extent to which this is possible and why. For example, global_mod.py x = None mid_access_mod.py from global_mod import * class delta: def __init__(self): print x bot_modif_mod.py import mid_access_mod imp...

How do i add some more fields in Magento -> System -> My Account

Hello , I am new to magento and trying to add some more fields there. i am using magento 1.4.1.0 and also trying to so called override methods for block and controller. but i am not able to see the changes. Can anyone help ??? ...

hook_user(): inserting extra field into database not just form.

I can add an extra field to the registration. What I need to know is what step do I need to take to then grab that input and insert it into the user table of drupal. The code below is in my module this adds just a field to the form, but when its submitted it doesnt do anything with the data. function perscriptions_user($op, &$edit, &$ac...

Efficient way of setting Logging across a Package Module

I have a package that has several components in it that would benefit greatly from using logging and outputting useful information. What I do not want to do is to 'setup' proper logging for every single file with somewhere along these lines: import logging logging.basicConfig(level=DEBUG) my_function = logging.getLogger("my_function") ...

Working with the Sitecore Calendar Module

Does anybody have any experience working with the basic sitecore calendar module? I'm playing around with the month view option and there are several things I'd like to change. Is there a way to add: < previous - month next > links so a user can click through the months? I may have missed this, but it doesn't seem to be a configurable...

Best way to load module/class from lib folder in Rails 3?

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them? From github: A few changes were done in this commit: Do not autoload code in *lib* for applications (now you need to explicitly require them). This makes an application behave closer to an engine (code...

Ruby modules and extend self

In what sort of situation is the code: module M extend self def greet puts "hello" end end more beneficial to use over say something like: module M def self.greet puts "hello" end end In the top, one is an instance method being extended, and the latter is just a class method, but when calling either method,...

How can I choose which version of a module to include dynamically in Ruby?

I'm writing a small Ruby command-line application that uses fileutils from the standard library for file operations. Depending on how the user invokes the application, I will want to include either FileUtils, FileUtils::DryRun or FileUtils::Verbose. Since include is private, though, I can't put the logic to choose into the object's init...