Skip to content

Instantly share code, notes, and snippets.

View xShivan's full-sized avatar

Michał Cywiński xShivan

View GitHub Profile
#include <stdio.h>
void suspend()
{
while (1)
{
int marker = 0;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Silnia;
/**
*
//Exception definition: https://gist.github.com/mcywinski/44c0f82d70b739477109 - Exception
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Silnia;
/**
@xShivan
xShivan / gist:46b5e682ca100c8f3dbe
Created May 14, 2014 00:56
Attatching values to form just before it is sent
$("#submit").click(function () {
var ids = "";
$(":checkbox").each(function () {
if ($(this).is(':checked')) {
ids = ids + $(this).val() + ";";
}
});
$("#mainform").append("<input type='hidden' value='" + ids + "' name='participant_ids' />");
});
@xShivan
xShivan / gist:6daf8e6a399d62b8b56d
Last active August 29, 2015 14:01
Laboratorium SO6 - Demo z zajęć
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void* wyswietl(void* w)
{
int z;
printf("W przekazany do wąkku %d", (int)w);
z = (int)w + 10;
pthread_exit((void*)z);
@xShivan
xShivan / gist:b13cd8788e9154bbe5f6
Last active August 29, 2015 14:01
Laboratorium SO6
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
char text[32];
void* wyswietl(void* w)
{
if (w == 0) //Odwrotna kolejność
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
char text[32];
void* wyswietl(void* w)
{
if (w == 0) //Odwrotna kolejność
@xShivan
xShivan / gist:641586fcd8a7a3d4d546
Created May 28, 2014 16:48
Szachownica Laboratorium JTP
package rysowanie;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JFrame;
class MyCanvas extends JComponent {
@xShivan
xShivan / gist:15b5f05bc2d895b7101d
Last active August 29, 2015 14:02
Systemy operacyjne Lab 11
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
pthread_mutex_t mutex;
char buffer[32]; //32bit = 4 bytes; 4 bytes * 32 integers = 128 bytes long integer array
char source_filename[32];
char destination_filename[32];
FILE* working_copy;
FILE* destination_copy;
@xShivan
xShivan / gist:56eca00f7350e94d346c
Created June 7, 2014 22:16
Problem z liczba znakow
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
short ok = 1;
//String buffer
char buffer[128];