invoking a call fom BB code - blackberry

I need to invoke a call from code how can i do it ?
I tried Phone arguements but it did not worked ?

PhoneArguments phoneArgs;
phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL,
lbl_Phone_value.getText());
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);

Related

how show action works in grails 2.3.0 controller

def show(Human humanInstance) {
respond humanInstance
//[Q1] In the above action humanInstance is works like Command object
//(I read it in grails doc) they said here call the Domain.get(id) but
//where the line [ Domain.get(id) ] written physically or where it executed when
//show call?
}
In 2.3.0 the line of code which invokes the “get” method for this particular scenario is at https://github.com/grails/grails-core/blob/v2.3.0/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java#L427.
Is that what you are looking for?

How to create a Dart Stream from a JavaScript listener

I would like to create a Stream which should contain the same elements like the callback in the following code:
chromeTabs['onUpdated'].callMethod('addListener',
[(tabId, changeInfo, tab) => print("tabId = $tabId")]);
I read the tutorials/articles from Chris Buckett and am not sure if it is possible to create a Stream elements at the moments when the first Consumer comes. In the code above, it would mean to get the javascript listener registered when the Dart Stream get listened.
The following code cannot work due to referencing to updateStreamController before it is being initialised:
var updateStreamController = new StreamController<int>(onListen: () =>
chromeTabs['onUpdated'].callMethod('addListener', [(tabId, changeInfo, tab) =>
updateStreamController.add(tabId)]);`
Unfortunately, the onListen property is only settable via the constructor.
Thanks in advance for your help
You can simply declare the variable before to initialize it :
var updateStreamController;
updateStreamController = new StreamController<int>(onListen: () =>
chromeTabs['onUpdated'].callMethod('addListener',
[(tabId, changeInfo, tab) => updateStreamController.add(tabId)]));

Symfony: issue with switching context

I am using Symfony 1.2 and I have some issues switching context.
This code was working fine:
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('account', 'prod', false);
$context = sfContext::createInstance($configuration, 'account-prod');
$userToLogin = PcUserPeer::retrieveByEmailAddress("myemail#example.com");
Auth::login($context->getUser(), $userToLogin, false, false);
echo "all done.";
At some point requirements changed and I needed to use the 'public' application before the 'account' one.
Then I changed to:
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
// {{{ new code:
$configuration = ProjectConfiguration::getApplicationConfiguration('public', 'prod', false);
sfContext::createInstance($configuration);
// some code using the public app...
// }}}
$configuration = ProjectConfiguration::getApplicationConfiguration('account', 'prod', false);
$context = sfContext::createInstance($configuration, 'account-prod');
// {{{ new code:
sfContext::switchTo('account-prod');
// }}}
$userToLogin = PcUserPeer::retrieveByEmailAddress("myemail#example.com");
CustomAuth::login($context->getUser(), $userToLogin, false, false);
echo "all done.";
Basically I added a switchTo call.
After the change, the code got broken and the error message is this:
PHP Fatal error: Call to a member function prepare() on a non-object in /var/www/html/myproj/symfony/storage/sfPDOSessionStorage.class.php on line 109
Thanks for your help,
Dan
Symfony is trying to load the session storage object. I suppose there is a problem with your new environment's configuration.
Check
/apps/public/config/factories.yml
Look for "storage" and try to find out how is it different from the other app's configuration.
Hard to know without a backtrace/more info what is triggering the error. It looks like you are using sessions stored in a database, and that a query related to that is failing.
Try setting the third argument to getApplicationConfiguration to true (which will turn debug on) and see if you get more output.
At a guess, it looks like the account app is using PDO session storage, and is failing to connect to the database or something?

RoR call prompt in rjs

in javascript i can call prompt like this
var retVal = prompt("Enter the new first name : ");
how can i call same prompt in rjs file
i used, page.prompt("Enter the new first name : ")
and its not working
page << "prompt('Enter the new first name:');"

How to send dtmf tones using BlackBerry API?

I have tried to use
PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL, num);
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);
PhoneCall call = Phone.getActiveCall();
call.sendDTMFTones(tones);
but it doesnt work.
Can anyone point me to a working code snippet for sending DTMF?
regards
Tom
Did you try sending them one at a time? Are you checking the return value of sendDTMFTones() ?
PhoneCall pc = new PhoneCall();
boolean added = pc.sendDTMFTone(7);

Resources