Skip to content

Instantly share code, notes, and snippets.

@Roffild
Roffild / ModifForest.mqh
Created March 26, 2019 23:47
Modification of a random forest with predictive significance calculations.
class CDForestUtils : public CDForest
{
protected:
static void DFProcessInternal(CDecisionForest &df,const int offs,
double &x[],double &y[],ulong &stats[])
{
//--- create variables
int k=0;
int idx=0;
//--- Set pointer to the root
@Roffild
Roffild / multiprocessing_example.py
Created May 22, 2019 00:41
Use multiprocessing in PythonDLL
import multiprocessing
import sys
__file__ = r'path_to\multiprocessing_example.py'
sys.argv = [__file__]
python_exe = r'path_to\python.exe'
def getresult(outp):
from torch.utils.data.dataloader import _SingleProcessDataLoaderIter
class CUDAPrefetcher(_SingleProcessDataLoaderIter):
def __init__(self, loader, device=None, priority=0):
if not torch.cuda.is_available():
raise Exception("Only CUDA")
super(CUDAPrefetcher, self).__init__(loader)
self.device = device
self.stream = torch.cuda.Stream(device=device, priority=priority)
self.last = None
@Roffild
Roffild / test_autopytorch_metrics.py
Last active February 24, 2021 10:23
Metrics from XGBoost for PyTorch
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
@Roffild
Roffild / xgboost.mqh
Created September 15, 2022 11:11
XGBoost for MQL
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@Roffild
Roffild / ДоступныеТипы.bsl
Last active August 12, 2023 14:35
ПолеВвода.ДоступныеТипы и ОграничениеТипа в 1С:Предприятие 8.3.22.1923 (2023г.)
// Пример выбора Страны без добавления в справочник.
// Позволяет выбрать Страну из классификатора при отсутствии в справочнике.
//
// 1С:Предприятие 8.3.22.1923 (2023г.):
// ДоступныеТипы ни на что не влияет для всех типов (кроме "ОписаниеТипов").
// ОграничениеТипа влияет на Выбор и значение.
//
// Это часть для реквизита типа "ОписаниеТипов".
// Свойства: ДоступныеТипы, РазрешитьСоставнойТип, ТипыВВидеДерева.
// В справке находятся в
@Roffild
Roffild / docker_utils.py
Created February 6, 2024 10:14
Utilities for creating a docker image.
"""
Utilities for creating a docker image.
"""
import fnmatch
import json
import pathlib
import re
import stat
import subprocess
import tarfile