Marcelo Toledo

startups, empreendedorismo e tecnologia

2008

Printing the binary value of an integer

You can printf an integer in many forms, including decimal, octal or hexadecimal. What about binary? This is not the first time someone asks me this, so I’ll just post it here: > ./dec2bin 3 3 -> 00000000000000000000000000000011 > ./dec2bin 4 4 -> 00000000000000000000000000000100 > ./dec2bin 5 5 -> 00000000000000000000000000000101 > ./dec2bin 6 6 -> 00000000000000000000000000000110 > ./dec2bin 7 7 -> 00000000000000000000000000000111 A simple solution could be the function below, note that it is limited to 32 bits: static char *dec2bin(int dec) { char *str, *ret; int i; const int bits = 32;   ret = str = malloc(bits); memset(str,…

Openning big files in OpenOffice Spreadsheet

When your files are too big, OpenOffice Spreadsheet will ignore anything after line 65536, my suggestion is, split it in other tabs: marcelo@yogananda:~/Desktop$ wc -l foo-2008-04.csv 73538 foo-2008-04.csv marcelo@yogananda:~/Desktop$ split foo-2008-04.csv -l 37000 foo marcelo@yogananda:~/Desktop$ ls foo* foo-2008-04.csv fooaa fooab marcelo@yogananda:~/Desktop$ wc -l fooa* 37000 fooaa 36538 fooab 73538 total After this, Insert -> Sheet From File…

Problems to solve with software

My uncle is a person that likes to use technology, he has always the newest computer, television, sound system, etc. I suppose that he has a good camera also, since I’ve just received by email five photos from him, the only problem is that each picture has almost 12MB. Naturally he will share his images with friends and family, the expected result is for everyone to see the images, so it doesn’t need to be that big, as a user of technology he doesn’t need to know that. We see a clear situation where hardware evolves much faster then software,…

Linux 0.01

marcelo@yogananda:~/Desktop/storage/projects/linux-0.01$ ls boot fs include init kernel lib Makefile mm tools   marcelo@yogananda:~/Desktop/storage/projects/linux-0.01$ du -sh . 512K . marcelo@yogananda:~/Desktop/storage/projects/linux-0.01$ ls * Makefile   boot: boot.s head.s   fs: bitmap.c buffer.c exec.c file_dev.c inode.c Makefile open.c read_write.c super.c tty_ioctl.c block_dev.c char_dev.c fcntl.c file_table.c ioctl.c namei.c pipe.c stat.c truncate.c   include: a.out.h asm const.h ctype.h errno.h fcntl.h linux signal.h stdarg.h stddef.h string.h sys termios.h time.h unistd.h utime.h   init: main.c   kernel: asm.s exit.c hd.c Makefile panic.c rs_io.s serial.c system_call.s tty_io.c console.c fork.c keyboard.s mktime.c printk.c sched.c sys.c traps.c vsprintf.c   lib: close.c ctype.c dup.c errno.c execve.c _exit.c Makefile open.c setsid.c string.c…

Essential Linux Device Drivers

I was searching around amazon to see new titles and for my surprise there was this brand new book, Essential Linux Device Drivers, dated April/2008, ~750 pages, like my older post, Linux Kernel Development, and my suggestion never posted, Linux Device Drivers, will give you the best tools around to understand and work in Linux, now continuing with the description: “Probably the most wide ranging and complete Linux device driver book I’ve read.” –Alan Cox, Linux Guru and Key Kernel Developer “Very comprehensive and detailed, covering almost every single Linux device driver type.” –Theodore Ts’o, First Linux Kernel Developer in…

  1. Páginas
  2. 1
  3. ...
  4. 8
  5. 9
  6. 10
  7. ...
  8. 16