Arquivos Mensais: Novembro 2009

How to check the size allocated by malloc

#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char ** argv)
{
for(int i = 1; i < 1000; i++)
{
size_t *p = (size_t *) malloc(i * sizeof(size_t));
printf(“%zu = %d * %zu\n”, *(p – 1), i * [...]

How to correct Emacs23 minibuffer in XMonad

In XMonad, when I start Emacs23, the minibuffer is very big:

To correct it to use just one line, you must split the window vertically with another window:

Then, when you make Emacs full screen again, the minibuffer will use only one line.

Using when with multiple files

when is a very nice perl program to keep track of appointments. I wanted to use more than one file as the input of when, so I made this make script:

#!/usr/bin/make -f
calendar = $(HOME)/.when/calendar
.PHONY: all
all: $(calendar)
when –nopaging
$(calendar): $(wildcard $(HOME)/.when/calendars/*.when)
cat $^ > $@