Skip to content

Instantly share code, notes, and snippets.

View guziy's full-sized avatar
🇺🇦
#StandWithUkraine

Oleksandr Huziy guziy

🇺🇦
#StandWithUkraine
View GitHub Profile
@guziy
guziy / func_as_par.f
Created August 23, 2011 22:21
Function as parameter in f77
subroutine caller(arg, called)
integer :: arg
external :: called
call called(arg)
end subroutine caller
@guziy
guziy / passing_subroutine_as_par.f90
Created August 23, 2011 22:24
Subroutine as a parameter to another subroutine in f90
subroutine caller(arg, called)
integer :: arg
interface
subroutine called(arg)
integer :: arg
end subroutine called
end interface
call called(arg)
end subroutine caller
@guziy
guziy / java_affine.java
Created November 10, 2011 23:46
Java affine transform using JTS
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.util.AffineTransformationBuilder;
import com.vividsolutions.jts.geom.util.NoninvertibleTransformationException;
import org.geotools.geometry.jts.JTSFactoryFinder;
/**
*
@guziy
guziy / polygon_to_mpl.py
Created November 11, 2011 00:00
Polygon to matplotlib
polygon = loads(geom.ExportToWkt())
boundary = polygon.exterior
coords = np.zeros(( len(boundary.coords), 2))
for i, the_coord in enumerate(boundary.coords):
coords[i, 0], coords[i, 1] = basemap( the_coord[0], the_coord[1] )
result.append(Polygon(coords, facecolor = 'none', edgecolor = edge_color, linewidth = linewidth))
@guziy
guziy / shapely_affine.py
Created November 11, 2011 00:04
Affine transform using shapely geometries
__author__="huziy"
__date__ ="$Aug 10, 2011 3:49:16 PM$"
from shapely.geometry import Point, Polygon
import numpy as np
class AffineTransform():
def __init__(self):
self.transMatrix = None
@guziy
guziy / merge_txt_files.sh
Created November 11, 2011 20:40
Bash merge txt files in the same directory
cat $(ls) > dictionary.txt
@guziy
guziy / find_ex1.sh
Created December 13, 2011 19:21
find example
find ./ -name afb -type d
@guziy
guziy / pdf_python.py
Created January 5, 2012 03:38
pdf using python
__author__="san"
__date__ ="$18-May-2010 11:48:34 PM$"
from datetime import datetime
from reportlab.platypus import *
from reportlab.platypus.tables import *
from datetime import timedelta
from datetime import *
from reportlab.lib.styles import *
from reportlab.lib.units import *
@guziy
guziy / draw.tex
Created January 7, 2012 00:38
Drawin in Tex
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}
\usepackage{amsmath}
\usetikzlibrary{chains,positioning}
...
@guziy
guziy / ncdump_output.txt
Created July 17, 2012 21:54
ncdump_h_output
~# ncdump -h evap-1985.nc
netcdf evap-1985 {
dimensions:
longitude = 480 ;
latitude = 241 ;
time = UNLIMITED ; // (730 currently)
variables:
float longitude(longitude) ;
longitude:units = "degrees_east" ;
longitude:long_name = "longitude" ;