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.
September 30, 2010
how to compile ruby with increased garbage size
September 28, 2010
scripting java
use jruby: http://kenai.com/projects/jruby/pages/CallingJavaFromJRuby
or scala:
jruby bugs removed
for posterity sake, here’s the stuff i removed from the wiki:
====Under OSX I get this error when trying to execute jruby: ”Exception in thread ‘main’ java.lang.NoClassDefFoundError: org/jruby/Main” ====The source of this problem is the inclusion of <tt>’.'</tt> (current directory) in your $PATH. You’re also trying to execute JRuby from <tt>$JRUBY_HOME/bin</tt>. There’s a bug in the JRuby bash script that prevents this from working.
To correct the issue, remove <tt>’.'</tt> from your $PATH and relaunch the shell. Alternately, if you really want to keep <tt>’.'</tt> in your $PATH (which you shouldn’t, but see google for reasons why), then just change your working directory to something other than <tt>$JRUBY_HOME/bin</tt> and execute the <tt>jruby</tt> command. It should launch just fine. % cd /any/path/other/than/jruby_home % jruby # should work
”’Note:”” This bug has been fixed in JRuby 1.2.
September 23, 2010
java how to paint text over an image
http://www.java-forums.org/java-2d/11484-simple-text-image-save.html
Appears that you load your image, then create a new other image (BufferedImage, we’ll call it), paint your first image onto that, then add the text onto the top of that.
Graphics2D drawImage doesn’t draw anything, or draws black
you may be needing to wait for the image to load before you can use it to paint your graphics2d with it
graphics2d shows up as black by default
this means “the default color is black–or possibly just random garbage — paint over it”
jruby jframe image
Here it is:
rmagick collage
Here’s how to combine two images into one (a “collage”)
require ‘rubygems’require ‘RMagick’include Magick
image_name = ‘johnpack1.jpg’
image_1 = Image.read(image_name).firstimage_2 = Image.read(image_name).first
image_2.crop_resized!(10,10)
image_1.composite!(image_2, 1 * 100 + rand(15), 150 + rand(15), OverCompositeOp)image_1.write(‘collage.jpg’)
ref:
http://weare.buildingsky.net/2006/10/18/render-greatlooking-collages-with-ruby-and-rmagick
rmagick woe
September 22, 2010
vlc build woes
CC liblua_plugin_la-net.lolibs/net.c: In function ‘vlclua_fd_write’:libs/net.c:249:5: error: implicit declaration of function ‘write’libs/net.c: In function ‘vlclua_fd_read’:libs/net.c:259:5: error: implicit declaration of function ‘read’make[6]: *** [liblua_plugin_la-net.lo] Error 1make[6]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc/modules/misc/lua’make[5]: *** [all] Error 2make[5]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc/modules/misc/lua’make[4]: *** [all-recursive] Error 1make[4]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc/modules/misc’make[3]: *** [all] Error 2make[3]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc/modules/misc’make[2]: *** [all-recursive] Error 1make[2]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc/modules’make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/c/dev/ruby/downloads/juhovh_vlc’make: *** [all] Error 2
meant “disable lua–something is not quite right in there [mingw videolan]“