Why adding people to a late software project makes it later?

That statement is known as Brooks’s Law, and it was coined by the renowned computer scientist and software engineer Frederick P. Brooks. Concretely, the original statement found in his 1975 classic The Mythical Man-Month is “adding manpower to a late software project makes it later”. Basically, the idea is that adding more analysts, designers or programmers to a project running behind the original schedule will delay it even more.

Broadly speaking, the rationale of Brooks’s law is related to knowledge management. First, when new personnel is added to the project, some resources have to be diverted into training or informing the newcomers about the project’s status, vision and philosophy. That will delay the project. Further, when the number of people participating in a project increases, so does the number of communication paths. Thereby, more resources (including time) are required in order to distribute the information. Regarding this point, you may be interested in reading my entry on “Knowledge Sharing” in Software Design, Trials and Errors.

An E(x)tern Newbie Question

I want to know how to declare a const variable in one file and access it from other files? (C++). It’s a fairly basic question, and reveals that you have to study more C++. What you want is to define a const variable at global scope. Unlike non-const variables (which are extern by default), const variables are local to the file in which they are defined. Therefore, you cannot access them from other files unless you specify that the variable is extern. For instance, if you specify extern when defining the variable

bufferSize in file1.ccextern const int bufferSize = 512;

you can access bufferSize from any other file, say, file2.cc

extern const int bufferSize; // we are using bufferSize from file1.cc

And that’s it.

Reentrant Routine

A routine or procedure P is reentrant (or pure code) if it can be “re-entered” after it is already in execution. Basically, it means that P can be executed two or more times simultaneously, or alternatively, that P can be safely executed concurrently. There are some conditions P must follow in order to be reentrant, and we may check them in the Wikipedia entry for reentrant functions.

Some programs necessarily have to be reentrant. For instance, device drivers. A device driver has to be reentrant because another interrupt may be raised while the driver is running. This means that reentrancy allows for code sharing. For example, if a program consists of 600 KB of code and 200 KB of data, and n users are simultaneously using the program, we would require n x 600 KB of physical memory for the code if the program is not reentrant. But if the code is reentrant we can share it among the n users, saving a lot of memory.

Calculus of resonances in an uniform acoustic tube

We assume that the glottal end is closed, but the mouth is open. This is the configuration we are referring to:

The acoustic tube is uniform, and its length is L. The glottis, located at x=-L, is closed (infinite impedance) and the mouth, located at x=0, is open (impedance zero). Now, pressure variation p(x) along this uniform acoustic tube is expressed as:

$latex \frac{d^2p}{dx^2} + \left(\frac{2\pi f}{c}\right)^2p = 0 ~~(I)$

where f represents frequency in Hz, and c is the speed of sound: $latex 3.53 \times 10^4 cm/s$ at 37° C.

According to the boundary conditions (the impedances at both ends), the solution is:

$latex p(x) = P_m \sin{\frac{2\pi f}{c}x} ~~(II)$

where $latex P_m$ is the peak in sound pressure. On the other hand, we have a relation between pressure and volume velocity

$latex \frac{dp}{dx} = -\frac{j2\pi f \rho}{A}U ~~(III)$

$latex A$ is a constant representing the tube’s area. Now, volume velocity can be expressed as

$latex U(x) = jP_m \frac{A}{\rho c} \cos{\frac{2\pi f}{c}x} ~~(IV)$

where $latex \rho$ equals the average atmospheric density ($latex 1.14 \times 10^{-3} gm / cm ^ 3$ at 37°C).

As U(−L) = 0, resonances Fn of the acoustic tube are

$latex Fn = \frac{2n – 1}{4}\frac{c}{L} ~~(V)$

where n=1, 2, 3… And that’s it. We can see that the area function does not affect the location of resonances. Finally, remember that, in average, the male oral tract has a length of 16.9 cm, and the female tract has an average length of 14.1 cm.

The Nightmare before Christmas

Improbable que unos días antes de Navidad se encuentre usted inmerso en los ajustes finales de un salvapantallas (protector de pantallas/screensaver). Su salvapantallas utiliza OpenGL para el renderizado, y corre en Windows. Flujos lógicos perfectamente sincronizados, compiladores felices, arte gráfico hermoso. Prueba A superada. Prueba B superada. El problema apareció en la prueba N. En específico, que su salvapantallas funcionó perfectamente en todas las máquinas, menos en aquella laptop con gráficos Intel. En esa máquina, triste e inexplicablemente, su salvapantallas no dispone de aceleración 3D. La máquina es capaz de aceleración 3D -mil veces comprobado-, y sin embargo, su lindo salvapantallas no puede aprovechar dicha aceleración. En esa laptop, su salvapantallas se ejecuta con una lentitud intolerable, parece un aborto en software. ¿Por qué todos los otros programas corren con aceleración 3D en esa laptop, pero su salvapantallas no? ¿Por qué? ¿Razones esotéricas? Después de todo, a nivel de ejecución, un salvapantallas es simplemente un ejecutable con extensión “scr” (obviemos, por innecesarios, los detalles sobre el procesamiento de la línea de comandos, el enlace con scrnsave.lib -si elige esa vía-, y algún otro escarmiento propio de los salvapantallas). Deseo que no pierda vitales minutos de su vida prisionero de dicha pesadilla. La razón -o sinrazón- del fiasco está aquí. Si observamos con cuidado, la única diferencia entre su salvapantallas y el resto de ejecutables que sí reciben aceleración 3D es la extensión del archivo. Alguien, en alguna parte del sistema, está detectando la extensión “scr” de nuestra aplicación y le niega la aceleración 3D. Bueno, cambie la extensión. En vez de “scr”, use “sCr” o algo así. Parece tonto -y lo es- pero funciona. De nada.

