Skip to content

Instantly share code, notes, and snippets.

@kolodziej
kolodziej / sqlite.cpp
Created Nov 18, 2014
simple sqlite client
View sqlite.cpp
#include <iostream>
#include <sqlite3.h>
#include <string>
int callback(void *nu, int argc, char **argv, char **colName)
{
for (int i = 0; i < argc; ++i)
{
std::cout << colName[i] << " = ";
if (argv[i])
View kontener.cpp
class kontener
{
int *T, n;
public:
kontener(int n_) : T(new int[n_]), n(n_)
{
std::cout << "tworzenie kontenera o poj. " << n << " pod adresem: " << reinterpret_cast<const void*>(this) << "\n";;
}
kontener(const kontener& zrodlo) : T(new int[zrodlo.pobierz_n()]), n(zrodlo.pobierz_n())
{
@kolodziej
kolodziej / ld2_2_Obliczanie_silni_z_obsluga_parametrow_linii_polecen.cpp
Created Aug 26, 2014
Obliczanie silni z obsługą parametrów linii poleceń
View ld2_2_Obliczanie_silni_z_obsluga_parametrow_linii_polecen.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char ** argv)
{
int n = 0;
int silnia = 1;
cout << "\tObliczanie silni" << endl;
View ld2_1_Obliczanie_silni.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char ** argv)
{
int n = 0;
int silnia = 1;
cout << "\tObliczanie silni" << endl;
View time_utility_tpl.hpp
#ifndef TIME_UTILITY_TPL_HPP
#define TIME_UTILITY_TPL_HPP
#include <string>
#include <sstream>
#include <chrono>
#include <ctime>
template <typename Clock, int BufSize>
std::string format_time(std::chrono::time_point<Clock> timepoint, std::string format, tm * (*func)(const time_t*))
{
View mystat.cpp
#include <iostream>
#include <iomanip>
#include <cstring>
#include <sys/stat.h>
#include <pwd.h>
#include <grp.h>
#include <ctime>
using namespace std;
View draw_bst_tpl.cpp
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
template <typename T>
struct BST_node
{
T data;
View draw_bst.cpp
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
struct BST_node
{
int data;
BST_node * left, * right;
View trojkat_2.sh
#!/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!"
View trojkat_1.sh
#!/bin/bash
a=$1
b=$2
c=$3
istnieje=false
if [ $(($a+$b)) -gt $c ]; then
if [ $(($b+$c)) -gt $a ]; then