New series of tutorials are coming soon

wpid-python-logo-master-v3-TM-2012-02-27-23-33.png

Hello people. I’m preparing a new series of tutorials. You might ask yourself why do I need another series of tutorials when there is already whole bunch of these on web.
The answer on this question is really simple. Many of these tutorials show you basics of the language, but not many of them show you how to put your skills in good use.

I decided to do this from 2 reasons. I’m not a good writer, but I have a lot of practical knowledge that I’d like to share with others. And second one is because I want to refresh my own knowledge and be in shape again.

Continue reading

Arch Linux part 1

When I started with Linux it was back in 2003. My very fist system was SuSe (OpenSuSE now). After that I changed many distros from RedHat to Ubuntu, I decided to give a try to Arch linux.

 

According to their website it’s lightweight Linux distro, and I’m going to give it a try and see how it behaves. I hope that I won’t be disappointed.

Arch Linux is an independently developed i686 and x86_64 optimized Linux distribution that was originally based on ideas from CRUX.
Development is focused on a balance of simplicity, elegance, code-correctness and bleeding edge software.
Its lightweight and simple design makes it easy to extend and mold into whatever kind of system you’re building.

Courtesy of Archlinux Wiki

Continue reading

C programming on the OS X

Have you tried programming on the OS X using the C programming tutorials made for Windows?
One thing that you might have noticed is that many C instructors are counting the fflush() function as a part of the ANSI C standard.

In reality things work slightly different.

If you try to compile following code on the OS X (Linux or any *NIX might give you different output depending on the GCC setting).

  1. #include <stdio.h>
  2. #include <string.h>
  3. int main(int argc[], char *argv[])
  4. {
  5. char firstName[20];
  6. char lastName[20];
  7. char fullName[41];
  8. printf("Enter your name: ");
  9. scanf("%[^\n]s", firstName);
  10. // following line work on Windows only so uncomment if you use windows
  11. //fflush(stdin);
  12. // for some reason fflush doesn't work on OS X as it does on Windows
  13. fpurge(stdin); // use this on POSIX standard machines or comment out if you use Windows
  14. printf("Enter your surname: ");
  15. scanf("%[^\n]s", lastName);
  16. /* The following 3 statements are doing the following thing:
  17. Append name to fullName array and concatenate it with 1 space and lastName variables.
  18. It's ready for later printing.
  19.  */
  20. strcpy(fullName, firstName);
  21. strcat(fullName, " ");
  22. strcat(fullName, lastName);
  23. // I'm using (int)strlen(fullName) casting here to convert size_t parameter to int while printing
  24. printf("Your name is %s, and the length of the array is %d\n", fullName, (int)strlen(fullName));
  25. fpurge(stdin); // you can use fflush(stdin) if you prefer, but it's Windows only function
  26. return 0;
  27. }

More stuff soon ;)