Skip to content

Instantly share code, notes, and snippets.

View saifthe1's full-sized avatar

Saif Mulla saifthe1

View GitHub Profile
<?php
/**
* Defines a default cache implementation.
*
* This is Drupal's default cache implementation. It uses the database to store
* cached data. Each cache bin corresponds to a database table by the same name.
*/
class DrupalDatabaseCache implements DrupalCacheInterface {
protected $bin;
<?php
/**
* Defines an interface for cache implementations.
*
* All cache implementations have to implement this interface.
* DrupalDatabaseCache provides the default implementation, which can be
* consulted as an example.
*
* To make Drupal use your implementation for a certain cache bin, you have to
* set a variable with the name of the cache bin as its key and the name of
class NoVirtual {
int a;
public:
void x() const {}
int i() const { return 1; }
};
class OneVirtual {
int a;
public:
// The base class
class Base {
private:
int someNumber_;
public:
void printNumber(){
cout << "Printing number from base " << someNumber_ << endl;
}
virtual void func1(){
cout << "printing from base::func1" << endl;
// The base class
class Base {
private:
int someNumber_;
public:
void printNumber(){
cout << "Printing number from base " << someNumber_ << endl;
}
virtual void func1(){
cout << "printing from base::func1" << endl;
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int truncate(int value)
{
if(value<0)
value = 0;
@saifthe1
saifthe1 / atomistic.C
Created December 10, 2014 10:22
Atomistic simulation classes
// Class forward declarations
class atomisticMoleculeCloud;
/*---------------------------------------------------------------------------*\
Class atomisticMolecule Declaration
\*---------------------------------------------------------------------------*/
class atomisticMolecule
:
public Particle<atomisticMolecule>
@saifthe1
saifthe1 / Poly.C
Created December 10, 2014 10:16
PolyMoleculeCloud class creating instances of polyMolecule class
class polyMoleculeCloud;
/*---------------------------------------------------------------------------*\
Class polyMolecule Declaration
\*---------------------------------------------------------------------------*/
class polyMolecule
:
public particle
{
@saifthe1
saifthe1 / PatBuild
Last active August 29, 2015 14:09
CrayPat pat build error
ERROR: Missing required ELF section '.note.link' from the program
'/fs4/ecse0202/ecse0202/ksb12101/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64Gcc48DPOpt/bin/mdPolyFoam'.
Load the correct 'perftools' module and rebuild the program.
@saifthe1
saifthe1 / OpenFOAM-2.1.x-Mac.patch
Created November 15, 2014 18:52
This patch is vital for building OpenFOAM on Mac, it contains significant patch for various files to adapt to Mac OS environment and error fixes.
# HG changeset patch
# Parent 24bbab269ff59737611bb1ffb71a2ae62e99a3e6
diff --git a/applications/solvers/combustion/chemFoam/Make/options b/applications/solvers/combustion/chemFoam/Make/options
--- a/applications/solvers/combustion/chemFoam/Make/options
+++ b/applications/solvers/combustion/chemFoam/Make/options
@@ -12,6 +12,7 @@
EXE_LIBS = \
-lfiniteVolume \