我有以下课程:
public class getURLData extends AsyncTask<String, Integer, String>{
@Override
protected String doInBackground(String... params) {
String line;
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(params[0]);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
line = EntityUtils.toString(httpEntity);
} catch (UnsupportedEncodingException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
} catch (MalformedURLException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
} catch (IOException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
}
return line;
}
@Override …
Run Code Online (Sandbox Code Playgroud) 我有一个使用mPDF的页面,当你运行时在浏览器中显示PDF,它也可以从这里保存为PDF没问题.我想要发生的是当页面运行并生成PDF,页面在服务器上保存为PDF.
这是当前的代码:
<?php
include $_SERVER['DOCUMENT_ROOT'].'/include/seo-check/lib/WSAclient.php';
include $_SERVER['DOCUMENT_ROOT'].'/include/seo-check/lib/WSAParser.php';
$reportID= $_GET['reportid'];
$WSAclient = new WSAclient(WSA_USER_ID,WSA_API_KEY);
$result=$WSAclient->viewReport($reportID,WSA_SUBSCRIPTION_ID,'xml','EN');
unset($WSAclient);
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PDF Report</title>
<!--Add your CSS here-->
</head>
<body>
<?php
echo WSAParser::viewReportResponse($result);
?>
</body>
</html>
<?php
$HTMLoutput = ob_get_contents();
ob_end_clean();
//Convert HTML 2 PDF by using MPDF PHP library
include $_SERVER['DOCUMENT_ROOT'].'/include/seo-check/lib/MPDF/mpdf.php';
$mpdf=new mPDF();
$mpdf->WriteHTML($HTMLoutput);
$mpdf->Output();
?>
Run Code Online (Sandbox Code Playgroud)
就像我说的那样输出PDF很好但是有人可以告诉我如何保存为PDF吗?
我正在开发一个应用程序,当它从onCreate点加载时,我只是有一个黑屏(直到应用程序站稳脚跟).看看其他应用程序,他们有一个公司徽标或酷炫的图像弹出几秒钟,有人可以告诉我该怎么做呢?
如果您可以将其设置为显示最短时间?
我正在努力寻找一个有效的解决方案wp_query
.我目前有一些分配给帖子的自定义设置,一个是帖子是否为"精选",第二个是帖子结束的日期和时间(不再显示在结果中).我有查询使用该功能,但只需要将此结束日期加入其中,这是查询工作查找与'特色':
WP_Query('meta_key=skyali_feature&showposts=4&orderby=post_date');
Run Code Online (Sandbox Code Playgroud)
结束日期在wp_postmeta
表中设置meta_key
为'the_date',meta_values
看起来像'05/16/2013 05:24'.我想编辑上面的查询,如果'the_date'已经设置,那么仅当'the_date'大于今天的日期和时间时才包含帖子.
这是我失败的尝试:
WP_Query(
'meta_key=skyali_feature&meta_key=the_date&meta_compare=>=&meta_value='
.date('d/m/Y H:i')
.'&showposts=4&orderby=post_date&orderby=the_date'
);
Run Code Online (Sandbox Code Playgroud) 我有一个运行 redux 和 thunk 的 React 应用程序,它一直运行良好。我需要在页面重新加载时保持存储状态,以便数据不会丢失,因此创建了一个将数据存储在 localstorage 中的函数,然后返回准备添加到 createStore 的数据(https://stackoverflow.com/a/ 45857898/801861)。数据存储工作正常并返回准备设置状态的对象。在 createStore 中添加数据对象时,反应无法编译并出现此错误:
错误:看起来您正在将多个商店增强器传递给 createStore()。这不受支持。相反,将它们组合成一个函数
这是当前代码返回错误:
const store = createStore(reducers, LoadState, applyMiddleware(thunk) );
//Error: It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function
Run Code Online (Sandbox Code Playgroud)
我正在运行的原始代码:
const store = createStore(reducers, applyMiddleware(thunk) );
Run Code Online (Sandbox Code Playgroud)
我试图在我在网上找到的一些类似问题之后解决这个问题,编译但破坏了最初工作正常的站点代码:
const composeEnhancers = LoadState || compose;
const store = createStore(reducers, composeEnhancers( applyMiddleware(thunk) ) );
//Error: Actions must be plain objects. Use custom …
Run Code Online (Sandbox Code Playgroud) 我有一个专用服务器,托管当前运行PHP 5.2的许多网站.我需要升级PHP版本,我被告知我可以使用此命令通过SSH执行此操作:
yum升级php
不,我有点担心更新和网站无法再运行,所以是否有可以使用的回滚命令,以便如果出现问题我可以快速更改回PHP 5.2?
非常感谢
我试图将自定义页面添加到客户的“帐户”部分,这将允许用户编辑其订单。目前,我已经能够设置URL的端点并进行提取,但是我需要让WooCommerce来启动页面布局并能够设置模板位置。
URL被称为:
/my-account/edit-order/55/
Run Code Online (Sandbox Code Playgroud)
这在functions.php
文件中,设置了终点并覆盖了模板:
// Working
add_action( 'init', 'add_endpoint' );
function add_endpoint(){
add_rewrite_endpoint( 'edit-order', EP_ALL );
}
// need something here to check for end point and run page as woocommerce
// Not been able to test
add_filter( 'wc_get_template', 'custom_endpoint', 10, 5 );
function custom_endpoint($located, $template_name, $args, $template_path, $default_path){
if( $template_name == 'myaccount/my-account.php' ){
global $wp_query;
if(isset($wp_query->query['edit-order'])){
$located = get_template_directory() . '/woocommerce/myaccount/edit-order.php';
}
}
return $located;
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助。
运行php artisan migrate
时,尝试在 mysql 中创建迁移表时出现错误:
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`id` int u
nsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default cha
racter set utf8 collate 'utf8_unicode_ci')
In Connection.php line 452:
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''
Run Code Online (Sandbox Code Playgroud)
这是完整的错误日志:
In Connection.php line 664:
[Illuminate\Database\QueryException (42000)]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect …
Run Code Online (Sandbox Code Playgroud) 我似乎遇到了很多让我的应用程序运行的问题... grrr
我目前的问题是,我有一个活动,我的应用程序的启动是一个可搜索的设施(通过Android快速搜索).搜索功能工作并启动我的SearchActivity类,其中显示结果,简单.
但是,当我尝试从结果活动(SearchActivity)搜索时,搜索框会弹出并接受放入,但SearchActivity从未接收到意图,或者它从未启动SearchActivity ...我不确定.
这是SearchActivity类(它使用与工作类相同的OnClickListener):
public class SearchActivity extends MapActivity implements OnGestureListener, OnDoubleTapListener {
public boolean touched = false;
private MapView mapView;
private MapController mapController;
private PlacesItemizedOverlay placesItemizedOverlay;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.mapView);
Button searchRequest = (Button)findViewById(R.id.searchRequest);
searchRequest.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onSearchRequested();
}
});
mapView.getController();
handleIntent(getIntent());
}
@Override
public boolean onSearchRequested() {
return super.onSearchRequested();
}
private void handleIntent(Intent intent) {
if (Intent.ACTION_SEARCH.equals(intent.getAction())) { …
Run Code Online (Sandbox Code Playgroud) 我创建了两个脚本,一个具有向上滑动和向下滑动的命令,这些命令在加载页面时对定时器起作用.第二个是单击事件,其中单击链接时执行slideup/down命令.这两个脚本分开工作,但我不能让它们一起工作.
这是定时的滑动/缩小脚本:
$(document).ready(function() {
$('.slide-out-div').hide();
$('.slide-out-div')
.delay(5000)
.slideDown(300);
$('.slide-out-div')
.delay(5000)
.slideUp(500);
});
Run Code Online (Sandbox Code Playgroud)
这是点击脚本:
window.onload = function() {
$(document).('#clickme').click(function () {
if ($('.slide-out-div').is(":hidden")) {
$('.slide-out-div').slideDown("slow");
} else {
$('.slide-out-div').slideUp("slow");
}
});
};
Run Code Online (Sandbox Code Playgroud)
这应该如何工作是当页面加载时,框几秒后滑下,然后如果没有使用框,它会在几秒后滑动.此时,可以单击链接以使框根据其当前位置向上或向下滑动.
任何帮助这两个组合工作的帮助非常感谢:)
android ×3
php ×3
wordpress ×2
account ×1
date ×1
endpoint ×1
image ×1
jquery ×1
laravel ×1
loading ×1
lumen ×1
manifest ×1
mpdf ×1
node.js ×1
onclick ×1
oncreate ×1
pdf ×1
plesk ×1
react-redux ×1
reactjs ×1
redux-store ×1
redux-thunk ×1
save ×1
search ×1
slide ×1
ssh ×1
string ×1
upgrade ×1
vagrant ×1
woocommerce ×1