Programming gone awry

Thoughts and tutorials on programming

Tuesday, August 23, 2011

ruby tempfile windows woe


test.rb:3:in `delete': Permission denied - C:/Users/packrd/AppData/Local/Temp/abc20110823-4296-kao0jx-0 (Errno::EACCES)
from test.rb:3

when doing File.delete tempfile_instance.path

work-around:
do
tempfile_instance.delete instead

Monday, August 22, 2011

ffmpeg mingw msys build woe


libavfilter/asrc_abuffer.c: In function 'init':
libavfilter/asrc_abuffer.c:259:5: error: implicit declaration of function 'strtok_r'

meant "you need to install the pthreads lib" (I think)

Friday, August 19, 2011

ffmpeg woe


c:\dev\ruby\virtual-audio-output-sniffer>ffmpeg -f dshow -i audio="virtual-audio-capturer" captured_audio.mp3
FFmpeg version SVN-r23418, Copyright (c) 2000-2010 the FFmpeg developers
built on Jun 2 2010 04:12:01 with gcc 4.4.2
configuration: --target-os=mingw32 --enable-runtime-cpudetect --enable-avisynth --enable-gpl --enable-version3 --enable-bzlib --enable-libgsm --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid --enable-libschroedinger --enable-libx264 --extra-libs='-lx264 -lpthread' --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-librtmp --extra-libs='-lrtmp -lssl -lcrypto -lws2_32 -lgdi32 -lwinmm -lcrypt32 -lz' --arch=x86 --cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc' --enable-memalign-hack
libavutil 50.16. 0 / 50.16. 0
libavcodec 52.72. 1 / 52.72. 1
libavformat 52.67. 0 / 52.67. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.11. 0 / 0.11. 0
Unknown input format: 'dshow'

c:\dev\ruby\virtual-audio-output-sniffer>whichr ffmpeg
higher in the list is executed first
G:\Program Files (x86)\ImageMagick-6.7.1-Q16\ffmpeg.exe
c:\installs\ffmpeg.bat

c:\dev\ruby\virtual-audio-output-sniffer>whichr ffplay
higher in the list is executed first
c:\installs\ffplay.bat


meant "I was accidentally using a different version of ffmpeg--that bundled with imagemagick--instead of the one that does support installed in a different location"

mac os x enumerate windows like windows' EnumDesktopWindows

looks like in order to do it you need to either turn on "universal access" then use either applescript or the access API's in C to do it, or use some internal coregraphics private api's (in C). So for java users, its either ffi or JNA or the like, or call out to an applescript script.

Thursday, December 03, 2009

beyond clearplay

I've posted several comments on what I envision for the future of user content editable media.
http://programming-gone-awry.blogspot.com/2009/08/how-to-proxy-to-port-when-your-firewall.html

and


Well the comments here are even more!

Wednesday, September 23, 2009

Pictures wrong sometimes?

Anybody else notice that pictures are sometimes...just wrong?

ping!

in reference to: Google News (view on Google Sidewiki)

Benefits of Firefox

The benefits of firefox:

the adblock plus plugin [plus myriad other plugins]
Reasonably speedy, well supported.

Drawbacks:

It takes up more RAM than Chrome (i.e. slower for older machines), renders, for me, slightly slower than Safari/Chrome [in windows, at least].

Written only to be able to say I was the first to sidewiki FF :)

in reference to: Firefox Browser | Free ways to customize your Internet (view on Google Sidewiki)

Beautiful

Google Earth is a beautiful thing--the stand alone app is smoother than the google maps web version.

[written just to be able to say I wrote the first sidewiki for google earth]

in reference to: Google Earth (view on Google Sidewiki)

Wednesday, August 05, 2009

how to compile ruby with increased garbage size

You may have noticed when you're running long-ish rails processes in windows that it sometimes pauses briefly, then continues on its merry way.

I have, at least.

The problem can be attributed to the garbage collector.
Ex: with one operation large_table.find(:all).each{||...}

I would receive something like 10 0.10 second pauses before it finished--increasing my overall time by at least 25%

Tweaking the malloc limit [the amount it will grow before doing a GC limit] changed that to something like 2 0.25 second pauses--which caused things to speedup considerably.


How:
install msysgit
c:> git://github.com/oneclick/rubyinstaller.git
cd rubyinstaller
set CCFLAGS=-DGC_MALLOC_LIMIT=60000000
rake # build ruby 1.8 in sandbox/ruby18_mingw
rake ruby19 # build ruby 1.9 in sandbox/ruby19_mingw

Installers hopefully coming soon.

Another option for speeding things up is building with GCC 4.4 instead of the 3.4.5 currently used.
Here's a download that does that for the adventurous:

http://all.faithpromotingstories.org/ruby_distros/ruby19_mingw_44.tgz

Anyway, watch this area as I'll post various ruby executables with different (faster) compiler options, and experimental like using tcmalloc, etc.
Thanks and good luck to all your windows+ruby users (like myself) out there!

Also much thanks to Luis and the one click group for making it possible to use these cool tools.

=r

Contributors

Followers