我目前正在使用LightOpenID来允许用户登录我的网站,在那里我可以自动提取他们的用户名和电子邮件地址:
$openid->required = array('namePerson/first', 'namePerson/last', 'contact/email');
$openid->identity = 'https://www.google.com/accounts/o8/id';
Run Code Online (Sandbox Code Playgroud)
在这里我使用的参数namePerson/first,namePerson/last和contact/email.
我知道为了获得用户联系人列表,我必须使用feed:
https://www.google.com/m8/feeds
Run Code Online (Sandbox Code Playgroud)
但是,我似乎无法弄清楚我需要使用哪些参数?
如果我完全删除参数行,我只会得到一个空数组.
任何人都可以帮我弄清楚我需要哪些参数来获取联系人?
这是我目前的代码:
<?php
require '/var/www/libraries/openid.php';
try {
$openid = new LightOpenID;
if(!$openid->mode) {
//$openid->required = array('gd/fullName');
$openid->identity = 'https://www.google.com/m8/feeds/contacts/oshirowanen.y%40gmail.com/full';
header('Location: ' . $openid->authUrl());
exit;
} elseif($openid->mode == 'cancel') {
echo "cancelled";
exit;
} else {
if ( $openid->validate() ) {
$returned = $openid->getAttributes();
print_r($returned);
exit;
} else {
echo "something is wrong";
exit;
}
}
} catch(ErrorException $e) {
echo …Run Code Online (Sandbox Code Playgroud) 我有以下PHP代码,我想添加延迟:
<?php
echo "Message has been sent.";
header("Location: page2.php", true, 303);
exit;
?>
Run Code Online (Sandbox Code Playgroud)
上面的代码发生得太快,所以我看不到消息:
我试过了:
<?php
sleep(5);
echo "Message has been sent.";
header("Location: page2.php", true, 303);
exit;
?>
Run Code Online (Sandbox Code Playgroud)
这也没有显示消息,但它会睡5秒钟,这只是浪费时间.
在重定向之前,如何让它显示5秒钟的消息?
我有以下脚本,在Chrome中运行良好,但在IE8中运行不正常:
jQuery的:
$("<div class='divButtons'></div>").appendTo( $(".widget_header") );
$(".divButtons").text("321");
Run Code Online (Sandbox Code Playgroud)
CSS:
.divButtons { background:orange; display:none; }
.widget:hover .divButtons { display:block; }
Run Code Online (Sandbox Code Playgroud)
的jsfiddle:
这是一个完整的jsFiddle.
什么有效:
当我将鼠标悬停在a上时.widget,css会导致.divButtons显示.到目前为止都很好.当我移动.widget到另一个.widget并放开时,.widgets改变位置,.widget我正在盘旋的仍然显示.divButtons,一切都很好.如果我mouseout的一个.widget和hover在另一个.widget中,.divButtons消失在.widget我被hover荷兰国际集团和上上出现.widget我hover荷兰国际集团过去.到目前为止都很好.
问题:
IE8中的问题,在Chrome中没有发生,是当我hover超过a时.widget,这会导致我.divButtons出现在.widget我hover身上.如果我然后将它移动.widget到white屏幕的一部分,然后放开,我不再hover超过它.widget,但.divButtons仍然显示在.widget我放开. …
我不知道它是否有一个特殊的名称,但有一个很简单的方法来设置输入字段中的默认文本,如果文本框为空,它会在焦点上消失并重新出现在模糊上?
我有以下脚本:
但我似乎无法删除选项卡控件周围的浅灰色边框.这里有人知道怎么做吗?
我尝试过以下方法:
#tabs .ui-widget { border:none; padding:0px; margin:0px; }
#tabs .ui-widget-header { border:none; display:none; padding:0px; margin:0px; }
#tabs .ui-widget-content { border:none; padding:0px; margin:0px; }
Run Code Online (Sandbox Code Playgroud)
但这不起作用.
而不是使用input type="file"html标签,是否可以choose a file to upload通过单击input type="button"?来打开一个对话框?然后,当从choose a file to upload对话框中选择文件时,文件路径会插入到常规的html input type="text"标记中吗?
我似乎gmail做了类似的事情,但没有按钮和文本输入,他们只是有一个链接add file或类似的东西.单击该链接时,将显示该select file(s) to upload by mail.google.com对话框.单击文件时,屏幕上会显示文件名.
他们是怎么做到的?
更新:
我花了太多时间在这上面,并决定抛弃它并继续使用笨重的NetBeans.
原始问题:
我很难让xdebug与sublime text 2一起工作.
到目前为止我所做的是安装:
如果我然后用崇高打开一个php文件,然后按Shift + F8,在Xdebug的菜单,从中我可以弹出add/remove breakpoint和也start debugging.
一些PHP:

按shift + f8时菜单会下降:

调试开始:

在那张图片中它说:
Xdebug: No URL defined in project settings file
Run Code Online (Sandbox Code Playgroud)
Info.sublime-project包含:
{
"folders":
[
{
"path": "/var/www"
}
],
"settings": {
"xdebug": { "url": "http://localhost" }
}
}
Run Code Online (Sandbox Code Playgroud)
你可以从3截图中看到,我已开始调试,并没有任何反应,没有错误,没有浏览器窗口中打开,什么都没有.如果我手动导航到localhost/info.php,页面正常加载.如果我手动添加?XDEBUG_SESSION_START=sublime.xdebug到URL的末尾,localhost/info.php?XDEBUG_SESSION_START=sublime.xdebug并在浏览器上点击刷新,则页面正常加载,调试仍然无法启动.
我究竟做错了什么?
更新:有关端口的一些信息:
在尝试通过sublime text 2启动xdebug之前
oshirowanen@ubuntu:~$ netstat -antp
(Not all processes could be identified, non-owned process info
will not be …Run Code Online (Sandbox Code Playgroud) 目前,我有PHP代码,允许user1支付user2.如果user2登录到他/她的paypal帐户,他将refund在交易旁边看到一个按钮60天.
如果user2单击该refund按钮,我的PHP代码是否可以捕获和/或接收有关此退款事件的详细信息,即使所有这些都直接来自paypal网站?
我猜这是不可能的,但我发布这个问题的想法是我可能是错的,因为我不知道paypal的api就像我的手背.
题:
我似乎无法弄清楚为什么我收到下面的错误,即使SharePoint站点存在,以及被调用的文档库.文档库Lib1有文件/文件夹,文件库Lib2是空的.谁知道出了什么问题?
错误:
Get-SPWeb : Cannot find an SPWeb object with Id or Url : Lib1 and site Url https://sharepoint.oshirowanen.com/sites/oshirodev.
At C:\Users\Oshiro\Desktop\CopyDocs.ps1:31 char:23
+ $web = Get-SPWeb <<<< -Site $site -Identity $identity -ErrorAction Stop;
+ CategoryInfo : InvalidData: (Microsoft.Share....SPCmdletGetWeb:SPCmdletGetWeb) [Get-SPWeb], SPCmdletPipeBindException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetWeb
Run Code Online (Sandbox Code Playgroud)
脚本:
01 Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
02
03 function Get-SPList([uri]$url) {
04 # Nullify variables $site, $web and $list
05 $site = $web = $list = $null
06
07 # Get …Run Code Online (Sandbox Code Playgroud) 如果Cassandra和代码在同一台计算机上,则以下代码有效:
using System;
using Cassandra;
namespace CassandraInsertTest
{
class Program
{
static void Main(string[] args)
{
var cluster = Cluster.Builder()
.AddContactPoint("127.0.0.1")
.Build();
var session = cluster.Connect("test_keyspace");
session.Execute("INSERT INTO test_table (id, col1, col2) VALUES (1, 'data1', 'data2')");
Console.WriteLine($"Finished");
Console.ReadKey();
}
}
}
Run Code Online (Sandbox Code Playgroud)
假设如果代码在一台计算机上并且cassandra在另一台计算机上(不同的IP地址),则需要用户名和密码吗?所以我尝试了:
var cluster = Cluster.Builder()
.AddContactPoint("192.168.0.18") <- the ip address for the cassandra node
.WithPort(9042)
.WithCredentials("username to log into the cassandra node","password to log into the cassandra node")
.Build();
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
userone@desktop:~/Desktop/vsc$ dotnet run
Unhandled exception. Cassandra.NoHostAvailableException: All hosts tried …Run Code Online (Sandbox Code Playgroud) jquery ×4
php ×4
jquery-ui ×3
html ×2
javascript ×2
.net ×1
.net-core ×1
c# ×1
cassandra ×1
css ×1
ecmascript-5 ×1
google-api ×1
lamp ×1
lightopenid ×1
paypal ×1
paypal-ipn ×1
powershell ×1
sharepoint ×1
sublimetext ×1
sublimetext2 ×1
xdebug ×1