Stub

What’s a stub? It obviously depends on the context. A Stub may even be a relative of the Danish poet Ambrosius Stub. After all, code is poetry.

In computing, I know of 4 contexts where the word stub has a well-established meaning:

  1. Web Sites: A stub is a web page in progress, i.e., a page which provides minimal information and is intended for later development. For instance, a Wikipedia stub is a short article in need of expansion.
  2. Coding: During development, we sometimes use a “skeleton” function (or procedure, or method) to simulate some intended (but not yet implemented) functionality. For instance, the function may stand in for a complex algorithm to be developed later, or simulate a procedure running on a remote host. Such placeholder function is called a stub function. Stub functions come in handy for quick prototyping and testing.
  3. Distributed Systems: In distributed systems, a service interface defines the services available to programs. These services are distributed among several networked machines. In distributed systems, a program in machine A may request a service by calling a procedure. However, the procedure may be offered by a remote host, say, machine B. Remote Procedure Calls (RPC) are a paradigm of distributed systems aimed at abstracting the communication between hosts in a network. The goal of RPCs is to hide the details of the remote call. The remote call should look like a local one, i.e., the program in machine A would invoke the procedure in machine B as it would invoke a procedure locally. Under the hood, though, it’s obvious that we have to transmit information from the client (caller) to the server (callee), and in the other direction. Now, how to hide the fact that we are calling a procedure located in other machine? This is the basic idea of RPCs:
    • In the address space of the client, we represent the server procedure by means of a local procedure called client stub. Likewise, the server is also linked to a server stub, which will receive the message from the client stub.
    • When machine A requests a service which is provided by machine B, a call is made to the client stub (which has the same name as the procedure in B). As the client stub lies in the same address space of the caller, the invocation is handled locally, and the program sees this invocation as a local one. However, the client stub marshalls the received parameters and sends them, throught the network, to the server stub. In turn, the server stub unmarshalls the parameters and perform the call to the real procedure in the server. When the server procedure finishes, results or exception data travels back, from server to client. By the way, marshalling is the process of taking a collection of data items (such as the procedure name and its arguments) and grouping them according to some predefined representation, suitable for transmission over the network. The server should know and conform to this representation in order to unmarshall the received data and recover the transmitted information.

    Albeit conceptually simple, there are some interesting (nasty) problems for implementing RPCs, such as passing pointer arguments (remember that client and server have different address spaces).

  4. Computer Networking: A stub network is a network or part of network with only one communication path to external networks (non-local hosts). For instance, if we connect to our Internet Service Provider using only one router, our local network is a stub network with respect to our provider.

There is other related context for stubs: in electronics, we identify Stub sections, which are mostly used for impedance matching in transmission lines. But I’m not too familiar with this “stub” meaning.

Onetti

Desde entonces no he parado de leer a Onetti: en cerca de veinte años ésa es una de las pocas cosas que no han cambiado en mi vida. Han dejado de gustarme la mayor parte de los libros que me apasionaban y he perdido, afortunadamente, casi todos los entusiasmos políticos que me idiotizaban entonces, detesto casi todas las películas que veneraba en aquellos años, he cambiado de amigos, de ciudades, de trabajos y de lealtades sentimentales, así que uno de los pocos rasgos que me unen a quien fui y ya no soy es la lectura de Juan Carlos Onetti, y casi la única cosa que me sigue acompañando de todas las que poseía en los tiempos en que empecé a leerlo es ese ejemplar de sus Cuentos Completos que adquirí en el Círculo de Lectores: un libro de tapas negras, de letra muy pequeña y de hojas que se van volviendo amarillas, firmado y fechado en la primera página con aquella ambición de propiedad con que uno atesoraba entonces los pocos libros que podía comprarse, en un tiempo que visto ahora casi parece otra época: diciembre, 1975.

Antonio Muñoz Molina (Sueños realizados: invitación a los relatos de Juan Carlos Onetti, Prólogo del volumen “Onetti, Cuentos Completos”)