LINUX: order of statically linked module loading

If I have two modules which are being statically linked in. One modules' module_init function depends on another module's module_init function having already run. Is there a way to force one module to load before the other? Also, is the first module's init function guaranteed to finish before the second one is invoked? Lastly, if the answer to the above is NO, what is the recommended way of synchronizing the two module init calls to make sure I don't run into issues?

Code looking for modules in the wrong place

I have created a multi-layer build using build.dojotoolkit.org (my first attempt) with 3 layers: dojo.js, dojox.js, dijit.js. Each js file is uploaded in its own folder (dojo,dojox,dijit). When I run the code, I would expect it to look in dijit.js to get the form modules like dijit.form.TextBox. But instead it tries to load dijit/form/TextBox.js and of course ends up with a 404 error. What am I doing wrong? The files are here if it helps: http://usermanagedsolutions.com/Demos/Pages

how to compile multi-folder Fortran Project having interfaces, modules and subroutines

I am new to Fortran. I am working on a research project where I am using an open source project that has several files distributed in multiple folders. i found the dependency of each programs but could not figure out how to compile them. I have source code distributed in three folders. a)modules b)interfaces c)subroutines I would like to run a program named as 'Main.f90' in subroutines folder, this program has dependency of source codes from modules and interfaces folders. I am using eclipse

Module Beginner Device Driver Development Linux

I am a newbie on driver development in linux. I've read some books about this. I started like everyone (I think) with "Hello World" example but I want to make more. I found this code in a book: #include <linux/module.h> #include <linux/configfs.h> #include <linux/init.h> #include <linux/tty.h> #include <linux/kd.h> #include <linux/vt.h> #include <linux/console_struct.h> #include <linux/vt_kern.h> MODULE_DESCRIPTION("Example module illustrating

Module Prestashop get the product default image from the product name?

In Prestashop I want to know by which pattern prestashop shows the product default image? I mean lets say I have a mysql query for prestashop like this SELECT ps_product.id_product,ps_product.id_category_default,description_short,ps_product_lang.name FROM ps_product_lang,ps_product WHERE ps_product_lang.id_lang=1 AND ps_product.id_product=ps_product_lang.id_product Now here I will get the product id, product category, description, and name. Now according to prestashop default products and dat

How do I do a basic import/include of a function from one module to another in Rust 2015?

I can't find how to include (or import, inject, or some other word) a function from one file (module) to another. I start a new project with $ cd ~/projects $ cargo new proj --bin $ cd proj $ tree . | -- Cargo.toml -- src | -- main.rs I modify main.rs and create a new file a.rs (inside the src dir) with the following code: main.rs fn main() { println!("{}", a::foo()); } a.rs pub fn foo() -> i32 { 42 } I run the project with cargo run and get the error: error[E0433]: fail

Module Compiling custom ejabberd with multiple source files

I'm trying to compile custom ejabberd module which has multiple files in src/ and include/. My module is conforming to https://github.com/processone/ejabberd-contrib guidelines and using ejabberdctl module_check produces "ok". When I'm compiling and installing module with only one source, everything works as expected and ejabberdctl module_install installs module. But when I have multiple source files, ejabberdctl module_install doesn't compile anything but file with exact name of my module.

Creating a Visitor Pattern with Polymorphic Recursive Modules

