A logical subdivision of a larger, more complex system.
10
votes
1answer
394 views
Minimal Python plugin mechanism
Is there a better way to have a minimal Python plugin mechanism than the following?
(This was inspired from this post.)
...
7
votes
1answer
168 views
Loading and Using Lua Scripts
I have been experimenting with integrating Lua into Objective-C. I have tried to do the bare minimum to get Lua to compute values and return them. I did not want to use any external libraries so I ...
6
votes
2answers
84 views
Planning a rather large refactoring of physics code in a good way?
I have a large file that I want to refactor. My idea is to make helper classes with helper methods so that I can modularize methods.
Is that a good idea? For instance before refactoring:
...
6
votes
1answer
627 views
Improvements to an Angular ScrollSpy module
Things that I'm not sure about:
Whether this works in all use cases - alongside routing and within templates etc
Am I polluting the scope with all these variables? This seems to be the easiest way ...
5
votes
2answers
7k views
Exporting routes in node.js Express 4
I'm using Express 4 to provide routes to HTML/Jade files, and as well to provide an API.
I want to separate routes from server file, and go even further- separate API from WWW. My code now looks like ...
5
votes
1answer
1k views
Avoiding RequireJS circular dependencies
My app module bootstraps a Backbone.js application.
I need app to be available in every other view for easy access to router, ...
5
votes
1answer
58 views
Module representing rational numbers
Taking inspiration from SICP Exercise 2.1, I decided to implement a module in Haskell for rational numbers.
Some of my concerns include:
Is this idiomatic Haskell?
Besides ...
5
votes
1answer
156 views
Minimal but complete AMD implementation
I've got a minimal implementation (under 2k minified) of the Asynchronous Module Definition API. So far it handles all of the required stuff (I think; it passes the relevant unit tests, anyway), and ...
4
votes
1answer
630 views
Monitor filesystem for continuous integration and build
I've written a simple Python module that depends on watchdog to monitor for modified files, then runs various integration and build processes.
I'm fairly new to Python, so I'd appreciate all ...
4
votes
1answer
102 views
Merging with different modules
We have an action merge for two projects. In the projects we have different modules like Feed, Files, Post etc....
...
4
votes
1answer
189 views
Loading 'Plugins' in Ruby
I have written a plugin loader in Ruby, and I would like to know if it uses the best technique to handle classes, or if anyone has any recommendations on how to improve my code.
I have written a ...
4
votes
1answer
60 views
Strategy to reduce duplicate code in many similar modules
The Situation
I have created some code in the form of modules that each represent a medical questionnaire (I'm calling them Catalogs). Each different questionnaire ...
4
votes
1answer
1k views
How are my javascript module pattern and promise pattern?
I'm working on an app that downloads some SVG paths from a server and draws them.
Anything in here is open to critique, but specifically I'd like to review my use of a module pattern and my ...
3
votes
4answers
139 views
A package for sort algorithms
I'm trying to learn basic algorithms which are typically taught in an introduction to CS course, which is usually taught in a compiled language like Java. However, I want to focus on JavaScript, so I ...
3
votes
2answers
98 views
List all classes in a package directory
I have a package directory pkg with several classes that I would like to build into a convenient dict property.
The structure ...
3
votes
4answers
273 views
What is the shortest snippet that emulates `include` in JavaScript without third-party scripts?
JavaScript doesn't offer a module system. There are many third-party solutions, like require.js or jQuery's $.getScript. Most, ...
3
votes
1answer
46 views
Return path to rubygems.rb
From the command line, I can easily find the path to rubygems.rb
$ gem which rubygems
/usr/lib/ruby/1.9.1/rubygems.rb
and ...
3
votes
1answer
136 views
Decoupling with a self-descriptive mediator function
I don't have a lot of experience writing libraries and just recently started thinking a lot about structure and patterns.
I wrote a tiny module manager based on the facade and mediator design ...
3
votes
1answer
211 views
Correctly dealing with closures and modularity in Javascript
The code below is designed to deal with this situation:
There is a Battle environment with Characters; these Characters obviously have certain characteristics and abilities, and they need to be ...
3
votes
1answer
122 views
JavaScript templating language: ivy-markup
This library is a markup parser which is intended to be used in node.js and browser environment. I've decided to use Jasmine for tests.
The library's name is ivy-markup. URL: ...
3
votes
1answer
229 views
Suggestions on view-specific (MVC) custom JS/jQuery design
In my job I write a lot of small JS/jQuery "snippets" for changing the default behaviour in the base product according to what the customer wants.
I tend to organize it so that I have one ...
3
votes
0answers
48 views
Project Euler module
I use Project Euler to teach me programming and not to submit any results. As such I look up the expected return values to double check my solutions.
To organise my files I use the following folder ...
2
votes
2answers
170 views
Finding correct format? Arrays and Modulation
I am fairly new to programming and I am having difficulty modulating the following code.
The program reads a file, selects certain requirements, and displays them. I have tried to use passing arrays ...
2
votes
1answer
51 views
Custom module of common functions
I got sick and tired of writing certain functions over and over again, so I made a module that has those functions whenever I need them. I don't use it for code I plan on sharing, so I don't need to ...
2
votes
2answers
193 views
Criticize my first Python module please
This is a Python module I have just finished writing which I plan to use at project Euler. Please let me know how I have done and what I could do to improve it.
...
2
votes
1answer
72 views
Switching from functional jQuery code to object-oriented
I've been happily using jQuery, creating vars and binding events in my modules (which have only a little bit of JS). But recently I needed to add an anonymous functions to my code and after ...
2
votes
1answer
734 views
JavaScript Node - Private Module Functions
To learn the language of JavaScript, I did a dojo exercise by Roy Osherove. Is there a better way to organize this so that the only method exported is add while ...
2
votes
1answer
2k views
JavaScript modules loading with eval()
I recently asked to use eval() for a module function. Now I ended up doing a very weird function which does what I want. I like the idea I made it but I'm not so ...
2
votes
0answers
68 views
Binary Index tree optimization
I have written code for binary index tree. My problem is there are many functions based on the binary index tree the function stores the sum of element within a given range of binary index tree and my ...
2
votes
0answers
32 views
Injecting required functions by synchronous script loading
I have a file HintBox.js containing a JS prototype of the same name which requires our internal JS library (call it $lib) in ...
2
votes
0answers
87 views
Implement.js JavaScript module pattern
I have been playing with a new JavaScript module pattern to see what I can come up with. I think it's quite powerful and wanted to know if it is something people would find useful?
I'm looking for ...
2
votes
0answers
87 views
Javascript slider module and extending it further
i created this module, and i'm wondering if i did a good job. How would an experienced javascript developer improve this simple slider module further? Like, let's say that you want to use this module ...
1
vote
1answer
21 views
Categorizing utilities into modules [closed]
I have two classes in my program, the one is PropertiesUtils and the other one FileUtils.
This is the general structure of ...
1
vote
1answer
78 views
1
vote
1answer
126 views
Javascript code pattern
I have been working on a javascript heavy project. There are sales, purchases, reports etc. What I've done is created a separate module for each i.e. a separate module for each i.e. a separate one for ...
1
vote
1answer
142 views
Mixin both instance and class methods in Ruby
I have a Ruby class into which I want to include both class and instance methods. Following the pattern described in "Ruby Pattern: Extend through Include", I'm currently using the following:
...
1
vote
1answer
101 views
Am I using the JavaScript “module pattern” correctly?
I am reading this article about how you can organize JavaScript code for large projects.
I am attempting to write a simple events calendar as a way to play with some of these design patterns.
Using ...
1
vote
0answers
39 views
Listing an optional Python dependency in setup.py
I have a small project that requires a third-party module that's rarely updated (once every other year or so) and not maintained by any package management system. The context, here, is cognitive ...
0
votes
2answers
536 views
A flexible Ruby Observable module
I was learning a bit about about observers. Ruby has an Observable module, but I decided to make my own with a few tweaks.
The first important feature is that this ...