小编max*_*ax_的帖子

致命:./config中'core.sharedrepository'的配置错误

我刚输入命令:git config core.sharedrepository 1我现在收到错误:

致命:./config中'core.sharedrepository'的配置错误

有谁知道如何解决它?

git

9
推荐指数
2
解决办法
1万
查看次数

由于内存错误,应用程序仅在iOS8上崩溃

我正在尝试生成图表并逐个截取屏幕截图.该应用程序正常工作一次然后当我第二次尝试再次捕获屏幕截图时,应用程序崩溃说应用程序因内存错误而终止.这只发生在iOS8而不是iOS7中.这里捕获屏幕截图的代码,它在线崩溃 - [view.layer renderInContext:context]; 应用程序在高峰使用时使用124 MB,并且在崩溃之前没有生成内存警告.即使没有其他应用程序在后台运行,应用程序也会在iOS 8上崩溃.如果我注释掉上面的行,那么应用程序根本不会崩溃,但截图不是完整的屏幕.

- (BOOL)captureView:(UIView *)view forGraph:(NSString *)graphName
{

BOOL isImageCpatured = NO;

@try {
    CGRect rect = view.bounds;
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [view.layer renderInContext:context];
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    CGImageRef imageRef;

    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
        imageRef = CGImageCreateWithImageInRect([img CGImage], CGRectMake(0, 113, 1024, 532));
    }
    else {
        imageRef = CGImageCreateWithImageInRect([img CGImage], CGRectMake(0, 93, 1024, 532));
    }

    img = nil;

    UIImage *image = [UIImage imageWithCGImage:imageRef];
    CGImageRelease(imageRef);        
    NSData *pngData = UIImagePNGRepresentation(image);

    [pngData writeToFile:[Utility_Class documentsPathForFileName:[NSString stringWithFormat:@"%@BG.png",graphName]] atomically:YES];

    pngData = …
Run Code Online (Sandbox Code Playgroud)

memory objective-c ipad ios ios8

9
推荐指数
1
解决办法
1120
查看次数

创建一个for循环以向数组添加39个按钮

我的.h文件中有39个不同的UIButton变量,但我想将它们中的每一个添加到一个数组中,而不必输入相同的39次.

有没有办法可以在for循环中执行此操作?

按钮的名称相应:btn1,btn2,btn3等.

iphone xcode loops objective-c uibutton

8
推荐指数
2
解决办法
1万
查看次数

MySQL - 选择10位最新作者中的每一位作者的最新帖子

我有一张包含许多不同作者的博客文章的表格.我想做的是显示最近10位作者的最新帖子.

每个作者的帖子都按顺序添加到表中,这意味着单个作者可能会发布帖子.我有点时间想出一个查询来做到这一点.

这给了我最后10个唯一的作者ID; 它可以用作子选择来抓取每个作者的最新帖子吗?

SELECT DISTINCT userid
FROM posts
ORDER BY postid DESC 
LIMIT 10
Run Code Online (Sandbox Code Playgroud)

mysql

8
推荐指数
1
解决办法
1436
查看次数

用PHP上传最大大小?

是否可以使用PHP上传~100 MB文件?

如果是这样,配置文件(php.ini)中需要进行哪些更改?

斯里兰卡

php ini uploading

7
推荐指数
2
解决办法
3万
查看次数

将页面重定向到另一页面5秒钟,然后重新定向

我正在尝试将页面重定向到另一个页面,这是成功的.但是,我正在尝试将第一页重定向到另一个包含广告的页面.然后,此页面将在五秒后重定向到另一个页面.

我这样做是想做到这一点:

<?php
include('ads.php');
?>
<?php 
sleep(2);
$url = $_GET['url'];
header("Location: ".$url."");
exit;
?>
Run Code Online (Sandbox Code Playgroud)

然而,它ads.php完美地显示了广告,但它在5秒后没有重定向.我在网络浏览器中收到此错误:

Warning: Cannot modify header information - headers already sent by 
(output started at /home/nucleusi/public_html/adverts/ads.php:1)
in /home/nucleusi/public_html/adverts/index.php on line 7
Run Code Online (Sandbox Code Playgroud)

我将重定向的典型链接是:

http://domain.com/adverts/index.php/?url=http%3A%2F%2Fitunes.apple.com%2Fmx%2Falbum%2Fstill-got-the-blues%2Fid14135178%3Fi%3D14135158

php redirect

7
推荐指数
1
解决办法
4776
查看次数

CodeIgniter - 无法加载请求的类

是的,我想你想要说这个问题可能是重复的,但不是因为类似问题的答案并没有解决我目前遇到的问题.

我在自动加载名为"phpass"的库时收到以下错误,如下所示.

遇到错误无法加载请求的类:Phpass

用于自动加载库的代码

$autoload['libraries'] = array('database', 'phpass');
Run Code Online (Sandbox Code Playgroud)

phpass.php文件驻留在application/libraries文件夹中,并且声明该类class phpass意味着该问题与大写或文件路径无关,正如我遇到的大多数其他答案中所建议的那样.

请你告诉我我错过了什么?它在MAMP中运行良好,但是,当上传到我的Linux Ubuntu服务器(Apache2)时,它停止工作.

谢谢,

最大.

编辑--- Utku请求的构造方法

class phpass {

    protected $PasswordHash;

    // default values if config was not found
    protected $iteration_count_log2 = 8;
    protected $portable_hashes = FALSE;

    /**
     * Construct with configuration array
     * 
     * @param array $config
     */
    public function __construct($config = array()) {
        // check if the original phpass file exists
        if (!file_exists($path = dirname(__FILE__) . '/../vendor/PasswordHash.php')) {
            show_error('The phpass class file was not found.');
        } …
Run Code Online (Sandbox Code Playgroud)

php codeigniter autoload

7
推荐指数
1
解决办法
6万
查看次数

在UIView周围创造一个光晕

我想在UIView周围绘制一个发光的边框,距离实际的UIView本身大约是5px.

请问你能告诉我怎么做到这一点?

iphone xcode objective-c quartz-graphics ios4

6
推荐指数
1
解决办法
8042
查看次数

TableView Footer正在滚动表格

我刚刚在tableView的页脚中实现了"加载更多"按钮,但页脚始终与表格一起滚动.我的tableView的样式是UITableViewStylePlain.

请你能告诉我哪里出错了.

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *footerView = nil;
    if(footerView == nil) {
        footerView  = [[[UIView alloc] init] autorelease];
        footerView.backgroundColor = [UIColor clearColor];
        UIButton *button = [[UIButton alloc] init];    
        button.layer.cornerRadius = 7;
        [button setFrame:CGRectMake(10, 3, 300, 44)];
        [button setTitle:@"Load 20 more" forState:UIControlStateNormal];
        [button.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];
        [button setBackgroundColor:[UIColor whiteColor]];
        [button.titleLabel setTextColor:[UIColor blackColor]];
        [button addTarget:self action:@selector(load20More) forControlEvents:UIControlEventTouchUpInside];
        [footerView addSubview:button];
        [button release];
    }
    if ([songInfo count] > 20 && count < 100) {
        return footerView;
    }
    else
        return nil;
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview

6
推荐指数
1
解决办法
6865
查看次数

从PHP urldecoded字符串中删除所有反斜杠

我试图从URL解码的字符串中删除所有反斜杠,但它输出\而不是输出已删除的url解码字符串.

请你告诉我我的问题.

<?php
$json = $_GET['ingredients'];
echo urldecode(str_replace($json,$json, "\\"));
?>
Run Code Online (Sandbox Code Playgroud)

php urldecode str-replace

6
推荐指数
1
解决办法
3万
查看次数