Search Results

Search found 7654 results on 307 pages for 'module'.

Page 5/307 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • A metaphor for Drupal module's inner workings

    - by PHP thinker
    What is the best application workflow metaphor for Drupal module? In PHP frameworks we think MVC-style. How do we think inside Drupal? Asumming I am writing some user-oriented module like Shop, Catalog or Forum. As far as I understand there are no or few MVC based modules. Should I generally treat Drupal modules (as sub-application) as a number of screens connected via forms and hyperlinks or there is a better way. My question may be a little bit speculative, but I hope someone will share my intent to think models, not just "scripts".

    Read the article

  • Automatically enabling an output filter in Apache module

    - by Chris
    I am developing a module for Apache which contains an output filter that I would like to always be invoked so that it can determine whether to process the request data or just pass the data along. Since I would like the module to be compatible with Apache 2.0 as well as 2.2, I do not want to use mod_filter. Ideally I would like to do this without having to explicitly enable the filter through the httpd.conf file, but I have so far not been able to find any example of this. Is this at all possible? Can someone please point me to a suitable example?

    Read the article

  • kernelHow to read/write files within kernel module?

    - by Methos
    I know all the discussions about why one should not read/write files from kernel, instead how to use /proc or netlink to do that. I want to read/write anyway. I have also read http://www.linuxjournal.com/article/8110 However, problem is 2.6.30 does not export sys_read(). Rather its wrapped in SYSCALL_DEFINE3. So if I use that in my module, I get following warnings: WARNING: "sys_read" [xxx.ko] undefined! WARNING: "sys_open" [xxx.ko] undefined! Obviously insmod cannot load the module because linking does not happen correctly. Questions: How to read/write within kernel after 2.6.22 (where sys_read()/sys_open() are not exported)? In general, how to use system calls wrapped in macro SYSCALL_DEFINEn() from within the kernel?

    Read the article

  • Permission Problem While Installing Module With CPAN

    - by neversaint
    I tried to following module using CPAN, but the message I get is the "I have neither the -x permission ..." . How can I resolve that? cpan[3]> install List::MoreUtils is it OK to try to connect to the Internet? [yes] Fetching with LWP: http://www.perl.org/CPAN/authors/id/V/VP/VPARSEVAL/List-MoreUtils-0.22.tar.gz CPAN: Digest::SHA loaded ok (v5.48) Fetching with LWP: http://www.perl.org/CPAN/authors/id/V/VP/VPARSEVAL/CHECKSUMS Checksum for /home/ewijaya/.cpan/sources/authors/id/V/VP/VPARSEVAL/List-MoreUtils-0.22.tar.gz ok Scanning cache /home/neversaint/.cpan/build for sizes .....I have neither the -x permission nor the permission to change the permission; cannot estimate disk usage of '/home/neversaint/.cpan/build/Module-Build-0.3607-Kvb1Vq' .I have neither the -x permission nor the permission to change the permission; cannot estimate disk usage of '/home/neversaint/.cpan/build/ExtUtils-ParseXS-2.2205-zuX4x2' ^CCaught SIGINT, trying to continue

    Read the article

  • Send instance method to module

    - by Matchu
    Given the following module, module Foo def bar :baz end end def send_to_foo(method) # ...? end send_to_foo(:bar) # => :baz What code should go in send_to_foo to make the last line work as expected? (send_to_foo is obviously not how I would implement this; it just makes clearer what I'm looking for.) I expected Foo.send(:bar) to work at first, but it makes sense that it doesn't. It would if the method were defined as def self.bar, but that's no fun.

    Read the article

  • Importing a function/class from a Python module of the same name

    - by Brendan
    I have a Python package mymodule with a sub-package utils (i.e. a subdirectory which contains modules each with a function). The functions have the same name as the file/module in which they live. I would like to be able to access the functions as follows, from mymodule.utils import a_function Strangely however, sometimes I can import functions using the above notation, however other times I cannot. I have not been able to work out why though (recently, for example, I renamed a function and the file it was in and reflected this rename in the utils.__init__.py file but it no longer imported as a functions (rather as a module) in one of my scripts. The utils.__init__.py reads something like, __all__ = ['a_function', 'b_function' ...] from a_function import a_function from b_function import b_function ... mymodule.__init__.py has no reference to utils Ideas?

    Read the article

  • Drupal 6 - Including a module form in a view

    - by espais
    I'm making use of the Favorites module, in order to allow my users to favorite nodes they like. Currently, I know that there is a block available for listing out the favorites, along with the 'Add to favorites' button at the top of this list. What I'd like to do is generate the form which includes the button, and include it within each node that I generate. I'd gotten it hacked up and quickly working by copying the generated form and placing it in my views-view--fields-.tpl.php template, however I believe that doing it this way goes against the thought behind Drupal, and probably introduces security issues with the form_id and form_token being hand-written. I've attempted to call the get_form function, and have passed it the form_id that I found in the generated form code, however I can't get Drupal to recognize it. From some Googling I've noticed that generating module forms programmatically may require a hook, but I haven't been able to find any good examples of this. What is the best way to go about creating this form?

    Read the article

  • Drupal OAuth Service Module

    - by user470714
    I am trying to do some research into potentially setting up an existing Drupal site with user accounts/login page to also be an OAuth service provider, basically authenticating users to make calls with a web service. I am looking for a Drupal module which will give this functionality. Most of what I run into are OAuth consumer modules, which is not what I want in this case. I've found a few modules which I think might do this for me, but the module descriptions are generally pretty vague and don't have much of a user base which doesn't inspire much confidence. Has anyone else done this before? What are the best modules available for doing this?

    Read the article

  • Writing Ruby Libraries - hiding methods from outside the module

    - by JP
    Hi all, I'm writing a Ruby library which has a module with a bunch of classes inside it. Many of these classes need to be usable and modifiable by calling scripts, but I don't want (some of) the initializers to be visible/callable: module MyLib class Control def initialize # They can use this end def do_stuff Helper.new('things') end end class Helper # Shouldn't be visible def initialize(what) @what = what end def shout @what end end end c = MyLib::Control.new h = c.do_stuff p h.shout # => "things" # ^ All of this is desired # v This is undesirable p MyLib::Helper.new('!') # => <MyLib::Helper @what='!'> If it's a simple thing, then I'd also appreciate the generated RDoc not even include the .new method for the Helper class either. Any ideas? Thanks for reading!

    Read the article

  • File/module structure in Python

    - by keithjgrant
    So I'm just getting started with Python, and currently working my way through diveintopython.org. The code examples are nice, but the vast majority of them are little four-line snippets, and I want to see a little more of the big picture. As I understand it--and correct me if I'm wrong--each '.py' file becomes a "module", and a group of modules in a directory becomes a "package" (at least, it does if I create a __init__.py file in that directory). What is it if I don't have a __init__.py file? So what does each "module" file look like? Do I generally define only one class in the file? Does anything else go in that file besides the class definition and maybe a handful of import commands?

    Read the article

  • Instantiate a javascript module only one time.

    - by Cedric Dugas
    Hey guys, I follow a module pattern where I instantiate components, however, a lot of time a component will only be instantiate one time (example: a comment system for an article). For now I instantiate in the same JS file. but I was wondering if it is the wrong approach? It kind of make no sense to instantiate in the same file and always only once. But at the same time, if this file is in the page I want to have access to my module without instantiate from elsewhere, and IF I need another instance, I just create another from elsewhere... Here is the pattern I follow: ApplicationNamespace.Classname = function() { // constructor function privateFunctionInit() { // private } this.privilegedFunction = function() { // privileged privateFunction(); }; privateFunctionInit() }; ApplicationNamespace.Classname.prototype = { Method: function(){} } var class = new ApplicationNamespace.Classname(); What do you think, wrong approach, or is this good?

    Read the article

  • NUnit Random Module

    - by Tra5is
    I've noticed something curious. When I attach the VS2010 debugger to the nunit.exe running process I see a loaded module with no path and a randomly generated filename. I tried attaching WinDBG to the exact same instance of NUnit.exe and the module is NOT listed in the module list. I also can't find anything with Google so I'm hoping someone here could help out. Is this normal NUnit behavior or is something sneaky going on? Some examples of the module name: 1xmsg0gj x4max0ed koh9hmef

    Read the article

  • Converting a PowerShell Script into a Module Part 2

    In this article the author explains how PSModuleInfo object for a module can be retrieved. Further, he shows how code can be injected into the module to manipulate the state of a module without having to reload it. He also explains how to directly set some metadata elements, like the module description, and some other PSModuleInfo object features.

    Read the article

  • JavaScript Module Pattern - What about using "return this"?

    - by Rob
    After doing some reading about the Module Pattern, I've seen a few ways of returning the properties which you want to be public. One of the most common ways is to declare your public properties and methods right inside of the "return" statement, apart from your private properties and methods. A similar way (the "Revealing" pattern) is to provide simply references to the properties and methods which you want to be public. Lastly, a third technique I saw was to create a new object inside your module function, to which you assign your new properties before returning said object. This was an interesting idea, but requires the creation of a new object. So I was thinking, why not just use "this.propertyName" to assign your public properties and methods, and finally use "return this" at the end? This way seems much simpler to me, as you can create private properties and methods with the usual "var" or "function" syntax, or use the "this.propertyName" syntax to declare your public methods. Here's the method I'm suggesting: (function() { var privateMethod = function () { alert('This is a private method.'); } this.publicMethod = function () { alert('This is a public method.'); } return this; })(); Are there any pros/cons to using the method above? What about the others?

    Read the article

  • Android NDK import-module / code reuse

    - by Graeme
    Morning! I've created a small NDK project which allows dynamic serialisation of objects between Java and C++ through JNI. The logic works like this: Bean - JavaCInterface.Java - JavaCInterface.cpp - JavaCInterface.java - Bean The problem is I want to use this functionality in other projects. I separated out the test code from the project and created a "Tester" project. The tester project sends a Java object through to C++ which then echo's it back to the Java layer. I thought linking would be pretty simple - ("Simple" in terms of NDK/JNI is usually a day of frustration) I added the JNIBridge project as a source project and including the following lines to Android.mk: NDK_MODULE_PATH=.../JNIBridge/jni/" JNIBridge/jni/JavaCInterface/Android.mk: ... include $(BUILD_STATIC_LIBRARY) JNITester/jni/Android.mk: ... include $(BUILD_SHARED_LIBRARY) $(call import-module, JavaCInterface) This all works fine. The C++ files which rely on headers from JavaCInterface module work fine. Also the Java classes can happily use interfaces from JNIBridge project. All the linking is happy. Unfortunately JavaCInterface.java which contains the native method calls cannot see the JNI method located in the static library. (Logically they are in the same project but both are imported into the project where you wish to use them through the above mechanism). My current solutions are are follows. I'm hoping someone can suggest something that will preserve the modular nature of what I'm trying to achieve: My current solution would be to include the JavaCInterface cpp files in the calling project like so: LOCAL_SRC_FILES := FunctionTable.cpp $(PATH_TO_SHARED_PROJECT)/JavaCInterface.cpp But I'd rather not do this as it would lead to me needing to update each depending project if I changed the JavaCInterface architecture. I could create a new set of JNI method signatures in each local project which then link to the imported modules. Again, this binds the implementations too tightly.

    Read the article

  • Is it bad practice for a module to contain more information than it needs?

    - by gekod
    I just wanted to ask for your opinion on a situation that occurs sometimes and which I don't know what would be the most elegant way to solve it. Here it goes: We have module A which reads an entry from a database and sends a request to module B containing ONLY the information from the entry module B would need to accomplish it's job (to keep modularity I just give it the information it needs - module B has nothing to do with the rest of the information from the read DB entry). Now after finishing it's job, module B has to reply to a module C if it succeeded or failed. To do this module B replies with the information it has gotten from module A and some variable meaning success or fail. Now here comes the problem: module C needs to find that entry again BUT the information it has gotten from module B is not enough to uniquely find the exact same entry again. I don't think that module A giving more information to module B which it doesn't need to do it's job but which it could then give back to module C would be a good practice because this would mean giving some module information it doesn't really need. What do you think?

    Read the article

  • vb.net module visibility

    - by dcp
    If I have a module in a VB.Net class library, will it's visibility be limited to the assembly? What I'm looking for is the VB.Net equivalent of a C# internal static class. Does anyone know the equivalent?

    Read the article

  • Skin issues with multiple controls in a Dot Net Nuke module

    - by Josiah
    In the Dot Net Nuke module that I'm developing I need to separate the controls into several different areas. Unfortunately, it appears that Dot Net Nuke thinks that any control identified by a control key is an 'edit' screen and changes the skin automatically. Is it possible to change this behaviour programmatically? What is the best method of switching controls without having the skin changed?

    Read the article

  • Override the Local module directory for cvs using Hudson

    - by Roberto
    Hi guys, I'm using Hudson and I need to change the checkout directory for cvs. Instead of checkout/update the project under the workspace dir, I'd like to specify a dir (as you can do for svn, changing the Local module directory conf) that will match the cvs tree structure. Eg. under cvs dir1/dir2/project on my box workspace/dir1/dir2/project is that possible with cvs and Hudson? Maybe there's a way to override the cvs call? Thanks! Roberto

    Read the article

  • Drupal Module Themes - Default CSS?

    - by derekerdmann
    There's tons of documentation out there on how to override the appearance of Drupal modules, but I keep finding the docs for writing the original theme to be a little lacking. On this note, how can I tell Drupal to use a specific CSS file for my custom module's block output?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >