我必须在文档中遗漏一些东西,我认为这应该很容易......
如果我有一个坐标,并希望在某个方向上获得距离x米的新坐标.我该怎么做呢?
我正在寻找类似的东西
-(CLLocationCoordinate2D) translateCoordinate:(CLLocationCoordinate2D)coordinate
translateMeters:(int)meters
translateDegrees:(double)degrees;
谢谢!
我正在创建一个包含广告的UIWebView的应用程序.视图的大小与广告(图像)本身相同.尽管如此,在UIWebView内部还有一些白色边缘/填充在图像的左上方.查看链接的图片:

实际上,由于这种填充,图像也被向下推并向右推.
知道如何删除白色填充物吗?
提前致谢!
如果我想以编程方式生成一组按钮然后将这些按钮与IBActions相关联,该怎么办?如果我在Interface Builder中添加按钮很容易,但我不能为这种情况做.
我已经为表单中的输入字段定义了选项卡索引.当通过输入字段进行选项卡时,提交按钮永远不会获得焦点,页面上不同形式的一些其他输入字段将获得焦点.这些都有高于3的标签索引.为什么?
<form action="subscription.php" name="subscribe" method="post" onsubmit="return isValidEmailAndEqual()">
<p id="formlabel">E-mail</p> <input type="text" name="email1" tabindex=1>
<br/>
<p id="formlabel">Repeat e-mail</p> <input type="text" name="email2" tabindex=2> <br/>
<input id="inputsubmit" type="submit" value="Subscribe" tabindex=3>
</form>
Run Code Online (Sandbox Code Playgroud)
CSS:
input {
background-color : #333;
border: 1px solid #EEE;
color: #EEE;
margin-bottom: 6px;
margin-top: 4px;
padding: 1px;
width : 200px;
}
#inputsubmit {
background-color : #d7e6f1;
border: 1px solid #EEE;
color: #0000ff;
margin-bottom: 6px;
margin-top: 4px;
padding: 1px;
width : 200px;
}
#inputsubmit:hover {
cursor: pointer; cursor: hand;
background-color : #d7e6f1; …Run Code Online (Sandbox Code Playgroud) 我使用的是PHP 5.3,CentOS 6.2,httpd 2.2.15,NetBeans 7.0.1(通过ftp远程运行).
我想停止向浏览器打印错误消息,它足以打印到httpd的error_log.
我想通过try/catch我会自己决定如何处理错误,但它仍然会打印到error_log和浏览器.
function smic_gettext($phrase){
try{
$tr_text = $this->language_array[$phrase];
} catch(Exception $e){
error_log("Couldn't find any entry in the translation file for ".$phrase.". ".$e);
return $phrase;
}
return $tr_text;
}
Run Code Online (Sandbox Code Playgroud)
我应该如何配置以阻止此行为?
我试过在php.ini中设置display_errors = Off和display_errors = 0.没有区别(我确实重启了httpd).
我在xCode中进行了"构建和分析",并在我的init-method中将普通int设置为0时获得"空指针的取消引用".我在下面的代码中注意到我收到消息的行.我正在为iPhone开发.
Bric.m
#import "Bric.h"
@implementation Bric
- (id)initWithImage:(UIImage *)img:(NSString*)clr{
if (self = [super init]) {
image = [[UIImageView alloc] initWithImage:img];
}
stepX = 0; //It's for this line I get the message
stepY = 0;
oldX = 0;
color = [[NSString alloc]initWithString:clr];
visible = YES;
copied = NO;
return self;
}
@end
Run Code Online (Sandbox Code Playgroud)
Bric.h
#import <Foundation/Foundation.h>
@interface Bric : NSObject {
int stepX;
int stepY;
}
-(id)initWithImage:(UIImage *)img:(NSString *)clr;
@end
Run Code Online (Sandbox Code Playgroud)
这不是完整的代码,粘贴我认为有用的东西.
由于我没有使用指针,我发现这很奇怪.我怎么得到这个消息?
谢谢和问候,尼克拉斯
这是一个网上有很多信息的问题.不过,我还没有解决它.
我在网页上有一个动态加载的表单.我使用jquery $ .post提交它.我的页面适用于瑞典人,因此需要与åäö合作.
将数据发布到服务器时,它会将数据加载回新表.退回的åäö已损坏.示例åååäääööö=åååäääÃÃÃÃ
服务器端是php.我将所有返回内容的页面编码到浏览器中,如下所示:
<?php header('Content-type: text/html; charset=ISO-8859-1'); ?>
Run Code Online (Sandbox Code Playgroud)
我在服务器端尝试过utf8_encode和utf8_decode.实际上没有区别.
我试过这个:encodeURIComponent($(this).serialize())其中$(this)是要提交的表单.当然,这不起作用,我不知道如何编码像$(this)这样的对象.
我认为这是许多人所做的事情,但它似乎不是一个标准的解决方案.
因此,我需要帮助的是如何使用javascript/jquery/etc发布表单.并在服务器端处理它,返回它,并且它们看起来应该如此.如果服务器收到utf8,那就完全没问题了.原则应该只使用UTF8然后问题解决了吗?似乎应该有另一种解决方案.
我根据下面有一张桌子.第二行定义了三列,一列用,另一列colspan=8用colspan=1.仍然,根据colspan没有拉伸细胞,第二个细胞的"宽度"稍微多一点,第三个细胞的"宽度"最宽.
<table class="floating simpletable">
<tbody>
<tr><td colspan="10">1st row</td></tr>
<tr><td colspan="8">Column 1 -> Least wide</td><td colspan="1">2nd</td><td colspan="1">3rd</td></tr>
<tr><td colspan="10">3rd row</td></tr>
<tr><td colspan="1">1st cell</td><td colspan="9">4th row</td></tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
有什么问题以及如何解决?
我正在使用 jQuery 的模式对话框来打开包含表单的对话框。我无法解决的是如何将事件绑定到添加到我的模式对话框中的组件。在本例中,我想将单击或更改绑定到已位于对话框中的复选框。加载对话框时似乎没有触发任何成功方法。我就是这样做的:
我在 javascript 的开头、ready-function 的开头执行此操作:
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-modal" ).dialog({
autoOpen: false,
show: "blind",
hide: "explode",
minWidth: 400,
modal: true
});
Run Code Online (Sandbox Code Playgroud)
稍后,我在单击按钮时执行此操作:
$('#dialog-modal').dialog( "option", "title", lang.localized_text.ADD_AGENT);
$('#dialog-modal').live('dialogopen', function(msg){
alert("Opens");
$("#select_all").live('click', function(msg){
alert("clicked");
});
});
$.get("https://" + hostname + "/modules/core/useradmin/adminactivities/admin_add_agent.php",function(e){
var obj = $.parseJSON(e);
$("#dialog-modal").html(obj.html);
$("#dialog-modal").dialog("open");
addAddAgentValidation();
}
});
Run Code Online (Sandbox Code Playgroud)
可以清楚地看到在打开对话框之前出现了alert(“Opens”)。因此,dialogopen 在对话框完成加载之前被触发。但是验证处理程序(调用绑定验证检查的验证函数)可以工作。
警报(“点击”);永远不会被触发。
如何将任何事件绑定到模式对话框上的组件?对话框创建后是否有回调函数?
这个问题已被多次询问,但我找到的答案都没有帮助我.
我想让php file_exists()工作.它工作的唯一场景是当php文件与使用file_exist()的文件位于同一目录并且仅使用文件名(即排除路径)时.但这不是后续行为,请参阅下文.
索姆信息:
PHP:
echo getcwd()
clearstatcache();
$file = 'file:///var/www/html/smic/upload/28/ul.txt';
//Also tried like this
//$file = '/var/www/html/smic/upload/28/ul.txt';
if(file_exists($file)){
echo $file." exists";
}
Run Code Online (Sandbox Code Playgroud)
getcwd()打印/ var/www/html/smic/modules/core/ticket
php脚本和要检查的文件的权限是apache:apache 777.
有关目录结构的一些细节:
[root@localhost 28]# pwd
/var/www/html/smic/upload/28
[root@localhost 28]# ls -l ul.txt
-rw-r--r--. 1 apache apache 2 Feb 9 10:50 ul.txt
[root@localhost 28]# chmod 777 ul.txt
[root@localhost 28]# ls -l ul.txt
-rwxrwxrwx. 1 apache apache 2 Feb 9 10:50 ul.txt
Run Code Online (Sandbox Code Playgroud)
更改文件的权限后,行为未更改.目录/ 28有drwxr-xr-x.对于apache用户和apache组
为了测试,我还将实际的php脚本移动到/ 28,给它apache:apache 777 rigths.将$文件更改为"ul.txt"(即$ …
html ×4
iphone ×4
objective-c ×4
javascript ×3
php ×3
jquery ×2
linux ×2
xcode ×2
apache ×1
debugging ×1
encoding ×1
file-exists ×1
file-upload ×1
form-submit ×1
forms ×1
geolocation ×1
html-table ×1
ibaction ×1
location ×1
mapkit ×1
modal-dialog ×1
netbeans ×1
tabindex ×1
uiview ×1
uiwebview ×1
web ×1