小编noo*_*php的帖子

致命:无法读取"https://github.com"的用户名:没有这样的文件或目录

当我尝试在Windows上使用GIT Bash来提取代码时,我遇到以下问题

我已经尝试实现此处提供的已接受解决方案:

但问题仍然存在.添加/删除原点后,我仍然得到相同的错误.

fatal: could not read Username for 'https://github.com': No such file or directory
Run Code Online (Sandbox Code Playgroud)

git github git-pull git-bash

70
推荐指数
11
解决办法
13万
查看次数

怎么办左派加入学说?

这是我的功能,我试图显示用户历史记录.为此,我需要显示用户的当前信用以及他的信用记录.

这就是我想要做的:

 public function getHistory($users) {
    $qb = $this->entityManager->createQueryBuilder();
    $qb->select(array('a','u'))
            ->from('Credit\Entity\UserCreditHistory', 'a')
            ->leftJoin('User\Entity\User', 'u', \Doctrine\ORM\Query\Expr\Join::WITH, 'a.user = u.id')
            ->where("a.user = $users ")
            ->orderBy('a.created_at', 'DESC');

    $query = $qb->getQuery();
    $results = $query->getResult();

    return $results;
}
Run Code Online (Sandbox Code Playgroud)

但是,我收到此错误:

[语法错误]第0行,第98行:错误:预期的Doctrine\ORM\Query\Lexer :: T_WITH,"开启"

编辑:我在join子句中用'WITH'替换'ON',现在我看到的只是加入列中的1个值.

php doctrine-orm zend-framework2

53
推荐指数
1
解决办法
11万
查看次数

使用ZF2强制下载

我正在尝试使用ZF2强制下载.这是我的代码的片段

 use Zend\Http\Request;
 .....
   public function downloadAction() {
     $response = new Request();
    $response->setHeaders(Request::fromString("Content-Type: application/octet-stream\r\nContent-Length: 9\r\nContent-Disposition: attachment; filename=\"ultimate_remedy_readme.txt\""));


}
Run Code Online (Sandbox Code Playgroud)

现在我收到了这个错误

/var/www/whowantsmymoney/vendor/zendframework/zendframework/library/Zend/Http/Request.php:88
Run Code Online (Sandbox Code Playgroud)

信息:

A valid request line was not found in the provided string
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

#0 /var/www/whowantsmymoney/module/Admin/src/Admin/Controller/LanguageController.php(93): Zend\Http\Request::fromString('Content-Type: a...')
Run Code Online (Sandbox Code Playgroud)

force-download zend-framework2

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

Uncaught SyntaxError:无法在'Window'上执行'postMessage':调用'postMessage'时无效的目标原点'my_page'

我有以下脚本

父页面(pair_pixel_filter.php):

 window.addEventListener("message", function(e) {
            $('#log').append("Received message: " + (e.data));
        }, false);
 $('.photo-upload-btn').click(function(event) {
            event.preventDefault();
            window.open($(this).attr("href"), "popupWindow", "width=600,height=600,scrollbars=yes");
        });
Run Code Online (Sandbox Code Playgroud)

儿童页面

$.ajax({
            type: 'post',
            url: url,
            data: {
                base64data: dataURL
            },
            success: function(data) {
                window.opener.postMessage(data, "pair_pixel_filter.php");
                window.close(); }
        });
Run Code Online (Sandbox Code Playgroud)

基本上打开Popup然后在弹出窗口上做一些ajax并将结果返回给父级.但是从Child我得到了这个错误.

未捕获的SyntaxError:无法在'Window'上执行'postMessage':调用'postMessage'时无效的目标原点'pair_pixel_filter.php'

javascript jquery postmessage cross-browser

17
推荐指数
1
解决办法
4万
查看次数

无法找到目标实体"某个实体"

我正在使用带有学说的ZF2我收到了这个错误.

在'Subject\Entity\Subject#user'中找不到目标实体Entity\User.

这是我的代码的片段.

<?php

namespace Subject\Entity;

