Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [modules]

A logical subdivision of a larger, more complex system.

3
votes
1answer
33 views

Snippet to get all local classes from a module

I'm working on a project which due to the complexity of the business logic has had to pull out some classes to do computation related to some values in a database. To link the code and database, both ...
-3
votes
0answers
52 views

Inter-module communication

I have two separate modules , Account and Billing which can work independently of one another. Now my new client wanted a system which need both modules Account and Billinng , but the problem is that ...
1
vote
0answers
65 views

Splitting jQuery code into reusable modules [closed]

I am in the middle of php app development with some addition of js. Since my JS knowledge is not particularly good, I rely on jQuery. However, I like to work with reusable code rather than spaghetti. ...
3
votes
0answers
31 views

Eassily create a logger in python for many modules with loglevel set according to command line arguments

I'm trying to learn writing python programs in a modular way as much as possible. One of the issues I've had difficulty to solve is parsing command line arguments (with ...
2
votes
0answers
39 views

Addition of defaults to components in AngularJS

I wrote a small module in typescript that augments the angularjs registerComponent function to provide a new way of default values for the component controller. ...
1
vote
1answer
75 views

Reusable vector module with tests

I'm learning rust with mostly a background in managed languages. I have a little C background. As a learning project I am re-implementing a linear-transformations library I've been working on in ...
2
votes
1answer
139 views

Python 3 adventure game in modules

I have been learning Python 3 for about a year now. I have been looking for a project to do instead of just going through tutorials and completing some Code Wars challenges. One website suggested that ...
0
votes
0answers
32 views

Node Express Application - VS Template - Error Middleware

Does this modification overlook any fundamental behavior of Node Express application 500 or other errors? Admittedly I only tested 404s. When creating a new project from the Visual Studio 2017 'Basic ...
1
vote
0answers
33 views

Refactoring several mongoose models to similar collections [closed]

I have several collections that have the same documents type, except for the language. Let's say imagesES, imagesEN, imagesFR, and so on.... I just thought about definig just one schema, but also one ...
3
votes
1answer
59 views

JavaScript module to filter data and render it as a table

I want to organize some JavaScript code using module pattern. The scenario is as follows: Having the following html table created dynamically ...
2
votes
1answer
100 views

Mocking an F# primality tester

I would like to ask 2 questions about the modularization of an F# file. The code is just a working example of prime factorization, but that's not the main topic. I have a main file (PrimeFactors.fs), ...
2
votes
2answers
135 views

Mapping one array onto another where columns from first array become rows in second array

I am processing an unformatted CSV, New-AmbSYS-to-2018-Jan.csv, from NHS England Ambulance Quality Indicators, by reading its contents into an array, and carrying out a number of steps that lead to a ...
2
votes
0answers
64 views

Bundling JavaScript modules into a single file

I was just going through Modular Design Patterns in JavaScript and I came across bundlers like browserify and webpack. They ...
0
votes
3answers
87 views

Modular square checker in ANSI-C

I've written a simple program using modular programming in C (using a lot of functions), that gets a line of input from the user, and then prints if a given input forms a magic square or not. The ...
4
votes
0answers
37 views

Self-notification modules

Specifically, I have been working my way through Al Sweigart's Automate the Boring Stuff and was inspired to write my own util/module that I can use for sending myself SMS messages via Twilio. The ...
4
votes
3answers
351 views

Simple Java program - Coding bat sumNumbers

The problem is stated as follows: Given a string, return the sum of the numbers appearing in the string, ignoring all other characters. A number is a series of 1 or more digit chars in a row. (Note:...
6
votes
1answer
61 views

Laser cutter daily reports parser

In my Python journey I was looking for a "real life" problem and I think I have found a good one at my current work. The laser CNC machine I'm working with generates reports that contains timings of ...
7
votes
2answers
499 views

Python Export Decorator

In Python, we use __all__ to explicitly denote the public API of a module or package. That looks like this: ...
2
votes
0answers
167 views

Applying CSS styling based on different pages in React

Short Story: I created this website last year in plain HTML, CSS, JS which I can't even remember how I wrote that and now I can't even edit the website without breaking it. So, I'm re-writing ...
3
votes
1answer
49 views

Copying and resizing pictures, depending on user input

I'm working on a macro which copies some pictures to a new sheet, then resizes the pictures. The user can input a number 1, 2, ..., 5 and, depending on the number, the macro returns a different set of ...
2
votes
2answers
166 views

API with revealing module pattern in Javascript

I'm working on a project where I want to create a API that can be used to do some mathmatical calculations. Here are the important aspects: I used the revealing module pattern I added method ...
3
votes
1answer
632 views

JS calculator module using functional programming

All of the code is self-explanatory and pretty much complete. What the code does: Calculates using onscreen numerics and operators Validates any erroneous operations, such as 4 ** 8 or *9 Good ...
6
votes
1answer
1k views

Pig Dice Game: Luck game to get to 100 points

I have a dice game called Pig to play (a simple google search will show rules, they are included in my .js file as well). I am new to JavaScript and the main goal of this code review is to give me an ...
2
votes
1answer
33 views

NodeJS module to calculate linear motion

I am on the process of changing jobs, so I would like to get an idea of what I do wrong in order to improve. For this, I have created a small node module. It's very simple; it calculates linear ...
2
votes
0answers
59 views

Choosing structure of fields validation module in Swift

I've implemented abstract module for fields validation according to this MVP clean architecture repo. In a nutshell I've created ValidationGateway protocol ...
4
votes
1answer
130 views

A hash cracker for Python 3.0 and up (module)

I've worked on pycrack.py to improve it (hopefully). New features: Renamed to kronos (kronos.py). Attack modes: Bruteforce; Wordlist attack. Portability: Kronos can run on Windows, MacOS and Linux,...
5
votes
2answers
268 views

Optimizing a Text-To-Speech program with a lot of repetition

I have a Text-To-Speech program that will ask the user to input text, convert it to speech and then output that speech from within Pygame by loading the file into memory, getting Pygame to play the ...
6
votes
2answers
111 views

MongoDB Perl Wrapper

I'm trying to create a custom "mongodb perl wrapper". I created the following perl module, which local on my machine runs. My questions to the community are: Would you create the module different? Do ...
4
votes
1answer
76 views

Pomodoro timer module

I have been learning javascript for some time and have just finished my first piece of code that not only actually does something, but is also longer than a few lines of code. It most likely is pretty ...
4
votes
2answers
174 views

Cursor module for a text-editor

A few weeks ago, I had started to write a text-editor in C++ using SFML library. The work is now paused pretty much because I am a lazy freak. So, I thought I might use this passive time to get ...
0
votes
2answers
104 views

Simple SASS & BEM module for social feed widgets

I've been messing around with SASS and BEM for the last few months. I recently starting 'thinking' in modular in terms of building out my applications (for re-usability and simplicity). I am coding ...
8
votes
1answer
630 views

Bitex - Cryptocurrency Exchange API Framework for Python

BitEx is a Python module I've been working on for a little over 9 months now, as a side project. It was published 6 months ago on GitHub, and as I edge closer to my 1.0 release, I wanted to take the ...
3
votes
0answers
76 views

Simple JavaScript module to manipulate CSS

After posting some of this code on Stack Overflow I was told to have a look here and get some feedback. I am having fun building a light JavaScript framework and have copied this pattern. It works ...
0
votes
1answer
69 views

Ad-hoc analytics script to module/package

I have a text analytics process that I complete for work. This process mines text for different Twitter accounts and finds patterns in the tweets. The actual machine learning pipeline is much more ...
1
vote
0answers
58 views

Library to mimic canvas using divs

I was recently developing some canvas library and (mimicking canvas using div). The requirement was to develop something without using any third-party library. The sample app had a asset library and ...
3
votes
0answers
125 views

Read in file, Filter out records, output results

I have been working on a project for some time and have let one Python file grow into a huge file that tries to do everything. The structure is pretty flat and I don't like it. I've used other ...
1
vote
0answers
1k views

Dynamically loading and naming controllers in nodejs and express

I'm trying to write a module to dynamically load all the files from my "controllers" folder, and then add them to the main express instance as routers. The files inside the controllers export an ...
3
votes
1answer
75 views

jQuery module to edit HTML elements

I need to turn a lot of html elements as editable elements. You will double click on the element to edit, press enter to validate (send a PUT to the RESTapi), press esc to undo. I've written this ...
1
vote
0answers
27 views

Simple ES6 JavaScript Module “Loader” (semi follow-up)

I have recently updated my JavaScript Module "Loader" to ES6 and would like some feedback on the code and how "ES6-y" it is. I previously asked about the ES5 version of my code here and I have ...
7
votes
1answer
51 views

Python App that parses file for lines that match a format

I recently wrote some code that was dinged on not having well defined tests and poor modularity. Was hoping someone could review my code and give me pointers on how to create more well-defined tests (...
3
votes
1answer
64 views

Simple JavaScript Module “Loader”

I have written a simple JS module "loader" (loader is in quotes because it doesn't actually load the files) that is designed to resolve simple dependencies between modules. It is heavily inspired by ...
1
vote
0answers
42 views

Modular widget that minimizes js and css scope pollution

So, my goal with this is to create a simple login widget that does as close to nothing to the global scope as possible. The login mechanism is less important than the encapsulation. The whole script ...
1
vote
0answers
95 views

Dynamically call a function in a given module

I use the following code that is working as expected and I want to get some feedback from the community how I can Improve it... The code does the following: Get Some request with specific action ...
2
votes
0answers
116 views

jQuery form change listener, modularized using ES6

I have the following javascript code that I'm trying to modularize using ES6: ...
2
votes
0answers
443 views

Perl switch/case module

I know Perl now has given and when to simulate switch/case statements, but these are still experimental and are not guaranteed ...
2
votes
1answer
25 views

Draggable toolbar header class, inheriting from a draggable parent class

I have written a draggable parent class using a module pattern: ...
6
votes
1answer
98 views

Extendable JavaScript module that converts between camelCase, PascalCase, and underscore_case

The basic idea is that by defining three functions--recognize, dissect, and combine--...
4
votes
3answers
131 views

Status display module

I've developed a template to modularize JavaScript code I write for client work. The example below is a simple class with 1 attribute and 3 functions. Rationale: Standardized constructor to add or ...
1
vote
1answer
75 views

Making a news widget webpage

I have finished the assignment but would love some feedback. Data.json contains news articles data. Requirements for assignment: Fetch the data and render it on the page. Initially the page ...