Skip to content

Instantly share code, notes, and snippets.

View petrstepanov's full-sized avatar
🏠
Working from home

Petr Stepanov petrstepanov

🏠
Working from home
View GitHub Profile
@petrstepanov
petrstepanov / ebay-leave-feedback.js
Last active September 30, 2022 02:32
Ebay javascript. Leave feedback programmatically.
// Open eBay feedback page in your browser: https://www.ebay.com/fdbk/leave_feedback
// Paste following code in the inspector console:
var comments=['All good. Nice buyer. Fast payment!',
'Nice buyer. Quick payment!',
'A+ buyer. Come back any time!',
'Good buyer. Thanks for your business',
'Nice buyer quick payment.',
'Definitely recommend this buyer.'];
@petrstepanov
petrstepanov / emittest.c
Created April 27, 2019 00:53
ROOT Signal with two parameters
#include <TQObject.h>
#include <RQ_OBJECT.h>
class A {
RQ_OBJECT("A")
private:
Int_t fValue1;
Int_t fValue2;
public:
@petrstepanov
petrstepanov / presenter.cpp
Last active July 16, 2019 03:46
CERN ROOT MVP Presenter source
#include "__Presenter.h"
#include "__View.h"
#include "../AbstractPresenter.h"
#include "../../model/Model.h"
#include <TGFileDialog.h>
__Presenter::__Presenter(__View* view) : AbstractPresenter<Model, __View>(view) {
model = instantinateModel();
onInitModel();
@petrstepanov
petrstepanov / presenter.h
Created April 23, 2019 22:53
CERN ROOT MVP Presenter header
#include "./../AbstractPresenter.h"
#include "../../model/Model.h"
class __View;
class __Presenter : public AbstractPresenter<Model, __View> {
public:
__Presenter(__View* view);
virtual ~__Presenter();
@petrstepanov
petrstepanov / view.cpp
Last active July 22, 2019 22:53
CERN ROOT MVP View souce
#include "__View.h"
#include "__Presenter.h"
__View::__View(const TGWindow *w) : AbstractView<__Presenter>(w){
// Build UI
initUI();
// Instantinate presenter and connect slots
presenter = instantinatePresenter();
connectSignalsToPresenter();
@petrstepanov
petrstepanov / view.h
Last active April 26, 2019 23:01
CERN ROOT MVP View header
#include "./../AbstractView.h"
#include "__Presenter.h"
class __Presenter;
class __View : public AbstractView<__Presenter> {
protected:
void initUI();
void connectSignalsToPresenter();
@petrstepanov
petrstepanov / canvasResize.c
Created April 19, 2019 07:58
TGListBox inside TGCanvas container not shrinks down
#include <TGClient.h>
#include <TGCanvas.h>
#include <TGListBox.h>
#include <TGFrame.h>
class MyMainFrame : public TGMainFrame {
public:
MyMainFrame(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~MyMainFrame();
@petrstepanov
petrstepanov / conv_linearity_test.c
Last active March 19, 2019 23:24
RooFFTConvPdf linearity test
#include "Riostream.h"
// Custom exponential PDF
class ExpPdf : public RooAbsPdf {
public:
ExpPdf() {};
ExpPdf(const char *name, const char *title, RooAbsReal& _t, RooAbsReal& _tau);
ExpPdf(const ExpPdf& other, const char* name = 0);
virtual TObject* clone(const char* newname) const { return new ExpPdf(*this, newname); }
inline virtual ~ExpPdf() { }
#include "Riostream.h"
// Custom two exponential pdf
class TwoExpPdf : public RooAbsPdf {
public:
TwoExpPdf() {};
TwoExpPdf(const char *name, const char *title,
RooAbsReal& _t,
RooAbsReal& _tau1,
RooAbsReal& _tau2,
/// \file
/// \ingroup tutorial_roofit
/// \notebook -js
/// 'DATA AND CATEGORIES' RooFit tutorial macro #403
///
/// Using weights in unbinned datasets
///
/// \macro_image
/// \macro_output
/// \macro_code