有人可以向我解释如何使用facebook app_data,这是签名请求的一部分吗?
http://developers.facebook.com/docs/authentication/signed_request/
文件含糊不清.我无法弄清楚如何实际使用app_data字段.我希望能够在将应用程序数据添加到页面时将其传递给应用程序,以便显示在其上的内容与Facebook页面相关.
例如,我希望我的网站上的用户个人资料只显示在该用户的Facebook页面上.为此,我想在用户将应用添加到其页面时将用户ID发送到fb签名请求.然后,只要访问页面,我将拉取应用程序数据并运行一些php来显示正确的配置文件.
我可以使用app_data执行此操作,还是这不可能?
我正在组建一个简单的网络站点,并希望 URL 的工作方式类似于 facebook,因此通过输入 domain.com/username 我将获得一个用户配置文件。我已经可以这样做了
登录用户个人资料
domain.com/
Run Code Online (Sandbox Code Playgroud)
其他用户个人资料在
domain.com/home/username
Run Code Online (Sandbox Code Playgroud)
默认控制器称为 home,我目前正在使用 _remap 函数检查额外的 url 参数,以根据传递或未传递的内容显示不同的数据。
我的问题是如何将其映射出来,以便我可以通过以下方式访问用户配置文件:
domain.com/username
Run Code Online (Sandbox Code Playgroud)
有我可以使用的 routes.php 设置吗?访问?
我正在使用SOAP Web服务,我需要将信息从应用程序级别(我的主要客户端类)传递到客户端处理程序级别以进行进一步评估.我在下面列出了我的客户端和我的客户端处理程序.我想扫描用户的值并存储在Handler中的"discountVal"变量中,以便我可以向SOAPHeader添加文本节点.
客户:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package client;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.handler.PortInfo;
/**
*
* @author Jack
*/
public class Client
{
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
client.ItemPriceServiceService service = new client.ItemPriceServiceService();
service.setHandlerResolver(new ClientHandlerResolver());
client.ItemPriceService port = service.getItemPriceServicePort();
String discount = "25";
Scanner scan = new …Run Code Online (Sandbox Code Playgroud) 我正在进行任务,我收到此错误:
错误1可访问性不一致:参数类型 'MexWcfService.MyComplex' 大于法 'MexWcfService.Calculator.complex_sum(MexWcfService.MyComplex,MexWcfService.MyComplex)' E不易进入:\北环学院\ CSC615\lab8\MexWcfService\MexWcfService \计划. cs 75 26 MexWcfService
以下是我的代码.我的问题出现在..public MyComplex complex_sum(MyComplex a,MyComplex b)的接口实现类中...
有人可以帮助我.我是C#的新手,更不用说带有元数据交换端点的WCF.任何指针都将非常感激.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.ServiceModel.Description;
namespace MexWcfService
{
[DataContract]
class MyComplex
{
int real;
int im;
public MyComplex(int real, int im)
{
Real = real;
Im = im;
}
[DataMember]
public int Real
{
get { return real; }
set { real = value; }
}
[DataMember]
public int Im
{
get { …Run Code Online (Sandbox Code Playgroud) 我将如何翻转数组并建立所有值和键之间的关系?例如:
我想把这个转过来:
Array (
[11913] => Array (
[0] => 4242
[1] => 3981
)
[9878] => Array (
[0] => 2901
[1] => 3981
)
[11506] => Array (
[0] => 3981
[1] => 2901
)
)
Run Code Online (Sandbox Code Playgroud)
进入:
Array (
[3981] => Array (
[0] => 11506
[1] => 9878
[2] => 11913
)
[2901] => Array (
[0] => 11506
[1] => 9878
)
[4242] => Array (
[0] => 11913
)
)
Run Code Online (Sandbox Code Playgroud)
是否有任何PHP功能已经自动执行此操作?如果不是什么方法可以解决这个问题?似乎无法绕过它.
我将如何转换
List list= new ArrayList();
Run Code Online (Sandbox Code Playgroud)
至
String [] profArr= {};
Run Code Online (Sandbox Code Playgroud)
我试过了
profArr = list.toArrary()
and
profArr = (String [])list.toArrary()
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
Run Code Online (Sandbox Code Playgroud)
我也试过了
String [] profArr= (String [])list.toArray(new String[0]);
Run Code Online (Sandbox Code Playgroud)
我收到此错误:请求的资源()不可用.
以下是我创建列表的方法:
static List decode(int x)
{
List power2List = new ArrayList();
if (x < 0)
throw new IllegalArgumentException("Decode does not like negatives");
while (x > 0)
{
int p2 = Integer.highestOneBit(x);
x = x - p2;
power2List.add(p2);
}
return power2List;
}
List list= new ArrayList(); …Run Code Online (Sandbox Code Playgroud) java ×2
php ×2
arraylist ×1
arrays ×1
c# ×1
codeigniter ×1
facebook ×1
handler ×1
list ×1
mex ×1
soap ×1
string ×1
url-routing ×1
wcf ×1
web-services ×1