use Doctrine\ORM\Mapping as ORM;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
/** 

* @ORM\Entity

* @ORM\Table(name="subject")

* @property string $subjectname

* @property int $user_id

* @property int $id

*/
 class Subject implements InputFilterAwareInterface {

  protected $inputFilter;
 /**

 * @ORM\Id

 * @ORM\Column(type="integer");

 * @ORM\GeneratedValue(strategy="AUTO")

 */
protected $id;
/**

 * @ORM\Column(type="string")

 */
protected $subjectname;

/**
 * @ORM\ManyToOne(targetEntity="Entity\User", inversedBy="subjects")
 * @var User|null
 */
private $user;

/** @return User|null */
public function getUser() {
    return …
Run Code Online (Sandbox Code Playgroud)

php doctrine zend-framework2

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

to_date 无法解析 Spark 3.0 中的日期

我正在尝试使用解析日期,to_date()但出现以下异常。

SparkUpgradeException: 由于 Spark 3.0 升级,您可能会得到不同的结果:Fail to parse '12/1/2010 8:26' in the new parser。您可以将 spark.sql.legacy.timeParserPolicy 设置为 LEGACY 以恢复 Spark 3.0 之前的行为,或者设置为 CORRECTED 并将其视为无效的日期时间字符串。

例外情况表明我应该使用旧版时间解析器,首先我不知道如何将其设置为旧版。

这是我的实现

dfWithDate = df.withColumn("date", to_date(col("InvoiceDate"), "MM/dd/yyyy"))
Run Code Online (Sandbox Code Playgroud)

我的日期采用以下格式

+--------------+
|   InvoiceDate|
+--------------+
|12/1/2010 8:26|
|12/1/2010 8:26|
|12/1/2010 8:26|
|12/1/2010 8:26|
|12/1/2010 8:26|
Run Code Online (Sandbox Code Playgroud)

apache-spark apache-spark-sql pyspark spark3

13
推荐指数
4
解决办法
8907
查看次数

Jquery文件上传插件如何获取从服务器发送的响应

我正在使用https://github.com/blueimp/jQuery-File-Upload提供的jquery文件上传插件 现在问题是我正在返回我刚刚上传的匹配图像的图像路径,如果遵循格式.

["upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg"]
Run Code Online (Sandbox Code Playgroud)

现在我无法弄清楚我怎么能得到这个响应.我的意思是通常ajax响应可以在success函数内获取,但我无法弄清楚以下上传器中的类似函数在哪里.

javascript jquery file-upload blueimp jquery-file-upload

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

在Windows,Linux和Mac上为同一图像创建不同的哈希值

我正在使用以下代码创建哈希值,现在发生的情况是,当我在Windows本地Xampp服务器上测试哈希值时,我得到的哈希值对于在Linux上运行的相同代码是不同的.

  move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newname);
    "Stored in: " . "upload/" . $_FILES["file"]["name"];
    $image = "upload/" . $newname;
    $sign = md5(file_get_contents($image));
Run Code Online (Sandbox Code Playgroud)

现在我不知道为什么会这样.对于我上面粘贴的相同代码.

编辑:再次打开问题.我发现的解决方案仅适用于Linux,这意味着Linux和Windows现在给我相同的哈希值,但是当从Mac(IOS)上传图像时,它仍然生成不同的哈希.

php linux windows hash ios

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

使用Doctrine和ZF2进行分页

我正在尝试使用ZF2和Doctrine实现分页.

我在这里尝试做的是从关联表中获取数据,让我们说'xyz'.

我的类别表在其自己的PK上进行一对多的自引用.我的catgories表有以下的feilds

  • ID(PK)
  • Created_at
  • Category_id(自引用PK)

我的XYZ表让我们说它名为Name表

  • ID(PK)
  • CATEGORY_ID(FK)
  • 名称
  • 详情

这就是我想要获取数据的方法

      public function allSubcategories($id, $column, $order) {
 $repository = $this->entityManager->getRepository('Category\Entity\Category');
    $queryBuilder = $repository->createQueryBuilder('category');
    $queryBuilder->distinct();
    $queryBuilder->select('category');

    $queryBuilder->join('Category\Entity\CategoryName', 'category_name', 'WITH', 'category.id = category_name.category');
    $queryBuilder->orderBy("category.status");
    $q = $queryBuilder->getDql();
    return $query = $this->entityManager->createQuery($q);
}
Run Code Online (Sandbox Code Playgroud)

在我的控制器中,这就是我在做的事情

      public function subcategoryAction() {

    ///////////////////////////InPut Params Given for the pagination
    $category_id = (int) $this->params()->fromRoute('id', 0);
    $page = (int) $this->params()->fromRoute('page', 0);
    $column = $this->params()->fromQuery('column');
    $order = $this->params()->fromQuery('order');



    $categoryModel = $this->getServiceLocator()->get('Category');
    $categoryModel->category = $category_id;


    $perPage = 10;
    $request = $this->getRequest(); …
Run Code Online (Sandbox Code Playgroud)

php doctrine-orm zend-framework2

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

如何针对AWS Cognito用户池进行身份验证

我创建了一个Cognito用户池.我可以列出用户并使用Java AWS SDK中的AWSCognitoIdentityProviderClient添加用户.

但是,我有一个自定义登录页面,我希望输入输入的用户名和密码,并对我的用户池进行身份验证.我没有在Java AWS SDK中看到任何可以传递凭据并从中获取身份验证结果的地方.

编辑:我无法通过此错误:

NotAuthorizedException:配置中缺少凭据

相关代码:

    AWS.config.region = 'us-east-1';
    AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: 'us-east-1:087a3210-64f8-4dae-9e3c...' // your identity pool id here
    });

    AWSCognito.config.region = 'us-east-1';
    AWSCognito.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: 'us-east-1:087a3210-64f8-4dae-9e3c...' // your identity pool id here
    });

    var poolData = {
        UserPoolId: 'us-east-1_39RP...',
        ClientId: 'ttsj9j5...',
        ClientSecret: 'bkvkj9r8kl2ujrlu41c7krsb6r7nub2kb260gj3mgi...'
    };
    var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);

    var authenticationData = {
        Username: 'test@foo.com',
        Password: 'foobarfoo',
    };
    var authenticationDetails = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData);
    var userData = {
        Username: 'test@foo.com',
        Pool: userPool
    }; …
Run Code Online (Sandbox Code Playgroud)

javascript amazon-cognito

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