Tags "module" Result

Python: how to make global imports from a function

I fear that this is a messy way to approach the problem but... let's say that I want to make some imports in Python based on some conditions. For this reason I want to write a function: def conditional_import_modules(test): if test == 'foo': import onemodule, anothermodule elif test == 'bar': import thirdmodule, and_anot

it1352 1 2019-05-21

Erlang: module attribute

I am new to Erlang. Found the following -module attribute declaration in an existing Erlang project: -module(mod_name, [Name, Path, Version]). What does mean the second parameter (list [Name, Path, Version]) here? I haven't found any information in the Erlang reference on it. Solution This defines a parameterised erlang module - one you can "i

it1352 1 2019-05-16

JavaScript module pattern with example

I can't find any accessible examples showing how two (or more) different modules are connected to work together. So, I'd like to ask whether anyone has time to write an example explaining how modules work together. Solution In order to approach to Modular design pattern, you need to understand these concept first: Immediately-Invoked Function Ex

it1352 1 2019-05-22

Localhost not loading module

I am using modern Javascript MyClass.js export default class MyClass { constructor(x) { this.val=x? x: "Hello!" console.log("MyClass:",x) } } at my http://localhost/myfolder/mypage.htm, with the source below, <!DOCTYPE html> <html> <head> <title>test</title> <meta charset="utf-8" />

it1352 2 2019-06-25

Undefined reference to procedure defined in the same module

I am trying to get familiarize with modules in fortran and for that I have created a simple code with module. The source code is attached. MAIN PROGRAM program main_prog use mod_f_g_h ! implicit none ! f,g,h,s are defined in mod_f_g_h real :: x,y ! ! read x,y print *, "enter x and y " read*, x, y ! ! check if( y == 0 ) th

it1352 3 2019-05-17

Multiple Module in Angularjs

Is it possible to create multiple module in an angular Script?? I went through the angular documentation and learned that it is some kind of main method concept. I need examples to demonstrate this. Thanks Solution Yes, you can define multiple modules in angularJS as given below. var myApp = angular.module('myApp', []) var myApp2 = angular.mod

it1352 3 2019-05-08

How to automatically reload modules in IPython?

Before I begin, I want to say that I am not a programmer; I am a geek and an engineer. Thus, I love coding and use it academically. Stackoverflow taught me more than 80% of what I know about python. My problem is I need to manually reload the modules in my scripts by first importing importlib into my terminal and than using importlib.reload(*modul

it1352 0 2019-05-21

Why does module pattern create a singleton?

When I try and make different instances of this module, it does not work. It seems to be a singleton. I can only have one instance at a time. What mechanism limits the constructor function publik() to only have on instance? http://jsfiddle.net/AVxZR/ var Module = ( function () { var publik = function ( ) { }; publik.prototype.t

it1352 2 2019-07-04

GWT Modules and Web Pages

I am new to GWT and am going through the docs, examples, demos etc. All the examples seem to have just one module which is loaded by a single html page contained in the sample. What if the web app has multiple web pages/features. Can multiple web pages providing different functionality utilize the same gwt module by building the UI differently b

it1352 0 2019-05-19

Can I get a list of all the modules that are currently loaded?

module_info will tell me quite a bit of what I need to know about a module - provided that I know its name. I have a need to find all modules whose names meet specific criteria (like companyname_creator_serialnumber.) I remember reading somewhere that erlang stores this information, but I am looking for a way to retrieve it. EDIT: all_loaded()

it1352 0 2020-10-30