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<byteswap.h> | |
#include<stdio.h> | |
int main(int argc, char** argv) { | |
if (argc != 2) return 1; | |
FILE* ptr = fopen(argv[1], "rb"); | |
unsigned int num; | |
while(fread(&num, sizeof(int), 1, ptr) != 0) { | |
printf("%d\n", bswap_32(num)); | |
} |
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
import cats.data.OptionT | |
import cats.implicits._ | |
import java.util.Date | |
object MonadTrans { | |
val person1 = Person(None, new Date()) | |
var person2 = Person(Some(person1), new Date()) | |
var person3 = Person(None, new Date()) | |
var person4 = Person(Some(person3), new Date()) |
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
#define debug_print(fmt, ...) \ | |
do { if (DEBUG) fprintf(stdout, "%s:%d:%s(): " fmt, __FILE__, \ | |
__LINE__, __func__, ##__VA_ARGS__); } while (0) |
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
open Array | |
let latarnie l droga = | |
let arr = copy (of_list l) in | |
sort compare arr; | |
let n = length arr in | |
let przecina (x1, x2) (y1, y2) = x2 >= y1 in | |
let ilosc = ref 0 in | |
let najdalej start = | |
let i = ref (start + 1) in | |
let wynik = ref (-1) in |
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
//Wypisz rezultat działania poniższych | |
//fragmentów programów: | |
//2.1 | |
#include<stdio.h> | |
int Licz(int a); | |
int a = 4; |
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
( | |
c = 13; | |
a = Array.fib(64,0,1); | |
b = Array.fill(size:c, function:{ arg i; a[i]%12 }); | |
p = 1/(21-c); | |
Pdef(\x, Pbind(\dur, p, \degree, Pseq(b,1,0))); | |
r=Array.fill(c,{ arg i; | |
Pbindf(Pdef(\x), \mtranspose, 1-b[i]); | |
}); | |
Pseq(r,(1/p)).play; |
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
( | |
SynthDef(\acid, { arg out, freq = 1000, gate = 1, pan = 1, cut = 4000, rez = 0.8, amp = 1; | |
Out.ar(out, | |
Pan2.ar( | |
RLPF.ar( | |
Pulse.ar(freq, 0.05), | |
cut, rez), | |
pan) * EnvGen.kr(Env.linen(0.01, 1, 0.3), gate, amp, doneAction:2); | |
) | |
}).add; |
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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int ilosc; | |
scanf("%d", &ilosc); | |
int wartosci[ilosc]; | |
for (int i=0; i < ilosc; i++) { | |
scanf("%d", &wartosci[i]); |