Thứ Hai, 11 tháng 1, 2010

Submit forms to a new window

Submit Form to a new Window? Sound easy.
Not easy to me until I found this link
http://classicasp.aspfaq.com/forms/how-do-i-submit-forms-to-a-new-window-with-window-open-features.html

That link does help me.

Thứ Năm, 7 tháng 1, 2010

jQuery treeview plugin: Drag n Drop support

I'm using jquery treeview plugin and I want to add drag & drop feature by using
Drag n Drop of interface
Here the code so far ( from source ).
$('span.folder').Droppable(
{
accept : 'file',
hoverclass : 'dropOver',
activeclass : 'fakeClass',
tollerance : 'pointer',
onhover : function(dragged)
{

},
onout : function()
{

},
ondrop : function(dropped)
{

var $dropped = $(dropped);
var $parent = $dropped.parent();
$parent.removeClass("last");
// try to remove first

$("#browser").treeview({
remove: $parent
});
var $this= $(this);
var container = $this.next();
$("span").appendTo("#foo");
var branches = $parent.prependTo("#"+container.attr("id"));

$("#browser").treeview({
add: branches
});
// recall droppable
$drag.DraggableDestroy(); (1)
$drag.Draggable( (2)
{
revert : true,
autoSize : true,
ghosting : true
}
);
}

}
);
var $drag = $('span.file,span.folder').Draggable(
{
revert : true,
autoSize : true,
ghosting : true
}
);
}
);

(1) (2) After dragging one file item to a folder, I can not drag it again. So I played a trick by destroy current dragable object and init it again.
It is not cool. But I don't know how to overcome this.

The example here works well. Any help?

Realtime web - A look at Orbited, ActiveMQ and Rails

update soon ....

Thứ Bảy, 2 tháng 1, 2010

Echowaves sucessfully install

After two hours try-and-error, I successfully set up Echowaves.
It's a setup tasks. What do I do next?
+ Authlogic
+ OAuth
+ Sphinx
+ Workling and Starling
+ thinking-sphinx ( Sphinx easily in Rails)
+ rake tasks

linux, tip #1

Sometimes, I want to build library from source, and with option --prefix, I install those libs elsewhere from /usr/local/bin.
One problem is we can't explicitly call >>some_command_under_lib_bin.
To achieve using ln -s /bin/* /usr/local/bin
for example, when I install Sphinx
ln -s /home/pilgrim/opt/tools/sphinx/bin/* /usr/local/bin

Sqlite3: UT8 support in migration in Rails?

Got the error:
"Migration error: Unsupported database for migration to UTF-8 support"
When trying to migrate data in Rails by using sqlite3.
Change db to mysql. It's ok but sql3 may contain error.
Use two links below may help ( not try it yet)
http://snippets.dzone.com/posts/show/6070
or
http://woss.name/blog/2006/10/25/migrating-your-rails-application-to-unicode.html

Install EventMachine 0.12.10, Karmic

Trying to install EventMachine in Karmic Ubuntu ( Ruby 1.8.8-dev)
Got the error:
cannot stat `rubyeventmachine.so'
How to fix?
By following link: Fix C build

The details are
+ locate rbconfig.rb
--- /usr/local/lib/ruby/1.8/i686-linux/rbconfig.rb
+ add
CONFIG["CXX"] = "/usr/bin/g++"

It works. Thanks community

Workling + Memcache error

Try to setup Echowaves, got the message error.
uninitialized constant MemCache

A workaround solution is
Goto vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb
add require 'memcache'

Just don't know why the error occur, it's basic. I tried to get the latest workling plugin. But no help.
!!!!
Anyway, add require 'memcache'. It works.