Skip to content

Instantly share code, notes, and snippets.

View SebastianTroc's full-sized avatar

Sebastian Troć SebastianTroc

View GitHub Profile
@SebastianTroc
SebastianTroc / homework.pas
Created October 30, 2011 05:17
Homework #1
{Krajowe Stowarzyszenie Pechowców funduje stypendia dla studentów – pechowców. Minimalne wymagania są następujące:
- Ocena średnia nie wyższa niż 3
- Co najmniej drugi rok studiów
- Wiek ponad 40 lat
Informacje o studentach zapisane są w n-elementowej tablicy rekordów postaci:
- nazwisko
- średnia ocena
- rok studiów
- wiek
Uporządkować tablicę w ten sposób, że na początku znajdą się osoby, które mogą otrzymać stypendium, a w dalszej części pozostali.
@SebastianTroc
SebastianTroc / Zad8_C.c
Created November 15, 2011 18:00
Simple exercise in C
/*
* Tresc polecenia:
* Tablice typu int wypelnic liczbami parzystymi.
* Za pomoca funkcji o przykladowej nazwie NotEven() dokonac inkrementacji (zwiekszenie o 1) elementow tej tablicy i sprawdzic to po powrocie do funkcji wywolujacej.
*/
#include <stdio.h>
int NotEven(int liczba) {
liczba = liczba + 1;
@SebastianTroc
SebastianTroc / Zad27_C.c
Created November 15, 2011 18:02
Simple exercise in C
/*
* Tresc polecenia:
* Utworzyć tablicę int o rozmiarze 50.
* Wypełnić kolejnymi liczbami całkowitymi.
* Sumować liczby parzyste do osiągnięcia wartości 100.
* Podać wartość indeksu dla którego osiągnięto, bez przekroczenia, tę wartość.
*/
#include <stdio.h>
@SebastianTroc
SebastianTroc / sequences.cxx
Created January 31, 2012 22:33
Arithmetic, geomertic and Fibonacci's sequences
#include <cstdlib>
#include <iostream>
using namespace std;
int nTablica[100];
int funcArytm(int nA1, int nR, int nMax) {
nTablica[0] = nA1;
for (int i = 0; i < nMax; i++) {
@SebastianTroc
SebastianTroc / wyznaczniki_macierzy.cxx
Created January 31, 2012 22:36
Matrix determinants
#include <iostream>
using namespace std;
int main()
{
/*
* Przykladowa macierz 3x3:
@SebastianTroc
SebastianTroc / komiwojazer.cxx
Created January 31, 2012 22:37
ComiVojager problem
//Problem komiwojazera
#include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
int const ILOSC_MIAST = 10;
class miasto {
test gist from gist-it for Android
@SebastianTroc
SebastianTroc / UML yuml.me do Zubka
Created June 1, 2012 09:23
Scripts for yuml.me - UML Diagrams
Diagramy stanów:
1. Toster
(start)->(zaaplikowanie chleba)->(ustawienie czasu)->(podgrzewanie)->(wyrzucenie gotowego tosta)->(end)
2. Zmywarka
(start)->(Wybierz program)-><a>[Drzwi zamkniete]->|b|,
|b|-Zablokuj>[Drzwi]->|c|,
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@SebastianTroc
SebastianTroc / sort-query-posts.php
Created August 10, 2012 08:57
change plugin: Sort Query Posts with possibility to set a locale for collation
if (! function_exists('sort_query_posts_by'))
{
function sort_query_posts_by($order_by, $order = 'asc', $locale = '')
{
global $wp_query;
$order_by = strtolower($order_by);
$order = strtolower($order);
if ($order_by == 'rand') {
shuffle($wp_query->posts);