Skip to content

Instantly share code, notes, and snippets.

@anddam
anddam / gist:4116462
Last active October 13, 2015 01:17
Mono package error with swf buttons
me@biboop ~/Downloads> # the test executable is attached at ticket http://trac.macports.org/ticket/29636
me@biboop ~/Downloads> mono --desktop swf-buttons.exe
Mono: gc took 73 usecs
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v2.0.50727
Mono: Assembly Loader probing location: '/opt/local/lib/mono/2.0/mscorlib.dll'.
Mono: Image addref mscorlib[0x7ffc2840d160] -> /opt/local/lib/mono/2.0/mscorlib.dll[0x7ffc28809400]: 2
Mono: AOT failed to load AOT module /opt/local/lib/mono/2.0/mscorlib.dll.dylib: dlopen(/opt/local/lib/mono/2.0/mscorlib.dll.dylib, 9): image not found
Mono: Assembly Loader loaded assembly from location: '/opt/local/lib/mono/2.0/mscorlib.dll'.
@anddam
anddam / gist:5014894
Last active December 14, 2015 02:39
fix resize in octave fltk backend on osx
function fltk_fix_resize
number_of_figures = get(0, "children")(1,1);
screen_size = get(0, "screensize");
for figure_number = 1:number_of_figures
figure_position = get(figure_number, "position");
set (figure_number, "position", screen_size);
drawnow()
set (figure_number, "position", figure_position);
endfor
endfunction
@anddam
anddam / gist:5277157
Last active December 15, 2015 14:49
lpeg porting to mp
me@biboop /o/l/v/m/b/_/l/w/lpeg-0.11> grep CFLAG makefile
CFLAGS = $(CWARNS) $(COPT) -ansi -I$(LUADIR) -fPIC -Os `/opt/local/bin/pkg-config lua --cflags`
me@biboop /o/l/v/m/b/_/l/w/lpeg-0.11> mpdo make
gcc -Wall -Wextra -pedantic -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wdisabled-optimization -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -O2 -ansi -I/usr/include/lua5.1/ -fPIC -Os `/opt/local/bin/pkg-config lua --cflags` -c -o lpvm.o lpvm.c
gcc -Wall -Wextra -pedantic -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wdisabled-optimization -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -O2 -ansi -I/usr/include/lua5.1/ -fPIC -Os `/opt/local/bin/pkg-config lua --cflags` -c -o lpcap.o lpcap.c
gcc -Wall -Wextra -pedantic -Waggregate-return -Wbad-function-cast
@anddam
anddam / gist:5477362
Created April 28, 2013 16:10
db46 issues when db.h from db46 is in include path
### with selection from group db set to none
/bin/sh ./libtool --mode=compile /usr/bin/clang -c -pipe -Os -arch x86_64 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c
/usr/bin/clang -c -pipe -Os -arch x86_64 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c -fno-common -DPIC -o .libs/db_dump185.o
../dist/../db_dump185/db_dump185.c:189:15: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration]
while ((ch = getopt(argc, argv, "f:p")) != EOF)
^
1 warning generated.
@anddam
anddam / gist:5500598
Last active December 16, 2015 21:29
TLC
me@biboop ~/D/D/L/TLC> luajit window.lua
fish: Job 1, 'luajit window.lua ' terminated by signal SIGSEGV (Address boundary error)
me@biboop ~/D/D/L/TLC> gdb luajit
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done
@anddam
anddam / gist:6841451
Last active December 24, 2015 18:09
accessing ivars in a block
#import <Foundation/Foundation.h>
#import "AFJSONRequestOperation.h"
@interface Data : NSObject {
NSURLRequest *request;
AFJSONRequestOperation *operation;
id receiver;
SEL action;
}
Failed to execute process '/usr/bin/startx'. Reason:
exec: Exec format error
The file '/usr/bin/startx' is marked as an executable but could not be run by the operating system.
#pragma mark SORTING FUNCTIONS
NSInteger sortData(id num1, id num2, BOOL ascending)
{
float v1 = [[num1 objectAtIndex:0] floatValue];
float v2 = [[num2 objectAtIndex:0] floatValue];
if (v1 < v2)
return (ascending ? NSOrderedAscending : NSOrderedDescending);
else if (v1 > v2)
return (ascending ? NSOrderedDescending : NSOrderedAscending);
# questo è il ciclo che scarica le 720 tessere della mappa al livello di ingrandimento massimo, cioe' 5
for i in (seq 0 719); curl -s "http://caronte.codex2.cilea.it/cntCaronte?id=549234&dwn=0&jtl=5,"$i -o foglio_8-tessera_(printf "%04d" $i).jpeg; end
# questo è il comando che le rimonta
montage -geometry +0+0 -tile 30x24 foglio_8-tessera_* foglio_8.jpeg
@anddam
anddam / gist:7152005
Last active December 26, 2015 12:29
gnucap configure - readline issue
---> Configuring gnucap
DEBUG: Using compiler 'Xcode Clang'
DEBUG: Executing org.macports.configure (gnucap)
DEBUG: Environment: CPATH='/opt/local/include' CPPFLAGS='-I/opt/local/include' CFLAGS='-pipe -Os -arch x86_64' CXXFLAGS='-pipe -Os -arch x86_64 -stdlib=libstdc++' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.7' F77FLAGS='-m64' CXX='/usr/bin/clang++' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_gnucap/gnucap/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -Os -m64' LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64' FCFLAGS='-pipe -Os -m64' OBJC='/usr/bin/clang' OBJCXX='/usr/bin/clang++' INSTALL='/usr/bin/install -c' OBJCFLAGS='-pipe -Os -arch x86_64' OBJCXXFLAGS='-pipe -Os -arch x86_64 -stdlib=libstdc++' FFLAGS='-pipe -Os' CC_PRINT_OPTIONS='YES' CC='/usr/bin/clang'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_gnuc