This file contains 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 <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
using namespace std; | |
class Parser | |
{ | |
private: |
This file contains 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
CXX=g++ | |
CXXFLAGS=-std=c++11 -g -DDEBUG -Wall | |
APPSFLAGS=-fPIC -shared | |
OBJS=shell_main.o shell.o | |
APPS=concat_application.so echo_application.so | |
LIBS=-ldl | |
TARGET=shell | |
all: $(OBJS) $(APPS) | |
$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $(TARGET) |
This file contains 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
/* CyclicIterator | |
* Cyclic iterator for STL containers. | |
* @author Kacper Kołodziej | |
* @url http://kacperkolodziej.com/ | |
* @email kacper@kolodziej.in | |
*/ | |
#ifndef CYCLIC_ITERATOR_HPP | |
#define CYCLIC_ITERATOR_HPP | |
#include <iterator> |
This file contains 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
// na początku | |
#include <algorithm> | |
#include <string> | |
std::string str; // w nim masz tekst | |
std::transform(str.begin(), std.end(), str.begin(), ::tolower); | |
// taki zabieg dla obu stringów i porównujesz | |
// jeżeli chcesz zmieniony tekst mieć w drugim stringu, to: |
This file contains 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
Wezel* a; | |
Wezel* b; | |
int tmp = a->dane; | |
a->dane = b->dane; | |
b->dane = tmp; |
This file contains 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
przyklad: przyklad.cpp | |
g++ przyklad.cpp -o run | |
g++ przyklad.cpp -o run_o1 -O1 | |
g++ przyklad.cpp -o run_o2 -O2 | |
g++ przyklad.cpp -o run_o3 -O3 | |
suma: suma.cpp | |
g++ suma.cpp -o suma | |
g++ suma.cpp -o suma_o1 -O1 | |
g++ suma.cpp -o suma_o2 -O2 |
This file contains 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
<?php | |
function array_delete(array &$array, $elements) { | |
//jeśli parametr $elements jest tablicą kluczy do usunięcia | |
if (is_array($elements)) { | |
//ile elementów do usunięcia | |
$toDelete = count($elements); | |
//ile usunięto poprawnie | |
$deleted = 0; | |
foreach ($elements as $index) { | |
if (unset($array[$index])) $deleted++; |
This file contains 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
<?php | |
class Collection implements ArrayAccess, Iterator, Countable | |
{ | |
private $_data = array(); | |
private $_strict; | |
protected $_pointer = 0; | |
const SEPARATOR = ':'; | |
This file contains 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
#!/bin/bash | |
a=$1 | |
b=$2 | |
c=$3 | |
istnieje=true | |
if [ $(($a+$b)) -le $c ]; then | |
echo "Warunek $a + $b > $c nie jest spełniony!" |
This file contains 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
#!/bin/bash | |
a=$1 | |
b=$2 | |
c=$3 | |
istnieje=false | |
if [ $(($a+$b)) -gt $c ]; then | |
if [ $(($b+$c)) -gt $a ]; then |