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
--TEST-- | |
Example test emulating a file upload | |
--SKIPIF-- | |
<?php if (php_sapi_name()=='cli') die('skip'); ?> | |
--POST_RAW-- | |
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryfywL8UCjFtqUBTQn | |
------WebKitFormBoundaryfywL8UCjFtqUBTQn | |
Content-Disposition: form-data; name="file"; filename="example.txt" | |
Content-Type: text/plain |
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 | |
#index.php | |
// Assuming the Following directory structures | |
// | |
// |-- index.php | |
// `-- library | |
// `-- Zend | |
// |-- Db | |
// |-- Db.php |
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
# Below are commands used to install and set-up virtual environment of Python 3.4 in Ubuntu 14.04. | |
# First we need to install dependencies. Please not that this is much larger list than is required for setting up only Python. | |
# The reason is that usually I and my users install other python packages through pip (list of the popular ones is at the | |
# end) and these packages also require some packages to be installed first. Thus, I prefer to install everything at | |
# once. | |
sudo apt-get install build-essential libc6-dev libreadline-dev libncursesw5-dev libssl-dev libgdbm-dev libsqlite3-dev libbz2-dev liblzma-dev tk-dev bzip2 libbz2-dev sqlite3 tk8.5-dev zlib1g-dev liblzma-dev libblas3 liblapack3 gfortran libopenblas-dev liblapack-dev libmagickwand-dev libxml2-dev libxslt1-dev qtmobility-dev git cmake libqt4-dev libwebp-dev | |
# Download latest Python, unpack it, and enter into Python folder. |
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 <errno.h> | |
#include <string.h> | |
#include <fts.h> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
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 <errno.h> | |
#include <dirent.h> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int dir_scan(const string & in_path, vector<string> & found_paths) |
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
/* How to use enum class and to obtain its value as integer and string | |
* without too much of code repition. | |
* | |
* Based on http://stackoverflow.com/a/238157/248823 | |
*/ | |
#include <iostream> | |
using namespace std; |
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
# The gist shows how to compile latest development snaphost of DCMTK 3.6.1 | |
# in Ubuntu 14.04. The version of the dcmtk avaliable in ubuntu's repositiries | |
# is 3.6.0, which is from 2011. The gist also shows how to setup include | |
#and lib folders so thatwe can use them to write our own C++ programs | |
# using the develpment version. | |
# first need to install required packages | |
sudo apt-get install build-essential cmake libpng12-dev libtiff5-dev libxml2-dev libjpeg8-dev zlib1g-dev libwrap0-dev libssl-dev | |
# where to install DCMTK |
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
# This is example of the cmake file that can be used for basic compilation of a C++11 program | |
# that uses DCMTK 3.6.1 in ubuntu 14.04 | |
# Compilation instructions are here: | |
# https://gist.github.com/marcinwol/089d4a91f1a1279e33f9 | |
cmake_minimum_required(VERSION 2.8) | |
# name of the cpp project |
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
# This is example of the cmake file that can be used for basic compilation of a C++11 program | |
# that uses DCMTK 3.6.0 avaliable in ubuntu 14.04 | |
# to install DCMTK 3.6.0 for ubuntu 14.04 | |
# sudo apt-get install libdcmtk2-dev | |
cmake_minimum_required(VERSION 2.8) | |
# name of the cpp project | |
project(testDMCTK) |
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
/** | |
* Code taken from http://stackoverflow.com/a/11408470/248823 | |
*/ | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <iterator> | |
#include <iostream> | |
#include <stdexcept> |
OlderNewer