Questions tagged [modular]

347 questions
60
votes
2 answers

How can I create C header files

I want to be able to create a collection of functions in a header file that I could #include in one of my C Programs.
user340838
  • 657
  • 1
  • 6
  • 3
49
votes
3 answers

Fast n choose k mod p for large n?

What I mean by "large n" is something in the millions. p is prime. I've tried http://apps.topcoder.com/wiki/display/tc/SRM+467 But the function seems to be incorrect (I tested it with 144 choose 6 mod 5 and it gives me 0 when it should give me…
John Smith
  • 11,678
  • 17
  • 46
  • 51
31
votes
2 answers

Compile multiple C files with make

(I am running Linux Ubuntu 9.10, so the extension for an executable is executablefile.out) I am just getting into modular programming (programming with multiple files) in C and I want to know how to compile multiple files in a single makefile. For…
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
26
votes
3 answers

How to create a modular JSF 2.0 application?

I have an application with a well defined interface. It uses CDI for resolution of the modules, (Specifically it uses Instance<> injection points on API interfaces to resolve modules) and passes various data back and fourth via the interfaces…
SplinterReality
  • 3,400
  • 1
  • 23
  • 45
20
votes
4 answers

Why is −1 > sizeof(int)?

Consider the following code: template class StaticAssert; template<> class StaticAssert {}; StaticAssert< (-1 < sizeof(int)) > xyz1; // Compile error StaticAssert< (-1 > sizeof(int)) > xyz2; // OK Why is -1 > sizeof(int) true? Is it…
Alexey Malistov
  • 26,407
  • 13
  • 68
  • 88
16
votes
8 answers

Modular addition in python

I want to add a number y to x, but have x wrap around to remain between zero and 48. Note y could be negative but will never have a magnitude greater than 48. Is there a better way of doing this than: x = x + y if x >= 48: x = x - 48 elif x <…
Double AA
  • 5,759
  • 16
  • 44
  • 56
14
votes
4 answers

"Modular" Scala guidelines

Recently I've become confused how to organize my Scala code, because there are a lot of options. Are there any guidelines for Scala how/when to use packages, objects, package objects for organizing code?
Zdenek F
  • 1,649
  • 1
  • 15
  • 27
12
votes
1 answer

Working with zend framework and git in large projects

I'm having some problems working with zf and git in a pretty large project. The zf application has about 20 modules and for the moment everything is stored in a single git repository. So when you checkout the application, you checkout the entire set…
Alex Dicianu
  • 369
  • 1
  • 3
  • 9
11
votes
3 answers

Dummy data and unit testing strategies in a modular application stack

How do you manage dummy data used for tests? Keep them with their respective entities? In a separate test project? Load them with a Serializer from external resources? Or just recreate them wherever needed? We have an application stack with several…
Pete
  • 10,720
  • 25
  • 94
  • 139
11
votes
6 answers

Is it possible to get the original value of a number, after several multiplications **with overflow**?

Summary: Is there a way to do that? Here's what I mean: suppose I have an unsigned int number. Then I multiply it several times(and there's overflow, which is expected). Then is it possible to "revert" the original value back? In details: It's all…
Kiril Kirov
  • 37,467
  • 22
  • 115
  • 187
11
votes
7 answers

Modular JavaScript - are there any approaches apart CommonJS and AMD to consider?

I'm currently preparing an evaluation JavaScript modularization approaches for my corp. We are in process of defining "JavaScript Best Practices" for our projects, modularization is one of the central questions. From my research so far revealed two…
lexicore
  • 42,748
  • 17
  • 132
  • 221
10
votes
2 answers

Modular web application with Spring and Maven

I'm trying to design the architecture of a medium-sized web application in Java and I would like to get some advice on how to do it. The project consists on a base website plus a number of modules. For instance, one module would provide user…
user683887
  • 1,260
  • 1
  • 10
  • 20
10
votes
2 answers

How do I access module variables using requireJS?

I have been using Javascript for a while and I have just tried using modules and requireJS for the first time and its hard to get my head around new design patterns! Here is my first attempt: require([ "jquery", "testModule" ], function ($,…
user759885
9
votes
2 answers

Modular Arithmetic using Haskell Type-Families or GADTs?

I frequently have occasion to perform modular arithmetic in Haskell, where the modulus is usually large and often prime (like 2000000011). Currently, I just use functions like (modAdd m a b), (modMul m a b), (modDiv m a b) etc. But that is rather…
CarlEdman
  • 398
  • 2
  • 14
8
votes
1 answer

How to implement a Modular Architecture with symfony4

I would like to follow the recommendations of this article from Sander Mak, which advocates using a traditional Monolithic Architecture making use of modules instead of Microservices which are not a good choice in many cases…
Erwan Rouzel
  • 81
  • 1
  • 2
1
2 3
23 24