Roger's woze

February 27, 2010

copy an hwnd

Filed under: Uncategorized — rogerdpack @ 12:50 am

http://groups.google.com/group/ruby-ffi/browse_thread/thread/ff20fdb3ec612585

explains why you really can’t

#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6da8ac2c, pid=4112, tid=3368

Stack: [0x00030000,0x00230000],  sp=0x0022f1ac,  free space=2044k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

V  [jvm.dll+0x1dac2c]

j  sun.misc.Unsafe.getInt(J)I+0

j  com.kenai.jffi.MemoryIO$UnsafeImpl.getInt(J)I+4

j  org.jruby.ext.ffi.jffi.NativeMemoryIO.getInt(J)I+9

#<FFI::Pointer:0xe2ade0>

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68: [BUG] Segmentation fault

ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]

– control frame ———-

c:0006 p:—- s:0021 b:0021 l:000020 d:000020 CFUNC  :get_pointer

c:0005 p:0013 s:0017 b:0017 l:000016 d:000016 METHOD E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68

c:0004 p:0042 s:0014 b:0013 l:000012 d:000012 METHOD bad.rb:17

c:0003 p:0049 s:0006 b:0006 l:0025ac d:00172c EVAL   bad.rb:27

c:0002 p:—- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:0025ac d:0025ac TOP

—————————

– Ruby level backtrace information—————————————–

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68:in `get_pointer’

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68:in `read_pointer’

bad.rb:17:in `go’

bad.rb:27:in `<main>’

[NOTE]

You may encounter a bug of Ruby interpreter. Bug reports are welcome.

For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way.

Please contact the application’s support team for more information.

E:\dev\digitalarchive_trunk.trunk>ruby bad.rb

#<FFI::Pointer:0xe2ae80>

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45: [BUG] Segmentation fault

ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]

– control frame ———-

c:0006 p:—- s:0021 b:0021 l:000020 d:000020 CFUNC  :get_int32

c:0005 p:0013 s:0017 b:0017 l:000016 d:000016 METHOD E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45

c:0004 p:0042 s:0014 b:0013 l:000012 d:000012 METHOD bad.rb:17

c:0003 p:0049 s:0006 b:0006 l:0025ac d:00172c EVAL   bad.rb:27

c:0002 p:—- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:0025ac d:0025ac TOP

—————————

– Ruby level backtrace information—————————————–

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45:in `get_int32′

E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45:in `read_int’

bad.rb:17:in `go’

bad.rb:27:in `<main>’

February 26, 2010

maven shared test code woe

Filed under: Uncategorized — rogerdpack @ 9:13 pm
INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.familysearch.digitalarchive:utilities:jar:tests:2.2-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.familysearch.digitalarchive -DartifactId=utilities -Dversion=2.2-20100226.195131-9 -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.familysearch.digitalarchive -DartifactId=utilities -Dversion=2.2-20100226.195131-9 -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
  	1) org.familysearch.digitalarchive:tapeutilities:jar:2.2-SNAPSHOT
  	2) org.familysearch.digitalarchive:utilities:jar:tests:2.2-SNAPSHOT

----------
1 required artifact is missing.

for artifact:
  org.familysearch.digitalarchive:tapeutilities:jar:2.2-SNAPSHOT

from the specified remote repositories:
  fch (http://mvn.usys.org:8082/nexus/content/groups/dev)

meant "when you have classifier scope tests in order to share test code across modules, apparently you have to do a maven install on those packages
before they can be used by others"

February 25, 2010

gnuplot Too many using specs for this style

Filed under: Uncategorized — rogerdpack @ 6:26 pm

This message meant

plot ‘-’ using 1:3:2:6:5, ‘-’ using 1:4
is disallowed, but
plot ‘-’ using 1:3:2:6:5 with candlesticks  , ‘-’ using 1:4  with lines
is allowed

ruby how to delete a file without checking that it’s there first

Filed under: Uncategorized — rogerdpack @ 5:52 pm
File.delete ‘single.pdf’ if File.exist? ‘single.pdf’

becomes

FileUtils.rm_f  ’single.pdf’

February 24, 2010

freeware disk benchmark utility with random seek writes

Filed under: Uncategorized — rogerdpack @ 10:26 pm

http://crystalmark.info/software/CrystalDiskMark/index-e.html

enjoy

where to download swt.jar

Filed under: Uncategorized — rogerdpack @ 12:18 am

http://www.eclipse.org/swt/

it’s right there…

February 23, 2010

ruby ffi woe

Filed under: Uncategorized — rogerdpack @ 7:47 pm
top.rb:27:in `GetWindowThreadProcessId’: :pointer argument is not a valid pointer (ArgumentError)
from top.rb:27:in `<main>’

top.rb:27:in `GetWindowThreadProcessId’: :pointer argument is not a valid pointer (ArgumentError)        from top.rb:27:in `<main>’

meant “you can’t pass 0 for a pointer param–gotta use nil or FFI::MemoryPointer.new(0)”

git how to revert a single commit without having to use “git-revert”

Filed under: Uncategorized — rogerdpack @ 12:08 am

So say you accidentally do some commit and just want all history of it gone…

Here’s how.

git-revert won’t work, because it just rewrites that “dumb” commit, but backward.  It creates a new commit. Now your problem has doubled in terms of embarrassment.

So here’s what you do.  Assuming all the “other” (good) commits have been committed to some branch, like origin/master. If not create some other branch, merge in up to the point where you things headed south.

Checkout the commit “before” the commit you want to ignore.

$ git co some_other_temp_branch

delete the offending (now tainted) branch–in this case we’ll call it master.

$ git b rm -D master

re-create the local master (without the offending)

$ git b -f master origin/master

done.

You may have some do some other finagling in there to perserve other commits you haven’t pushed to origin/master, but there it is.  If you have pushed offending commits already to origin/master, you’re probably stuck, unless nobody has checked out those commits yet, then you might could delete the foreign branch, and push another “new” clean version in its place.

http://github.com/guides/remove-a-remote-branch

http://stackoverflow.com/questions/495345/git-removing-selected-commits-from-repository

February 22, 2010

ruby woe

Filed under: Uncategorized — rogerdpack @ 11:37 pm
E:\dev\ruby\old\windows_ionice\bin>ruby -c windows_ionice
windows_ionice:11: syntax error, unexpected tIDENTIFIER, expecting kTHEN or ‘:’ or ‘\n’ or ‘;’
puts ‘–reset-to-normal-after-awhi…

E:\dev\ruby\old\windows_ionice\bin>ruby -c windows_ionicewindows_ionice:11: syntax error, unexpected tIDENTIFIER, expecting kTHEN or ‘:’ or ‘\n’ or ‘;’  puts ‘–reset-to-normal-after-awhi…

meant “you have mixed line endings in your file and ruby is getting all confused”

how to upload a file to pastie.org

Filed under: Uncategorized — rogerdpack @ 7:25 pm

You may notice that there is no “upload file” option within pastie.

However, the “right” way is to pipe it into some program that will upload it for you, instead of piping output to a file and uploading that file.

See http://pastie.org/help/ on the right hand side.

Older Posts »

Powered by WordPress