This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
||| fib( 0 ): 0 | |
||| fib( 1 ): 1 | |
||| fib( 2 ): 1 | |
||| fib( 3 ): 2 | |
||| fib( 4 ): 3 | |
||| fib( 5 ): 5 | |
||| fib( 6 ): 8 | |
||| fib( 7 ): 13 | |
||| fib( 8 ): 21 | |
||| fib( 9 ): 34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
||| fib( 0 ): 0 | |
||| fib( 1 ): 1 | |
||| fib( 2 ): 1 | |
||| fib( 3 ): 2 | |
||| fib( 4 ): 3 | |
||| fib( 5 ): 5 | |
||| fib( 6 ): 8 | |
||| fib( 7 ): 13 | |
--- fib( 0 ): 0 | |
||| fib( 8 ): 21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kvs := map[string]string{"a": "apple", "b": "banana"} | |
for k, v := range kvs { | |
fmt.Printf("%s -> %s\n", k, v) // If I press Enter here | |
// <-- The cursor jumps here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Configuration file for vim | |
set modelines=0 " CVE-2007-2438 | |
" Normally we use vim-extensions. If you want true vi-compatibility | |
" remove change the following statements | |
set nocompatible " Use Vim defaults instead of 100% vi compatibility | |
set backspace=2 " more powerful backspacing | |
" Don't write backup file if vim is being called by "crontab -e" | |
au BufWrite /private/tmp/crontab.* set nowritebackup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Bevarde; | |
type Taskas3D = record | |
X:real; | |
Y:real; | |
Z:real; | |
end; | |
type atkarpa = record | |
Taskas1: ^Taskas3D; | |
Taskas2: ^Taskas3D; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
struct Point { | |
int x; | |
int y; | |
int z; | |
}; | |
struct Segment { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <limits.h> | |
#include <stdio.h> | |
int main(void) { | |
int value = -1; | |
printf("UINT_MAX: %u\n", UINT_MAX); | |
printf("value: %d\n", value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
unsigned intToBinaryInt(unsigned k, int *components, int counter) { | |
// k - current binary component | |
// components - collection of all the components | |
// counter - tracks how many components are there | |
if (k == 0) { | |
components[counter] = k; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int data[4], // Allocates an array of type int with 4 elements | |
i; // Allocates an int | |
for(i = -8; // Initializes i to -8 | |
i < 10; | |
i++) // Increments i by 1 | |
printf("%d\n", data[i]);// This will generate an error when i is in [-8, 0)u(3, 9] | |
// This ^ will iterate over the following values | |
// -8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int *first, // Allocates a pointer to int | |
a; // Allocates an int | |
for ( a = 0; // Initializes a to 0 | |
a < 10; | |
a++ // Increments a value by 1 | |
) { | |
first[a] = 5; | |
} |