Skip to content

Instantly share code, notes, and snippets.

View zxmarcos's full-sized avatar

Marcos Medeiros zxmarcos

View GitHub Profile
@zxmarcos
zxmarcos / ShadowHighlightCorrection.py
Created September 21, 2023 01:32 — forked from HViktorTsoi/ShadowHighlightCorrection.py
Image shadow and highlight correction/adujstment with opencv.
import numpy as np
import cv2
def correction(
img,
shadow_amount_percent, shadow_tone_percent, shadow_radius,
highlight_amount_percent, highlight_tone_percent, highlight_radius,
color_percent
):
"""
@zxmarcos
zxmarcos / package.xml
Created June 26, 2023 16:42 — forked from iamsonal/package.xml
Package.xml to retrieve all metadata from salesforce org
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ActionLinkGroupTemplate</name>
</types>
<types>
<members>*</members>
<name>AnalyticSnapshot</name>
</types>
module riscv_dasm();
//----------------------
task dasm(input [31:0] instr, output [20*8:0] dbuff);
reg [4:0] rd;
reg [4:0] rs1;
reg [4:0] rs2;
reg [2:0] funct3;
reg [6:0] funct7;
reg [6:0] opcode;
reg [31:0] imm_u_type;
#include <thread>
#include <windows.h>
#include <cstdio>
using namespace std;
extern "C" void interrupt_trampoline();
extern "C" void throw_cancel() { throw std::exception(); }
__asm__("_interrupt_trampoline: call _throw_cancel; ret \n");
@zxmarcos
zxmarcos / write-in-c.c
Created May 17, 2019 21:06
Write in C
/* "Write in C"
* Marcos Medeiros
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
unsigned char *__xbufbase = NULL;
unsigned int __xbufsize = 0;
unsigned int __xbufpos = 0;
/*
Bibliotecas utilizadas.
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.1",
"@babel/preset-react": "^7.0.0",
"rollup": "^1.7.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.1",
@zxmarcos
zxmarcos / cubic.hpp
Created December 3, 2018 18:18
Higan cubic resampler
#pragma once
#include <nall/queue.hpp>
namespace nall { namespace DSP { namespace Resampler {
struct Cubic {
inline auto reset(double inputFrequency, double outputFrequency, uint queueSize = 0) -> void;
inline auto pending() const -> bool { return samples.pending(); }
inline auto read() -> double { return samples.read(); }
options = QgsVectorFileWriter.SaveVectorOptions()
options.driverName = 'SQLite'
options.fileEncoding = 'utf-8'
options.datasourceOptions = ['SPATIALITE=YES',
'OGR_SQLITE_PRAGMA=synchronous=OFF,journal_mode=MEMORY,locking_mode=EXCLUSIVE'
]
options.layerOptions = ['SPATIAL_INDEX=NO', 'FID=id']
options.onlySelectedFeatures = True
options.layerName = layer.name()
options.actionOnExistingFile = QgsVectorFileWriter.CreateOrOverwriteLayer
#include <iostream>
#include <boost/metaparse.hpp>
#include <boost/mpl/map.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/char.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/has_key.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/if.hpp>
#include <iostream>
#include <string>
#include <functional>
#include <tuple>
#include <utility>
#include <regex>
#include <vector>
#include <tuple-utils/tuple_subset.h>