我正在尝试使用Safari在子域之间共享数据.我想使用HTML5数据库(特别是localStorage,因为我的数据只是键值对).但是,似乎无法从sub.domain.com访问存储到domain.com的数据(反之亦然).在这种情况下有没有办法共享一个数据库?
知道是否有办法获得滑动手势或触摸的长度,以便我可以计算距离?
我正在评估git-svn并尝试确定它与特定svn存储库的效果.我主要关心的是让git-svn执行合并,以便在subversion repo中正确设置svn:mergeinfo属性.这可能吗?
这是我到目前为止所做的:
# Checkout the SVN repo.
$ git svn clone svn://server/project1 -T trunk -b branches -t tags
# Make sure we are working on trunk.
$ git reset --hard remotes/trunk
# Modify the working copy.
$ vim file.txt
# Commit locally to the git repo.
$ git commit -a
# Push the commits back to the SVN server.
$ git svn dcommit
Committing to svn://server/project1/trunk ...
M file.txt
Committed r178
M file.txt
r178 = b6e4a3a0c28e7b9aa71d8058d96dcfe7c8a2b349 (trunk)
Run Code Online (Sandbox Code Playgroud)
现在,我将如何将该特定提交合并到一个subversion分支中?同样,对我来说非常重要的是git在提交更改时正确设置了svn:mergeinfo属性.
在我的应用程序中,我想向用户呈现一个全屏照片查看器,就像照片应用程序中使用的那样.这仅适用于单张照片,因此应该非常简单.我只是希望用户能够查看这张能够缩放和平移的照片.
我有大部分工作.而且,如果我不将UIImageView作为中心,那么一切都表现得非常完美.但是,当图像被充分缩小时,我真的希望UIImageView在屏幕上居中.我不希望它粘在滚动视图的左上角.
一旦我试图将这个视图居中,我的垂直可滚动区域似乎比它应该更大.因此,一旦我放大一点,我就能够滚动大约100像素超过图像的顶部.我究竟做错了什么?
@interface MyPhotoViewController : UIViewController <UIScrollViewDelegate>
{
UIImage* photo;
UIImageView *imageView;
}
- (id)initWithPhoto:(UIImage *)aPhoto;
@end
@implementation MyPhotoViewController
- (id)initWithPhoto:(UIImage *)aPhoto
{
if (self = [super init])
{
photo = [aPhoto retain];
// Some 3.0 SDK code here to ensure this view has a full-screen
// layout.
}
return self;
}
- (void)dealloc
{
[photo release];
[imageView release];
[super dealloc];
}
- (void)loadView
{
// Set the main view of this UIViewController to be a UIScrollView.
UIScrollView *scrollView …Run Code Online (Sandbox Code Playgroud) 我正在尝试update为git 编写一个钩子,如果子模块被更新为子模块的上游存储库中不存在的提交ID,则会跳转.换句话说,我想强制用户在将更改推送到子模块指针之前将更改推送到子模块存储库.
一个警告:
我一直在玩一个想法,但感觉必须有一个更好的方法来做到这一点.这是我计划在更新钩子中做的事情:
refs/heads/.如果没有,请尽早退出.git rev-list得到被推版本列表.git show <revision_id>并使用一个正则表达式,查看子模块是否已更新(通过搜索`+子项目提交[0-9a-f] +)..gitmodules特定commit(git show <revision_id>:.gitmodules)所看到的文件内容.cd到3.4中找到的路径并执行git rev-parse --quiet --verify <updated_submodule_commit_id>以查看该存储库中是否存在该提交.如果没有,则以非零状态退出.(注意:我相信3.2的结果可能会在修订版本中缓存,只要输出git rev-parse --quiet --verify <revision_id>:.gitmodules不会从一个修订版更改为下一个修订版.我将此部分留下来以简化解决方案.)
所以是的,这看起来相当复杂,我不禁想知道是否有一些内部git命令可能会让我的生活变得更轻松.或者也许有不同的方式来思考这个问题?
我正在尝试实现自定义视图.此视图应显示由灰色圆角矩形边框围绕的图像.我可以让图像显示得很好,以及边框,但是,由于边框有圆角,我需要一种方法来清除这些角落,以便它们正确显示视图后面的任何内容.我怎么能做到这一点?
好像我可以使用CGContextClearRect,但是我不能多次调用它,重建我圆角外的区域?这听起来过于复杂.
有没有更好的方法来创建此视图?
这是我目前的代码:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
// Draw the image. This will completely fill the current rect.
[image drawInRect:self.bounds];
// Ensure we draw completely within our bounds instead of straddling it.
CGRect rrect = self.bounds;
rrect.size.height = rrect.size.height - 1.0;
rrect.size.width = rrect.size.width - 1.0;
rrect.origin.x = rrect.origin.x + (1.0 / 2);
rrect.origin.y = rrect.origin.y + (1.0 / 2);
CGFloat radius = 5.0;
CGFloat minx = CGRectGetMinX(rrect);
CGFloat midx = CGRectGetMidX(rrect);
CGFloat maxx …Run Code Online (Sandbox Code Playgroud) iphone ×3
git ×2
arrays ×1
database ×1
dns ×1
drawing ×1
fullscreen ×1
gesture ×1
git-svn ×1
githooks ×1
hook ×1
html5 ×1
ios ×1
ipad ×1
javascript ×1
merge ×1
objective-c ×1
sorting ×1
subdomain ×1
svn ×1
uiimageview ×1
uiscrollview ×1