Skip to content

Instantly share code, notes, and snippets.

View zarch's full-sized avatar

Pietro Zambelli zarch

  • Eurac research / SynapsEES
  • italy
View GitHub Profile
@zarch
zarch / opcua.py
Last active September 10, 2024 09:43
Import from xml and populate nodes avoiding duplicates
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.12,<3.13"
# dependencies = [
# "asyncua==1.1.5",
# ]
# ///
"""Testing import/export from and to an xml file."""
import asyncio
@zarch
zarch / T_2m_201501_01.tfw
Last active November 6, 2017 04:51
T_2m_201501_01
0.0550011806
0.0000000000
0.0000000000
-0.0550012151
-28.4030000000
21.8630000000
@zarch
zarch / grass-sys-errors
Created June 18, 2017 21:17
Errors when trying to generate GRASS GIS binding with bindgen
$ clang --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ CPATH=:/lib:$GISBASE/include OUT_DIR=binding cargo build --verbose
Fresh lazy_static v0.2.2
Fresh vec_map v0.6.0
Fresh unicode-segmentation v1.1.0
@zarch
zarch / bench_zip_vs_windows.rs
Created July 22, 2016 07:01
zip vs windows
#![feature(test)]
extern crate test;
extern crate num;
extern crate geo;
use test::Bencher;
use num::Float;
use geo::{Coordinate, Point, LineString};
@zarch
zarch / bench_get_bbox.rs
Created July 19, 2016 04:54
Benchmark get_bbox function
#![feature(test)]
// result on my machine:
// test bench_get_bbox ... bench: 1,454,908 ns/iter (+/- 140,500)
// test bench_get_bbox_fold ... bench: 2,744,768 ns/iter (+/- 302,968)
extern crate test;
extern crate num;
extern crate geo;
use std::ops::Add;
use std::ops::Neg;
use std::ops::Sub;
use num::Num;
#[derive(PartialEq, Clone, Copy, Debug)]
pub struct Coordinate<T>
where T: Num + Copy
{
@zarch
zarch / fs_pudil
Created October 9, 2014 04:54
Sequential forward floating feature selection with Jeffries-Matusita Distance
# -*- coding: utf-8 -*-
"""
Sequential forward floating feature selection with Jeffries-Matusita Distance
==============================================================================
Reference: Pudil, P.; Novovicová, J. & Kittler, J.
Floating search methods in feature selection Pattern recognition letters,
Elsevier, 1994, 15, 1119-1125
@zarch
zarch / javascript_resources.md
Last active August 29, 2015 14:06 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@zarch
zarch / python_resources.md
Last active August 29, 2015 14:06 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@zarch
zarch / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console