Skip to main content

Posts

Mystery program

This program is system-dependent, it will run correctly on many different systems. Try it on your machine. #if (VAX || PC)         #define HEX0 0x6c6c6548         #define HEX1 0x77202c6f         #define HEX2 0x646c726f         #define HEX3 0x00000a21 #else         #define HEX0 0x48656c6c         #define HEX1 0x6f2c2077         #define HEX2 0x6f726c64         #define HEX3 0x210a0000 #endif typedef union {         char what[16];         long cipher[4]; } mystery; int main(void) {         mystery x;         x.c...

List application

To illustrate the use of those functions, here is an example. #include <stdio.h> #include <stdlib.h> #include "list.h" LINK string_to_list(char []); void print_list(LINK); int count_rec(LINK); int main(void) {         LINK h;         h = string_to_list("ABC");         printf("The resulting list is\n");         print_list(h);         printf("\nThis list has %d elements.\n", count_rec(h));         return 0; } The output of the program is The resulting list is A --> B --> C --> NULL This list has 3 elements.

Printing a list using recursion

This is a function for displaying a list. Oh I just love recursion. void print_list(LINK head) {         if (head == NULL)                 printf("NULL");         else {                 printf("%c --> ", head -> d;                 print_list(head -> next);         } }

Pro guns

It is indeed true that my passion for guns already existed long before I came to this chaotic world. Guns are the most outstanding weaponry ever in the history of man. Let me give you some facts about my preferred gun as of the moment. Avtomat Kalashnikov 47 (AK-47) Country: Soviet Union/Russian Federation Type: Assault Rifle Inventor: Mikhail Kalashnikov Year of design: 1947 Service duration: 1951-Present Cartridge: 7.62 mm X 39 Action: Gas-Operated rotating bolt Rate of fire: 600 rpm Muzzle velocity: 710 m/s Effective rage: 300 m Weight: 4.3 kg (unloaded) Length: 870 mm Barrel: 415 mm Magazine Cap.: 30 Viewing sights: Adjustable iron sights, optional mount required for optical scope Variants: AK-47, AKS, AKM, AKMS, AK-74, AK-101, AK-103 Number built: More than 1 million excluding unlicense...

Counting a list iteratively

This is a simple way of counting elements in a list. For some, they would prefer to embed this operation upon list creation and insertion or deletion. int count_it(LINK head) {         int cnt = 0;         for ( ; head != NULL; head = head -> next)                 ++cnt;         return cnt; }

What lies inside

There are things in life that are inevitable and I am powerless to control them. The sun will rise and set, the tide will come in and go out, the seasons will change, friends walk in and out, and the caterpillar will soon turn into a beautiful butterfly. Somehow, I feel reassured by this because many other things in life are so transient - so momentary. I can’t imagine life without knowing you. For without you, my life would be empty of all inspiration. There will be no work of art for me to gaze at; no person of greatness before me; no timeless melody to listen to. My life will exist in shades of gray instead of vibrant colors, and I will be less than whole. The proper words have escaped me, and my innermost feelings have been locked away in the depths of my heart. I wish I could say these to you in person while gazing into your eyes. I cherish any thought of you, prize any memory of you that rises from the depths of my mind, and live for the day when our eyes meet.