(Disclaimer: I am fairly certain that this is not idiomatic in any way. If there is some alternative tree-traversal idiom in OCaml, I'm all ears :) ) I am writing a toy compiler in OCaml, and I would like to have a visitor for my large syntax tree type. I wrote one using classes, but I thought it would be fun to try and implement one using modules/functors. My type hierarchy is massive, so let me illustrate what I'm trying to do. Consider the following type definitions (making these up on the

Module Add FreeRTOS Kernel to an existing project in AtmelStudio

I want add FreeRTOS Kernel to an existing project, the references I consult shows that this can be done using ASF Wizard. However in the ASF 3.30.1 (the version i have in my PC) I cannot find FreeRTOS module I am not sure I undrestand why the freeRTOS module doesn't exist. Also I do not want to import freeRTOS source files from another project(this will be the last choice). I am using Atmel Studio version 7.0.1006 Thank you in advance

How to divide my program in modules?

I'm having problems dividing my code into modules, I have a lot of compilation errors but I've tried something. The single file program works and evaluates expressions with the four basic math operators (+-*/), nested with parentheses or not. I'm new to Rust so I'm having trouble understanding the module system and I want you to help me understand it and do it well from the beginning. Here is the code (all files are in the src/ folder of the cargo project): Operator.rs // An attribute to hid

Module Prestashop - calculated field in backoffice table form

I would like to add a "virtual" field to a Prestashop 1.6 custom table in the back office. The field indice_calculo_pvp2 should not be saved into the database, as it is a calculated from the values of indice_calculo_pvp and precio_venta_recomendado. What would be the correct way to implement this? My code is as follows : public function renderList() { $this->addRowAction('edit'); $this->addRowAction('delete'); $this->fields_list = array( 'id_product_price' => a

R shinyjs show/hide not working from module

I want to be able to switch various parts of my UI on/off using shinyjs show and hide. I need to access parts of the UI outside the module from within a module. Is this possible? See the attached app code. The show/hide buttons in the main server code work, but those in the module do not. Thanks for any suggestions. exampleUI <- function(id) { ns <- NS(id) tagList(actionButton(ns("hide_id"), "Module - Hide divs"), actionButton

Workaround for `count.index` in Terraform Module

I need a workaround for using count.index inside a module block for some input variables. I have a habit of over-complicating problems, so maybe there's a much easier solution. File/Folder Structure: modules/ main.tf ignition/ main.tf modules/ files/ main.tf template_files/ main.tf End Goal: Create an Ignition file for each instance I'm deploying. Each Ignition file has instance-specific info like hostname, IP address, etc. All of this code works if I

Module Odoo 14 overriding method

I'm trying to create an Odoo module which override Sales order confirm button. I followed the information I found, and I created the following code, but it doesn't work. from odoo import models, fields, api import logging _logger = logging.getLogger(__name__) class saleoverride(models.Model): _name = 'saleoverride.saleoverride' _description = 'saleoverride' _inherit = 'sale.order' name = fields.Char() # value = fields.Integer() # value2 = fields.Float(compute="_va

Define a module and call its function in one file

I have defined a module in a file mod.ml as follows: module Area = struct ... let test : unit = Print.printf "haha" ... end;; Print.printf "hehe";; Area.test It seems that without ;; after end, I can not compile the code by ocamlc. But it looks strange to me to have ;; in a Ocaml file, do I have to keep them? After generating mod by ocamlc, I launch mod, it prints hahahehe. It seems that haha is printed by the definition of let test : unit ... instead of its call Area.test. What

OCaml Module : include AND open?

I'm fairly new with OCaml Module and I haven't managed to use my own module without combining both an "include" and an "open". I've tried to put the signature in a separate .mli file, without success. Below I'm indicated a minimum (not) working example, that I'm trying to compile with ocamlc -o main Robot.ml main.ml What to I need to do to only have to use "open", or only "include", but not both of them ? File "Robot.ml" : module type RobotSignature = sig val top: unit -> unit en

DNN module package doesn't install controls

I am creating a DNN module, and have a working module based on this: http://www.subodh.com/Projects/DNN-Module. When I install it on a DNN 5.6.2 installation, everything works fine, except the .ascx files do not copy over. If I copy the .ascx files manually, the module works fine. My .dnn file looks like this: ... <moduleDefinitions> <moduleDefinition> <friendlyName>SignUp.Control1</friendlyName> <defaultCacheTime>0</defaultCacheTime>

Instantiation of a module in verilog

I am getting an error in instantiating a module in verilog file. I am instantiating like this: module lab3(input clk,set,reset,plus,minus,start,button,output reg [3:0]led,output reg [6:0]y); wire [3:0] indicesgu[3:0]; reg [1:0] going; reg alsogoing,yes; if (going==1 && alsogoing) begin up_counter up_0 indicesgu , indices , alsogoing ); end and my up_counter module starts as: module up_counter(input [3:0] indices_in [3:0],output [3:0]indices[3:0],output alsogoing); reg [3:0

Is there any difference between top-level modules and local modules?

I am a newbe to F#, but am quite familiar with C#. And I was wondering if there is a difference between declaring top level modules and local modules (e.g. performance, etc.), other than that the namespace declaration is not needed for top-level modules (it is part of the module declaration). I cannot find anything in the documentation (MSDN F# Modules) specifying other differences. Basically, coming from the C# world I prefer //Version 1 namespace My.Namespace module MyModule = let a =

Module Use macro in different file

I'm building a library and I have the following structure: src/lib.rs mod a; mod b; src/b.rs: macro_rules! x ... src/a.rs: x!() this doesn't work. I tried to fiddle with #macro_export and #macro_use but without success. What's the correct approach to re-using macros in the same library but in different module and file?

Compiling Typescript applications with external modules

I have a very simple code in my app.tsx file: /// <reference path="../modules/ReactSpa/Routing/Router.ts" /> import Router = ReactSpa.Routing.Router; var router = new Router(); router.addParam('id', /([\d\-]+)/); router.add('/articles/:id', 'Article'); console.log(router.find('/articles/1234')); My tsconfig.json file: { "compilerOptions": { "module": "umd", "sourceMap": true, "diagnostics": true, "jsx": "react", "out": "public/assets/script

Extending standard library modules

Is it possible to extend (or even override) standard library modules. I'd like to be able to do something like -- eggs.lua table.spam = function(tab) return tab[1] end and then -- ham.lua require('eggs') table.spam({2,7,1,3})

Connect all modules in scheme by massive of wires. Verilog

I have some modules in my scheme and I want to connect it by massive of wires. How it look in my mind: When come changes of variable some_trigger in top level module, in this moment top level module send signal by input_output_wire in module a1-> module a1 make some stuff -> module a1 send too module a2 by the massive_input_output_wire[0] -> module a2 make some stuff -> a2 send by next wire in the massive massive_input_output_wire[1] to module a3 -> a3 make some stuff -> send to a4 by massive_i

What is a Module Path Index in Racket

Racket has Module Paths (predicate is module-path?), Resolved Module Paths (predicate is resolved-module-path?), and Module Path Indexes (predicate is module-path-index?). I guess a module-path? is anything that could plausibly point to a module. And I guess a resolved module path points to an actual module on the system. But what is a module path index and what does it get me over just a resolved module path?

Calling a module subroutine using a fully qualified name

I created a simple test module ./mods/My/Module.pm6: unit module My::Module; use v6; sub hello () is export { say "Hello"; } Then, I have a test script ./p.p6: #! /usr/bin/env perl6 use v6; use My::Module; My::Module::hello(); Then I set PERL6LIB to include the folder ./mods, and then run the script: $ ./p.p6 Could not find symbol '&hello' in block <unit> at ./p.p6 line 7 However, if I replace the line My::Module::hello() in the script with hello() it works fine. Wha

Variant types as module/functor signature constraints in ocaml

I'm trying to use modules/functors to have a more generic code design. To simplify, I have two interfaces: module type T1 = sig type t end;; module type T2 = sig type t end;; and I'd like so instantiate T2.t with a variant type based on T1.t. (* simple example, this one is accepted *) module OK (T: T1) : (T2 with type t = T.t) = struct type t = T.t end;; (* using a variant type, this one is rejected *) module KO (T: T1) : (T2 with type t = X | Y of T.t) = struct type t = X | Y of T.t end

Abstract types in modules in OCaml

I have very simple signature and module in OCaml: module type S = sig type t val y : t end;; and module M2 : S = struct type t = int let x = 1 let y = x+2 end;; I cannot use construction like M2.y to get 3 unless i specify the module as module M2 : S with type t = int = struct ... Why is it so? There already is statement, that type t = int

Shiny: insertTab with modules

I am trying to insert tabs dynamically calling the insertTab() function within a module. For some reason my approach does not work. I guess the problem is how I pass the tabsetPanel id and the value of an existing tabPanel (next to which a tab should be added) to the module. actionButUI = function(id, label=NULL) { ns = NS(id) tagList( actionButton(ns("button"), label = label) ) } actionBut = function(input, output, session, tabsetPanel_id, target) { observeEvent(input$button, {

Module ImportError: cannot import name 'mesh'

I am trying to create and save an stl file with a cube and I cannot import the mesh module for some reason. When hovering over mesh, it says: "Cannot find 'mesh' in '__init__.py'" I originally had the directory folder named stlExperiments but then someone said you cannot have stl in the name so I changed all instances of "stl" to "st" and no change, so I'm left to assume it's a completely different problem. Can anybody help? I am in the dark. The import code goes as follows: from __future__ imp

SMS can't be sent using GSM module SIM900A

I am trying to send a SMS using GSM SIM900A. But there is no compilation error and other interference there. The code is executed properly but SMS isn't sent to the number mentioned in the code. #include <TinyGPS.h> #include <SoftwareSerial.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); SoftwareSerial SIM900A(7, 8); void setup() { Serial.begin(9600); SIM900A.begin(9600); pinMode(6, INPUT); } void loop() { bool state

Module using pthreads in fortran

i want to use pthreads in my fortran program but i cannot even get it to compile. i have used pthreads in C programs and need it for my fortran program but a call to use f_pthread results in the following error: Fatal Error: Can't open module file 'f_pthread.mod' for reading at (1): No such file or directory so quite obviously i don't have f_pthread.mod linking. where is f_pthread.mod and/or how do i go about making it or downloading it? every single thing i have looked up talks about how to u

X-Cart Pro Module to display seller information in product detail page

I am using X-Cart Pro 4.4.5. While displaying the details of product when user clicks on any product, i want to display the Seller info as well, that who is selling that product. See below link how X-Cart displays its product detail: http://demo.x-cart.com/demo_pro/Three-Stone-Princess-Cut-Diamond-Ring.html And now see below link to get idea how seller info should be included, it will show the vendor name ofr e.g, "Ships from/sold by World Wide Stereo (Who's this?)" http://www.buy.com/prod/

Module typescript require() needs to include the folder the file is in - sometimes

I have one case where my imports were: import docHeader = require('doc-header'); import listBody = require('list-body'); And failed saying they couldn't find the .js file and the url listed was missing document. So I changed them to: import docHeader = require('document/doc-header'); import listBody = require('document/list-body'); The thing is, the file I have this in is in the document folder. Here's the file setup/call stack. layout/worker-api.ts: import document = require('document/d

RequireJS: returning total function but I need the value, because it is a date module?

I am creating a module like this. Because it is a date object, I am writing the code in the return block. Otherwise it is giving the same time. So, what I want is if at all, wants to do some functionality with respect to day, date or a property, I have written a function but it is giving total function as an response: define([], function() { var dayarr = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; return { date: new Date().getDate(), day: daya

Error when I try to install module in prestashop

Following the Developer's manual for prestashop I've this problem: My code for my Test Module is: if (!defined("_PS_VERSION_")){ exit; } class MyModule extends Module{ public function __construct(){ $this->name='Testing'; $this->tab='Modulo Prueba'; $this->version=1.0; $this->author='Uniagro'; $this->need_instance=0; parent::__construct(); $this->displayName = $this->l('Test'); $this->d

Running other modules' submodules

I'd like to selectively run a Racket module's submodules from another module. Please help me fill in the blanks! File 1 #lang racket/base ;; <big file, lots of code> (module+ small-tests ;; basic correctness checks (displayln "Small tests pass!") ) (module+ big-tests ;; heavy duty stress tests (displayln "Big tests pass!") ) File 2 #lang racket/base (module+ main ;; Trigger either the small-tests or the big-tests, ;; depending on what's written here. (require '??

Module lua 'require' duplicating table

What I am trying to do is; use a module to create two distinct and separate tables but what seems to be happening is; if I have already used 'require' then it will give me a reference to the previous require what I really want is just the value/a copy of the module. I cannot use 'dofile' because 1). I need to use relative paths and 2). I am building this in Corona for android and as I understand 'dofile' does not work well with .apk. Here is my code. This is my main.lua foo = require('modules

Module ES6 export all values from object

Say I have a module (./my-module.js) that has an object which should be its return value: let values = { a: 1, b: 2, c: 3 } // "export values" results in SyntaxError: Unexpected token So I can import them like: import {a} from './my-module' // a === 1 import * as myModule from './my-module' // myModule.a === 1 The only way I found is by hard coding the exports: export let a = values.a export let b = values.b export let c = values.c // or: export let {a, b, c} = values Which i

Creating and using a custom module in Julia

Although this question has been asked before, it appears that much has changed with respect to modules in Julia V1.0. I'm trying to write a custom module and do some testing on it. From the Julia documentation on Pkg, using the dev command, there is a way to create a git tree and start working. However, this seems like overkill at this point. I would like to just do a small local file, say mymodule.jl that would be like: module MyModule export f, mystruct function f() end struct mystruc

Prestashop 1.7.x module architecture done right, how to?

I created 2 modules, both using an override on the same class ( Customer ) to add DB extra data representation. The second module gives me an error because the class is overridden already by the first module. Both modules have an "/override/classes/" path. I solved merging all the overrides on the first module and stripping it out form the second. But what is the right way to proceed before coding a module that uses an override? should I manage all needed overrides putting them in the

Adding or removing "Modules" from application

This may be a bit vaque question, but I'm fiddling with it for quite a while now... So here goes: I want to make my application structured by different "modules". Like: Analytics, Multi user, Charting, Data manipulation, etc... you name it. The Application itself would be just a "core" for those modules. which can be added per user request (subscription based, payement plan, ...) or by regular update... Hope you get what I mean. Scenario: User buys my application with only ba

How to load a module inside a custom module in Ejabberd?

I'm creating a custom module which uses some exported functions from mod_shared_roster module. Here is the code. -module(mod_shared_roster_extra). -author('https://github.com/eric-mendoza'). -behaviour(gen_mod). -include("logger.hrl"). -include("translate.hrl"). -export([start/2, stop/1, reload/3, mod_options/1, get_commands_spec/0, depends/2, mod_doc/0]). % Commands API -export([ % Shared roster srg_display_group_add/4, srg_display_group_del/4, srg_set_opts/4 ])

Can the booted kernel version differ from the version against which a module has been built?

I am trying to build and install kernel modules for a network card, from source. The module sources seem very picky in terms of which kernel version they can compile against. I have managed to build the modules against the LTS kernel headers for my distribution, Arch Linux, which at the moment are linux-lts-headers 5.10.37-1. Does this mean that I need to actually install and boot this exact same kernel version, to use the modules? Or do the modules have some tolerance between the booted version

  1    2   3   4   5   6  ... 下一页 最后一页 共 9 页