Monday, 2 September 2013

AS3/Flash: Calling a function MouseEvent from a datagrid click

AS3/Flash: Calling a function MouseEvent from a datagrid click

I'm calling a function by clicking a button:
searchBT.addEventListener(MouseEvent.CLICK,searchXML);
function searchXML(Event:MouseEvent)
I want to call the same function from a datagrid.
Right now, when clicking on the datagrid several dynamic text fields are
filled with the data of the clicked row.
I nead to perform the function (searchXML) at the same time. This and
other calls result in errors:
fullList.dataGrid.addEventListener(ListEvent.ITEM_CLICK, clickGrid);
function clickGrid(e:ListEvent):void
{
searchXML(Event);
...
}
Any idea?
Cheers.

Concurrency control with method invocation in EJB bean vs. Spring bean

Concurrency control with method invocation in EJB bean vs. Spring bean

EJB container serializes all business method invocations by default. And
we have a couple of options to change it.
Apply the @Lock(LockType.READ)/@Lock(LockType.WRITE) annotations.
Or set @ConcurrencyManagement(ConcurrencyManagementType.BEAN) annotation
on the bean class and use our custom synchronization policy (use
syncrnozied blocks or don't use locks at all if bean only reads data, for
example). The @Lock annotations is ignored in this case.
My question is how does Spring control it? How does it work be default?
Spring bean may be a stateless bean or may have a state. It can access
some resource with read or write operations. And in different situations I
need an option to control concurrency.
Could you please explain and compare this aspect of EJB/Spring containers.

How to unshard a collection on mongoDB?

How to unshard a collection on mongoDB?

I have created a collection on mongodb that is sharded on the wrong key. I
want to drop my collection and rebuild it so that it is sharded on the
right key.
Unfortunately doing db.removeCollection('mycollection') removes the data
but not some metadata info.
db.printShardingStatus still shows the sharding info I wrongly used for
mycollection, and if I create the collection again I can't shard it with
the new good key because it says "already sharded".
Any solution ?
Thanks
Thomas

Debug/Catch Trigger error

Debug/Catch Trigger error

I have a trigger on one of table for insert. I use C#'s BulkCopy feature
to insert millions of record in Temporary table without trigger and than I
transfer those record to main table using Insert into .. () select () frm
temptable syntax.
Main table has trigger, however I didn't get a good success on this, since
I get trigger to main table. it seems as one of record is causing an error
that force rollback of complete insert statement. How I find that culprit
row? Or maybe I am wrong then why it is failing most of time, but does
work with limit data set of row.
Is there anyway I can track or catch exception in Trigger working?

Offline Products and Services

Offline Products and Services

We are developing a new site and I'm keen to implement rich snippets and
more descriptive meta data.
My problem is that our products and services cannot be purchased directly
from the website as they are bespoke and custom built based on users
requirements. They also, therefore, don't have a price and stock level.
I notice from the Google guidelines that they state:
The product should be available for purchase directly on the page
My question is, what is the best and most appropriate way to use rich
snippets to describe these products and services? Can I use rich snippets
at all to describe these products and services?

How to multilevel numbering with PHP?

How to multilevel numbering with PHP?

Here is my code :
$datas = array(
array('id' => 1, 'parent' => 0, 'name' => 'Page'),
array('id' => 2, 'parent' => 1, 'name' => 'Page'),
array('id' => 3, 'parent' => 2, 'name' => 'Page'),
array('id' => 4, 'parent' => 3, 'name' => 'Page'),
array('id' => 5, 'parent' => 3, 'name' => 'Page'),
array('id' => 6, 'parent' => 1, 'name' => 'Page'),
array('id' => 7, 'parent' => 6, 'name' => 'Page'),
array('id' => 8, 'parent' => 0, 'name' => 'Page'),
array('id' => 9, 'parent' => 0, 'name' => 'Page'),
array('id' => 10, 'parent' => 9, 'name' => 'Page'),
array('id' => 11, 'parent' => 9, 'name' => 'Page'),
array('id' => 12, 'parent' => 11, 'name' => 'Page'),
);
//Recursive function
function generatePageTree($datas, $parent = 0, $limit=0){
$tree = '<ul>';
for($i=0, $ni=count($datas); $i < $ni; $i++){
if($datas[$i]['parent'] == $parent){
$tree .= '<li>';
$tree .= $datas[$i]['name'];
$tree .= generatePageTree($datas, $datas[$i]['id'], $limit++);
$tree .= '</li>';
}
}
$tree .= '</ul>';
return $tree;
}
echo(generatePageTree($datas));
?>
Please help me

Sunday, 1 September 2013

How to implement Locking Group Headers grid in extjs 3.4?

How to implement Locking Group Headers grid in extjs 3.4?


In extjs 4.2 , this feature has been implemented(as shown in the above
image.). but how to implement them in extjs 3.4?