Roger's woze

June 30, 2008

google optimizer woe

Filed under: Uncategorized — rogerdpack @ 9:23 pm

unable to get your javascript to work right on your conversion page?  Make sure it’s AFTER the html and body and everything.

Maybe that will help, or also remember that it might not be letting it get to that page, if it relies on post data.

June 27, 2008

ruby get host name and ip

Filed under: Uncategorized — rogerdpack @ 5:46 am

Socket.getaddrinfo(Socket.gethostname, nil, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME).select{|type| type[0] == ‘AF_INET’}[0][3] # ltodo hmm we don’t want it to do the reverse lookups!

there it is :)

June 26, 2008

EM segfaults on exit in multi threaded environment

Filed under: Uncategorized — rogerdpack @ 10:06 pm

./lib/em/lib/eventmachine.rb:235: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i486-linux]

or

Illegal instruction

for me meant “it seems that EM does call backs during its process loop.  During these callbacks the EM thread itself can spontaneously “jump” to do its release_machine [for example, if there's an uncaught exception, or if the root thread terminates, of if you call Thread.raise on it].  This means that during its release_machine, its Descriptor array is in a half-terminated state.

To overcome it: go to em.cpp and change the logic to just substitute in the end one when it fails.

rails [active record] optimization links

Filed under: Uncategorized — rogerdpack @ 3:21 am

http://dev.rubyonrails.org/ticket/2172

appears to be one.
http://dev.rubyonrails.org/ticket/10978 was already committed.

So…we need to find the bottleneck, and fix that bottleneck. Fix it. As in fix it.

todo: override :find and :find_by_sql and also output ‘this long creating AR stuffs!’ per request lol.

Investigate 11000 hash calls.

Use it with mfp, not the big one! no!!!!!

trivial erb takes .0002[1]

[1]http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/

June 25, 2008

html ajax replace a div within a select

Filed under: Uncategorized — rogerdpack @ 5:43 pm

turns out it isn’t possible. At least with prototype. So move your div to surround the select, instead. rails

June 24, 2008

eventmachine illegal instruction

Filed under: Uncategorized — rogerdpack @ 10:08 pm

meant [once again] I was using a rubyeventmachine.so file that was newer than the code in the lib directory. My bad.

ruby install woe

Filed under: Uncategorized — rogerdpack @ 8:07 pm

So…you bust open a new copy of Hardy Heron [ubuntu] and apt-get install ruby, then install an extension and it dies?

Example:

/usr/bin/ld: crt1.o: No such file: No such file or directory

or

checking for main() in -lpthread… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

when compiling a gem from source?

Well this means that you need to install some c headers:

apt-get install libc6-dev

and it should work

happened to me with eventmachine.

virtualbox woe

Filed under: Uncategorized — rogerdpack @ 6:17 pm

so…you’re on mac os x and you install ubuntu on your virtualbox and then…networking doesn’t work at all?  Like at all?  No IP Address?

1) go to devices | network adapters and make sure device 0 is checked

run wget google.com

should work

if not

run

sudo dhclient #might help — restarts your dhcp

June 23, 2008

how to install rmagick on 64 bit system

Filed under: Uncategorized — rogerdpack @ 11:53 am

http://rubyforge.org/tracker/?func=detail&atid=134&aid=20372&group_id=12

gives one helpful pointer [for me].
Also googling or the title might lead some valuable insights.
-R

June 18, 2008

bamboo on os x woe

Filed under: Uncategorized — rogerdpack @ 11:06 pm

Exception in thread “main” java.lang.UnsatisfiedLinkError: /Users/rogerpack/dev/bamboo/lib/darwin/libdb_java-4.2.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1739)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at com.sleepycat.db.db_javaJNI.(db_javaJNI.java:36)
at com.sleepycat.db.DbEnv.(DbEnv.java:1081)
at bamboo.db.StorageManager.init(StorageManager.java:737)
at bamboo.lss.DustDevil.init_nodes(DustDevil.java:138)
at bamboo.lss.DustDevil.main(DustDevil.java:281)
at bamboo.lss.DustDevil.main(DustDevil.java:184)
at bamboo.lss.DustDevil.main(DustDevil.java:338)

this meant “follow this post to a t:
http://bamboo-dht.org/pipermail/bamboo-users/2006-July/000787.html”
but at the end copy
cd .libs; cp libdb_java-4.2.* ../../../bamboo/lib/darwin/
and works!

Older Posts »

Powered by WordPress