Skip to content

Instantly share code, notes, and snippets.

View FONQRI's full-sized avatar
๐Ÿ†
Focusing

Behnam Sabaghi FONQRI

๐Ÿ†
Focusing
View GitHub Profile
@FONQRI
FONQRI / QmlPropertyExample.qml
Created March 16, 2023 05:01
QmlPropertyExample.qml for moderncpp.ir
width : 100, text: 'Greetings', color: '#FF0000'
@FONQRI
FONQRI / Qt_quick_tutorial_property_text.qml
Created March 16, 2023 04:59
Qt quick tutorial property text for moderncpp.ir
Text {
// (1) identifier
id: thisLabel
// (2) set x- and y-position
x: 24; y: 16
// (3) bind height to 2 * width
height: 2 * width
@FONQRI
FONQRI / Triangle.qml
Created March 16, 2023 04:25
Triangle.qml for tutorial in moderncpp.ir
// RectangleExample.qml
import QtQuick 2.5
// The root element is the Rectangle
Rectangle {
// name this element root
id: root
// properties: <name>: <value>
@FONQRI
FONQRI / unique_id_with_dynamic_range.cpp
Last active November 2, 2021 16:05
Here is an example of creating a unique id using dynamic range and counter
#include <iomanip>
#include <iostream>
#include <mutex>
#include <numeric>
#include <thread>
#include <vector>
class dynamic_range
{
public:
@FONQRI
FONQRI / unique_id_with_fix_range.cpp
Last active November 2, 2021 16:04
Here is an example of creating a unique id using fix range and counter
#include <iomanip>
#include <iostream>
#include <numeric>
#include <thread>
#include <vector>
int main()
{
std::vector<std::thread> thread_list;
@FONQRI
FONQRI / unique_id_with_atomic.cpp
Last active October 21, 2021 06:31
Here is a bad example of creating unique counter id with atomics for blog post
#include <atomic>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <thread>
#include <vector>
int main()
{
std::atomic_int32_t counter{0};
@FONQRI
FONQRI / main.cpp
Last active July 23, 2024 23:57
This is a simple example of using QNetworkAccessManager of qt for requesting a html page over http
/***************************************************
* File %{Cpp:License:FileName}
* Copyright (C) 2021-7-21 ModernCpp.ir . All Rights Reserved. *
***************************************************/
#include <QCoreApplication>
#include <QFile>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QTextCodec>
/***************************************************
* File add_static_make.h
* Copyright (C) 2021-6-19 ModernCpp.ir . All Rights Reserved. *
***************************************************/
#ifndef ADD_STATIC_MAKE_H
#define ADD_STATIC_MAKE_H
#include <memory>
@FONQRI
FONQRI / DataExporterDesignPattern.cpp
Created February 28, 2021 20:11
Simple Example for data export with visitor Design pattern
class NormalPoint;
class LoiterPoint;
class ExporterInterface
{
public:
virtual void exportNormalPoint(const NormalPoint* element) const = 0;
virtual void exportLoiterPoint(const LoiterPoint* element) const = 0;
};
@FONQRI
FONQRI / Unreal_GIS.md
Last active December 7, 2024 09:27
Unreal Engine GIS useful links