我需要针对数据库中的日期时间测试当前时间,如果已经30分钟则执行代码,如果不是则不执行.这就是我所处的地方,我被困住了:
$link = mysqli_connect("hostname", "username", "password", "database");
$q = "SELECT id FROM dwCache ORDER BY id DESC LIMIT 1";
$qu = mysqli_query($link, $q);
while($row=mysqli_fetch_array($qu, MYSQL_ASSOC)){
$id = $row['id'];
$cache = $row['cache'];
$timest = $row['time'];
}
$newTime =
$difference = $timest
if($timest >= )
Run Code Online (Sandbox Code Playgroud)
你可以看到底部我失去了它,因为我不知道该怎么做.
$timest返回:2013-02-01 12:36:01作为格式Y-m-d h-i-s
双重道歉,其他删除.
是否可以通过以下方式进行宽松:
('#sideBar').hide('slide', {direction: 'right' },
800, function(){...});
Run Code Online (Sandbox Code Playgroud)
目前它非常紧张,因为它可能会移动100到500像素(取决于内容).我一直在寻找谷歌和大多数人说使用缓和,但在查看文档时我看不到一个缓和的属性.
我创建了一个values-fr和values-es和values.
内容values是英文,但对于每个字符串我收到此错误:
<string name="cancel">Cancel</string>
Run Code Online (Sandbox Code Playgroud)
它说:"cancel" is translated here but is not found in default locale我不确定这意味着什么.
values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation" tools:locale="en">
<string translatable="false" name="app_name">Kendal Mintfest</string>
<string name="action_settings">Settings</string>
<string name="itin_string">Itinerary</string>
<string name="event_string">Events</string>
<string name="info_string">Info!</string>
<string name="filerText">Note: Turning this option on will show only results on the selected day on the hour you select.</string>
<string-array name="time_filter_array">
<item>Friday 30th August</item>
<item>Saturday 31st August</item>
<item>Sunday 1st September</item>
</string-array>
<color name="Pink">#EC008B</color>
<string name="okay">Okay</string> …Run Code Online (Sandbox Code Playgroud) 我有一个我无法在任何地方找到的问题,我看到一个正则表达式方法,但是在变量中使用直接字符串而不是字符串.这是我的代码:
var src = getQueryVariable("srcStr");
if(src != false){
$(".entry-content").html($(".entry-content")
.html().replace(/src/g, "<span style='background-color:#f2e128;'>"
+ src + "</span>"));
}
Run Code Online (Sandbox Code Playgroud)
这将获取一个url变量(srcStr)并在.entry-content中搜索文本正文,以查找var中存储的字符串src.
问题代码在这里: replace(/src/g
有解决方案吗?
我将我的应用程序提交到使用位置服务(GPS点)的应用程序商店,MKPinAnnotations并且不会对地图使用任何其他内容,并且从我研究的内容看起来路由覆盖文件用于覆盖?
我不认为我需要一个路由覆盖文件,但是当我去发布时,xcode错误说它在Itunes Connect中丢失了.
该应用程序的类别是Utilities.这也是导航,但我解开了这个,希望它能解决问题,但事实并非如此.
我怎么能绕过这个?
应用程序加载和EventFragment.java显示地图的视图.当您单击另一个选项卡片段时,它会正常加载,当您返回到第一个选项卡(地图)时,它会崩溃并出现以下错误:
07-03 14:13:54.640: E/AndroidRuntime(11565): FATAL EXCEPTION: main
07-03 14:13:54.640: E/AndroidRuntime(11565): android.view.InflateException: Binary XML file line #5: Error inflating class fragment
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-03 14:13:54.640: E/AndroidRuntime(11565): at co.uk.thesomewhere.townpearlfest.EventFragment.onCreateView(EventFragment.java:48)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1264)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:672)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
07-03 14:13:54.640: E/AndroidRuntime(11565): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
07-03 14:13:54.640: E/AndroidRuntime(11565): …Run Code Online (Sandbox Code Playgroud) 我在woocommerce中有3个自定义字段:
物质参考号,发票号和处理案件的请求者(代码接下来,如果你不想看到它只是向下滚动,它不重要)
add_action('woocommerce_after_order_notes', 'matter_reference_number_func');
function matter_reference_number_func( $checkout ) {
echo '<div id="matter_ref"><h3>'.__('Matter reference number').'</h3>';
woocommerce_form_field( 'matter_reference_number', array(
'type' => 'text',
'class' => array('my-field-class form-row-wide'),
'placeholder' => __('Matter reference number'),
), $checkout->get_value( 'matter_ref_num' ));
echo '</div>';
}
add_action('woocommerce_after_order_notes', 'invoice_number_func');
function invoice_number_func( $checkout ) {
echo '<div id="inv_num"><h3>'.__('Invoice number').'</h3>';
woocommerce_form_field( 'invoice_number', array(
'type' => 'text',
'class' => array('my-field-class form-row-wide'),
'placeholder' => __('Invoice number'),
), $checkout->get_value( 'invoice_num' ));
echo '</div>';
}
add_action('woocommerce_after_order_notes', 'sol_deal_func');
function sol_deal_func( $checkout ) {
echo '<div id="sol_deal"><h3>'.__('Solicitor dealing with …Run Code Online (Sandbox Code Playgroud) 我有以下文件:
annotation.h:
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface annotation : NSObject <MKAnnotation>
@property(nonatomic, assign) CLLocationCoordinate2D coordinate;
@property(nonatomic, copy) NSString *title;
@property(nonatomic, copy) NSString *subtitle;
@end
Run Code Online (Sandbox Code Playgroud)
annotation.m:
#import "annotation.h"
@implementation annotation
@synthesize coordinate, title, subtitle;
@end
Run Code Online (Sandbox Code Playgroud)
在主代码中,它在NSURL其他地方找到了:
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[spinner stopAnimating];
// json parsing
results = [NSJSONSerialization JSONObjectWithData:data options:nil error:nil];
NSMutableArray * locations = [[NSMutableArray alloc] init];
CLLocationCoordinate2D location;
annotation * myAnn;
NSArray *pins = mapView.annotations;
if ([pins count])
{
[mapView removeAnnotations:pins];
}
/* loop through the array, …Run Code Online (Sandbox Code Playgroud) 是否可以添加额外的属性MKPointAnnotation?目前有coordinate,title和subtitle.
是否可以添加一个url可以访问的属性-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ },就像我可以访问一样[annotation title];?
我想在android中做一个Map View(从iOS迁移).在android SDK pannel中我安装了谷歌API(API 17),我希望能解决这个问题.所以在我的源代码中我有:
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
Run Code Online (Sandbox Code Playgroud)
它给了我错误:The import com.google cannot be resolved.我搜索了谷歌的结果,但他们没有工作(大多数都确保安装了谷歌API.
我使用从Android开发站点下载的Eclipse ADT 64位Macbook Pro.
在AndroidManifest.xml我有的文件中:
<uses-library android:name="com.google.android.maps" />
Run Code Online (Sandbox Code Playgroud) 我尝试过一些没有用过的东西(我想到的更多东西).
使用时[self dismissViewControllerAnimated:YES completion:nil];我需要它来运行viewDidLoad我要回到的控制器的方法.
我怎样才能做到这一点?我想也许在completion那里,它会访问viewDidLoad这个类,而不是我恢复的那个.
我正在构建一个wordpress插件,用于学习原因,这是有问题的代码:
// display latest facebook posts
// Init a cURL resource
$ch = curl_init("https://www.facebook.com/feeds/page.php?format=rss20&id=133869316660964");
curl_setopt( $ch, CURLOPT_POST, false );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
// Make facebook think it is being accessed by a browser to avoid compatability issues
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
curl_setopt( $ch, CURLOPT_HEADER, false );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$data = curl_exec( $ch );
// instanciate a new xml element
$fb = new SimpleXMLElement($data);
$i = 0; // …Run Code Online (Sandbox Code Playgroud) 我在清单文件中拆分了操作栏,如下所示:
android:uiOptions="splitActionBarWhenNarrow"
Run Code Online (Sandbox Code Playgroud)
哪个工作正常,但res/menu底栏上的菜单操作按钮(in )在灰色背景上.
我已经尝试了各种方法来改变它并使底部栏变蓝.顶部操作栏按预期为蓝色,但底部是默认灰色,我无法更改它.
该 styles.xml
<resources>
<color name="blue">#3D589B</color>
<color name="black">#000000</color>
<style name="CustomActionBarTheme"
parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabBarStyle">@style/MyActionBarbackgroundSplit</item>
<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
<item name="android:icon">@android:color/transparent</item> <!-- This does the magic! -->
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/blue</item>
<item name="android:backgroundStacked">@color/blue</item>
</style>
<style name="MyActionBarbackgroundSplit"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/blue</item>
<item name="android:backgroundStacked">@color/blue</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
使用图标更改底栏的合适样式是什么?
android ×4
ios ×4
java ×4
objective-c ×3
php ×3
cocoa-touch ×2
eclipse ×2
html ×2
javascript ×2
jquery ×2
foreach ×1
fragment ×1
google-maps ×1
loops ×1
mapkit ×1
wordpress ×1
xcode ×1
xml ×1