Skip to content

Instantly share code, notes, and snippets.

View do-berry's full-sized avatar

Dominika do-berry

  • Wrocław, Poland
View GitHub Profile
package package1;
import java.util.ArrayList;
import java.util.List;
import static java.util.Collections.swap;
/**
* @author Dawid
* Quick sorter with parameterized type of sorting list
@do-berry
do-berry / Series.java
Last active September 6, 2019 11:01
.
import java.lang.IllegalArgumentException;
import java.util.List;
import java.util.ArrayList;
class Series {
public String series;
public Series(String series) {
this.series = series;
@do-berry
do-berry / obraz.c
Last active May 17, 2019 13:03
OiAK L : obraz, odczyt/zapis + wysw
// odczyt + wyswietl
// build: gcc main.c -o main
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#pragma pack(push,1)
typedef struct {
unsigned short naglowek;
unsigned int rozmiar;
unsigned int reserved;
@do-berry
do-berry / common.h
Created May 13, 2019 14:53
PW, kolejki posix
#define SIZE 80
#define MQ_NAME "/Kolejka"
typedef struct {
int pnr ; /* numer procesu */
char text[SIZE]; /* tekst komunikatu */
} ms_type;
@do-berry
do-berry / licz.c
Created May 6, 2019 15:00
PW zadanka
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@do-berry
do-berry / zad1.sh
Created May 6, 2019 08:45
SO2, awk [L]
#!/bin/bash
#a
ps aux | awk \
'{
print "User " $1 " - proces " $11 " (CPU = " $3 ", MEM = " $4 ")";
}'
#b
ps aux | awk \
@do-berry
do-berry / zad1.sh
Created May 5, 2019 08:53
SO2, awk
#!/bin/bash
#a
ps aux | awk \
'{
print "User " $1 " - proc " $11 " (CPU=" $3 ", MEM=" $4 ")"
}'
#b
ps aux | awk \
@do-berry
do-berry / a.sh
Created May 3, 2019 16:33
bash -> poprawa
mkdir A/D
mkdir A/B/C
mkdir A/D/E
# tworzenie pliczkow
for i in {1..10}; do
touch ./A/B/plik$i
echo "test$i" > ./A/B/plik$i
done
@do-berry
do-berry / cpuid.s
Last active April 26, 2019 12:32
[OiAK L] : odczyt i zapis do pliku
# eng.wiki; built with gcc -g -o cpuid cpuid.s
.extern printf
.data
s0: .asciz "CPUID: %x\n"
s1: .asciz "Largest basic function number implemented: %i\n"
s2: .asciz "Vendor ID: %.12s\n"
.text
@do-berry
do-berry / main.s
Created April 26, 2019 09:39
zapis do pliku
.data
STDIN = 0
STDOUT = 1
SYSREAD = 0
SYSWRITE = 1
SYSOPEN = 2
SYSCLOSE = 3
FREAD = 0
FWRITE = 1
SYSEXIT = 60