Skip to content

Instantly share code, notes, and snippets.

View kattrali's full-sized avatar

Delisa kattrali

View GitHub Profile
@kattrali
kattrali / swt_menu_dispose.rb
Created August 25, 2010 03:23
Testing the Disposal of SWT resources
require 'java'
require 'swt.jar'
class SwtTest
include_package 'org.eclipse.swt.widgets'
import 'org.eclipse.swt.SWT'
def run
puts "Press Enter to Start"
#pause, in case you wan to attach a profiler
gets
shell = Shell.new(Display.new)
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for strncpy_s()... no
creating Makefile
make
gcc -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c win32/api.c
Error in command Redcar::Top::CloseWindowCommand
NoMethodError: undefined method `close' for nil:NilClass
/boutique/Code/redcar/plugins/application_swt/lib/application_swt/window.rb:215:in `closed'
/boutique/Code/redcar/plugins/application_swt/lib/application_swt/window.rb:60:in `to_proc'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `call'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `map'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:96:in `notify_listeners'
/boutique/Code/redcar/plugins/application/lib/application/window.rb:197:in `close'
Error in command Redcar::LineTools::LowerTextCommand
NativeException: org.eclipse.jface.text.BadLocationException: null
org/eclipse/jface/text/AbstractDocument.java:1145:in `replace'
org/eclipse/jface/text/AbstractDocument.java:1176:in `replace'
/boutique/Code/redcar/plugins/edit_view_swt/lib/edit_view_swt/document.rb:73:in `replace'
/boutique/Code/redcar/plugins/edit_view/lib/edit_view/document.rb:211:in `replace'
/boutique/Code/redcar/plugins/line_tools/lib/line_tools.rb:193:in `execute'
/boutique/Code/redcar/plugins/edit_view/lib/edit_view/document.rb:664:in `compound'
/boutique/Code/redcar/plugins/edit_view_swt/lib/edit_view_swt.rb:102:in `compound'
/boutique/Code/redcar/plugins/edit_view/lib/edit_view/document.rb:664:in `compound'
class MoveNextLineCommand < DocumentCommand
def execute
doc = tab.edit_view.document
line_ix = doc.line_at_offset(doc.cursor_offset)
if line_ix == doc.line_count - 1
doc.cursor_offset = doc.length
else
doc.cursor_offset = doc.offset_at_line(line_ix + 1) - doc.delim.length
end
doc.ensure_visible(doc.cursor_offset)
@kattrali
kattrali / Pair Highlighter error
Created October 18, 2010 12:43
random error while editing a document in redcar
*** ERROR in Document controller: <Redcar::PairHighlighter::DocumentController>
NativeException: java.lang.IllegalArgumentException: Index out of bounds
org.eclipse.swt.SWT:-1:in `error'
org.eclipse.swt.SWT:-1:in `error'
org.eclipse.swt.SWT:-1:in `error'
org.eclipse.swt.custom.StyledText:-1:in `redrawRange'
/boutique/Code/redcar/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb:71:in `clear'
/boutique/Code/redcar/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb:148:in `cursor_moved'
/boutique/Code/redcar/plugins/edit_view/lib/edit_view/document.rb:145:in `cursor_moved'
/boutique/Code/redcar/plugins/edit_view/lib/edit_view/document.rb:711:in `rescue_document_controller_error'
@kattrali
kattrali / delete_error
Created October 20, 2010 14:42
deletion to trash error on linux
Error in: menu item 'Delete'
Errno::EACCES: Permission denied - /boutique/Code/spidaweb/min/trunk/usersmaster/New File or /home/delisa/.local/share/Trash/files/New File
file:/home/delisa/.redcar/assets/jruby-complete-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:505:in `mv'
file:/home/delisa/.redcar/assets/jruby-complete-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:1396:in `fu_each_src_dest'
file:/home/delisa/.redcar/assets/jruby-complete-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:1412:in `fu_each_src_dest0'
file:/home/delisa/.redcar/assets/jruby-complete-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:1394:in `fu_each_src_dest'
file:/home/delisa/.redcar/assets/jruby-complete-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/fileutils.rb:494:in `mv'
/boutique/Code/redcar/plugins/project/lib/project/support/trash.rb:48:in `linux'
/boutique/Code/redcar/plugins/project/lib/project/support/trash.rb:12:in `recycle'
/boutique/Code/redcar/plugins/project/lib/project/adapters/l
@kattrali
kattrali / trace from reveal in project
Created October 25, 2010 20:11
RevealInProject error
Error in command Redcar::Project::RevealInProjectCommand
NoMethodError: undefined method `path' for nil:NilClass
/boutique/Code/redcar/plugins/project/lib/project/commands.rb:251:in `execute'
/boutique/Code/redcar/plugins/application/lib/application/command/executor.rb:29:in `execute'
/boutique/Code/redcar/plugins/application/lib/application/command.rb:83:in `run'
/boutique/Code/redcar/plugins/project/lib/project.rb:115:in `notebook_added'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `call'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `map'
/boutique/Code/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'
@kattrali
kattrali / classpath.groovy
Created October 27, 2010 18:24
A sample configuration file for loading the groovy class path for better syntax checking in redcar (with some grails mixed in). Save as [project]/.redcar/classpath.groovy
// classpath retriever for all jars in project "lib" folder and compiled classes in project
def GRAILS_VERSION = '1.3.7'
def redcar_config = new File(getClass().protectionDomain.codeSource.location.path).parentFile
def project = redcar_config.parentFile
def classpath = []
def home = System.getProperty("user.home")
def cache = new File(home+File.separator+".ivy2"+File.separator+"cache")
@kattrali
kattrali / lucene output
Created October 30, 2010 15:48
after searching a huge repo
Exception in thread "Thread-10" java.lang.OutOfMemoryError: Java heap space
at org.jruby.util.ByteList.<init>(ByteList.java:91)
at org.jruby.util.io.ChannelStream.readall(ChannelStream.java:365)
at org.jruby.RubyIO.readAll(RubyIO.java:2825)
at org.jruby.RubyIO.read(RubyIO.java:2641)
at org.jruby.RubyIO.read(RubyIO.java:3327)
at org.jruby.RubyIO$s_method_multi$RUBYINVOKER$read.call(org/jruby/RubyIO$s_method_multi$RUBYINVOKER$read.gen:65535)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrTwoOrThreeBlock.call(JavaMethod.java:548)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:160)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:66)