unittest:
import unittest
class MyTest( unittest.TestCase ):
def setUp( self ):
self.variable = ...
pytest:
import pytest
class MyTest:
@classmethod
def setup_class( cls ):
cls.variable = ...
More flesh, less fluff.
unittest:
import unittest
class MyTest( unittest.TestCase ):
def setUp( self ):
self.variable = ...
pytest:
import pytest
class MyTest:
@classmethod
def setup_class( cls ):
cls.variable = ...
pip install torch --index-url https://download.pytorch.org/whl/cpu
#include <gtest/gtest.h>
template< typename Type >
class MyTestFixture : public ::testing::Test
{};
TYPED_TEST_SUITE_P( MyTestFixture );
TYPED_TEST_P( MyTestFixture, Case1 )
{
TypeParam ...;
...
}
TYPED_TEST_P( MyTestFixture, Case2 )
{
TypeParam ...;
...
}
REGISTER_TYPED_TEST_SUITE_P( MyTestFixture, Case1, Case2 );
typedef ::testing::Types< ClassA, ClassB > TestTypes;
INSTANTIATE_TYPED_TEST_SUITE_P( MyTest, MyTestFixture, TestTypes);
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/index/rtree.hpp>
using PointType = boost::geometry::model::point<float,3,boost::geometry::cs::cartesian>;
// Build the r-tree
boost::geometry::index::rtree< PointType,boost::geometry::index::quadratic<16> > rtree;
for(...) {
rtree.insert( PointType( x, y, z ) );
}
// Find the nearest point
PointType roiPoint( x, y, z );
std::vector< PointType > nearestPoints;
rtree.query( boost::geometry::index::nearest( roiPoint, 1 ), std::back_inserter( nearestPoints ) );
const auto nearest = nearestPoints[0];
std::cout << nearest.get<0>() << ", "<< nearest.get<1>() << ", " << nearest.get<2>() << std::endl;
rpm -ql <package>
rpm -qa *intel*
rpm -qa | sort | grep intel
#!/bin/bash
for file in <path>/*; do
dcm2pnm "$file" "$file".png --write-png
done
ls -l | wc -l
wc: word count
cat /etc/os-release
rpm -qa --last | grep <something>