刚开始使用Roboguice for android.尝试实现这个简单的上下文注入但获得此异常.我搜索了它并遇到了不少帖子,但没有解决我的问题.这是下面的例外,任何想法?
提前致谢
02-05 00:14:54.330: I/dalvikvm(777): Failed resolving Lcom/google/inject/Provider; interface 627 'Ljavax/inject/Provider;'
02-05 00:14:54.330: W/dalvikvm(777): Link of class 'Lcom/google/inject/Provider;' failed
02-05 00:14:54.340: I/dalvikvm(777): Failed resolving Lcom/google/inject/Provider; interface 627 'Ljavax/inject/Provider;'
02-05 00:14:54.340: W/dalvikvm(777): Link of class 'Lcom/google/inject/Provider;' failed
02-05 00:14:54.361: I/dalvikvm(777): Failed resolving Lcom/google/inject/Provider; interface 627 'Ljavax/inject/Provider;'
02-05 00:14:54.361: W/dalvikvm(777): Link of class 'Lcom/google/inject/Provider;' failed
02-05 00:14:54.361: W/dalvikvm(777): VFY: unable to find class referenced in signature (Lcom/google/inject/Provider;)
02-05 00:14:54.370: I/dalvikvm(777): Failed resolving Lcom/google/inject/Provider; interface 627 'Ljavax/inject/Provider;'
02-05 00:14:54.370: …Run Code Online (Sandbox Code Playgroud) 我有以下代码用于开始会话并存储用户名/密码数据,如果没有提交任何内容,或者没有存储会话数据,则重定向到失败页面.
session_start();
if(isset($_POST['username']) || isset($_POST['password'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
}
if(isset($_SESSION['username']) || isset($_SESSION['password'])){
$navbar = "1";
$logindisplay = "0";
$username = $_SESSION['username'];
$password = $_SESSION['password'];
} else {
header('Location:http://website.com/fail.php');
}
$authed = auth($username, $password);
if( $authed == "0" ){
header('Location:http://website.com/fail.php');
}
Run Code Online (Sandbox Code Playgroud)
即使我提交了我的信息并将其存储在会话中,它也没有按照应有的方式工作,并且正在重定向我失败.难道我做错了什么?
注意在添加会话代码之前,authed功能正常工作.
您可以使用<equation>以及其他几个指定方程式,但必须使用哪个标记来指定代码?更具体地说,PHP,HTML,CSS和Javascript?是否有可以与OxygenXML一起使用的插件自动添加这些功能?我需要以PDF格式输出.
我试图使用APC或XCache作为操作码来缓存我的php页面.我正在使用它与Zend和Doctrine,它与自动加载器有问题.
如果我尝试使用APC,我会得到以下结果:
Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]:
Class Doctrine_Event could not be loaded in
C:\\[mydir]\\library\\doctrine\\Doctrine\\Record.php on line 777
Run Code Online (Sandbox Code Playgroud)
如果我尝试使用XCache,我会得到以下内容:
PHP Fatal error: Cannot redeclare class Zend_Registry in
C:\\[mydir]\\library\\zendframework\\Zend\\Registry.php on line 0
Run Code Online (Sandbox Code Playgroud)
我正在Windows机器上运行Zend 1.9.1,Doctrine 1.1.
我的引导程序如下:
set_include_path(dirname(__FILE__).'/../library/zendframework'
. PATH_SEPARATOR . dirname(__FILE__).'/../library/doctrine'.....
require 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->suppressNotFoundWarnings(false);
$loader->setFallbackAutoloader(true);
Run Code Online (Sandbox Code Playgroud)
从我所读到的,使用APC或xcache几乎是性能必须的,但我似乎无法让它工作.有任何想法吗?
我正在和Kohana一起开始使用PHPUnit.我的应用程序有许多控制器,它只是从某种形式获取数据,验证和插入/更新/删除到/ - /从数据库.我应该如何为此编写测试用例.
我知道如果我想测试一个函数,我会编写数据提供程序函数,只是将返回值与预期函数进行比较.但我的输入数据(来自表单的数据)正在$_POST变量中传递.我该怎么测试呢?之后,我应该检查插入的数据是否真的在数据库中?请给出我对这类测试的一些指导或链接到一些示例/教程.谢谢.
我在项目中使用phing进行一些自动构建过程,并且想知道:如何通过电子邮件获取完整日志?
当我phing通过命令行启动时,显示构建日志; 我会喜欢的 :
我已经phing将mail命令的输出用于管道,但是我想要一个适用于Linux和Windows的解决方案,并且不需要安装任何其他软件......
有没有人有想法?
作为旁注:我考虑过在构建结束时添加某种"报告"目标,但是:
我即将在我的项目中使用Zend_Paginator类.我在互联网上找到了班级的例子.其中之一是
$sql = 'SELECT * FROM table_name ';
$result = $db->fetchAll($sql);
$page=$this->_getParam('page',1);
$paginator = Zend_Paginator::factory($result);
$paginator->setItemCountPerPage(10));
$paginator->setCurrentPageNumber($page);
$this->view->paginator=$paginator;
Run Code Online (Sandbox Code Playgroud)
在第一行,它实际上从table_name中选择所有行.如果我有50000行的表怎么办?那将是非常低效的.
还有其他方法可以使用Zend Paginator吗?
当我运行脚本时,我收到以下错误...
我已将firefox位置粘贴到系统变量路径中...
仍然我收到以下错误:
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment
variable, or explicitly specify a path to Firefox 3 like this:
*firefox3c:\blah\firefox.exe
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
at com.example.tests.flightbooking.setUp(flightbooking.java:13)
at junit.framework.TestCase.runBare(TestCase.java:128)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at …Run Code Online (Sandbox Code Playgroud) 我想从我的应用程序安装apk文件.
我创建了一个包含按钮的应用程序,当我单击该按钮时,我应该安装另一个我存储在resources文件夹中的apk,这
是我做过的事情:
public void onClick(View v) {
// Intent intent = new Intent("com.google.zxing.client.android.SCAN");
// intent.setPackage("com.google.zxing.client.android");
// intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
// startActivityForResult(intent, 0);
File file = new File("android.resource://com.app.barcodescanner/raw", "scan.apk");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗 ?
请在这件事上给予我帮助
我想用ffmpeg在php中将视频转换为.flv.目前我有这个工作,但它挂起浏览器,直到文件上传并完成.我一直在查看关于如何在后台运行exec()进程的php文档,同时使用返回的PID更新进程.这是我发现的:
//Run linux command in background and return the PID created by the OS
function run_in_background($Command, $Priority = 0)
{
if($Priority)
$PID = shell_exec("nohup nice -n $Priority $Command > /dev/null & echo $!");
else
$PID = shell_exec("nohup $Command > /dev/null & echo $!");
return($PID);
}
Run Code Online (Sandbox Code Playgroud)
还有一个技巧,我用它来跟踪后台任务是否正在使用返回的PID运行:
//Verifies if a process is running in linux
function is_process_running($PID)
{
exec("ps $PID", $ProcessState);
return(count($ProcessState) >= 2);
}
Run Code Online (Sandbox Code Playgroud)
我想创建一个单独的.php文件,然后从php cli运行以执行其中一个函数?我只需要稍微轻推一下,然后我可以从那里拿走它.
谢谢!