问题列表 - 第43160页

GameCenter邀请处理程序

试图实现多人游戏.使用Game Center中的示例- 发送和接收数据.

一切似乎都没问题,但在苹果文档中也有关于邀请处理程序的说法.

[GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {
   // Insert application-specific code here to clean up any games in progress.
   if (acceptedInvite) {
        GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithInvite:acceptedInvite] autorelease];
        mmvc.matchmakerDelegate = self;
        [self presentModalViewController:mmvc animated:YES];
    } else if (playersToInvite) {
        GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
        request.minPlayers = 2;
        request.maxPlayers = 4;
        request.playersToInvite = playersToInvite;

        GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
        mmvc.matchmakerDelegate = self;
        [self presentModalViewController:mmvc animated:YES]; …
Run Code Online (Sandbox Code Playgroud)

multiplayer objective-c invite game-center

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

在WPF ListBox中禁用键盘导航

如何在不使用鼠标禁用选择的情况下禁用WPF ListBox中的键盘导航?

.net c# keyboard wpf listbox

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

web.Config与数据库设置表

当您拥有多个应用程序,Web服务和Windows服务的系统时,哪个更好?

选项1)将所有设置放在数据库表中并将其缓存到某个地方,可能您必须使用Web服务跨应用程序共享缓存对象.然后,您可以在网格中查看其中一些设置以供用户操作.

选项2)将所有设置放在一个公共配置文件中,让每个应用程序的web.config或app.config指向该文件,我相信有一种方法可以将这些设置放在网格中,但可能你会丢失"显示基于角色的设置"的功能.

谢谢

architecture asp.net settings

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

Objective-c:查看背景图案

是否可以在视图中具有可以重复x或y或两者的模式(例如网格)?有点像css:

background-image:url(pattern.png); background-repeat:重复; //或者重复-x,重复-y,不重复;

background view objective-c

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

使用Python解析JSON文件 - > google map api

我试图在Python中开始使用JSON,但似乎我误解了JSON概念中的一些东西.我按照google api示例,工作正常.但是当我在JSON响应中将代码更改为较低级别时(如下所示,我尝试访问该位置),我收到以下代码的以下错误消息:

回溯(最近一次调用最后一次):
文件"geoCode.py",第11行,在
<module>
test = json.dumps中([s ['location']为s在jsonResponse ['results']],indent = 3)KeyError:'地点'

如何在python中访问JSON文件中的较低信息级别?我是否必须转到更高级别并搜索结果字符串?这对我来说似乎很奇怪?

这是我试图运行的代码:

import urllib, json
URL2 = "http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false"
googleResponse = urllib.urlopen(URL2);
jsonResponse = json.loads(googleResponse.read())
test = json.dumps([s['location'] for s in jsonResponse['results']], indent=3)
print test
Run Code Online (Sandbox Code Playgroud)

python api parsing json google-maps

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

RoutingError页面404

ActionController::RoutingError当用户尝试访问非现有路由时,我有一个例外.如何将用户重定向到404.html页面或在该页面上呈现错误?

例如:当我尝试访问https://github.com/someuser时,我在该URL上获得了404页面.

我在应用程序控制器中尝试过这个但没有成功:

rescue_from ActionController::RoutingError do |exception|
  render '/public/404.html'
end
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-on-rails-3

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

JSF转换器时间戳

我想将输入转换为时间戳值.

我在例子中只找到了一个日期转换器.有没有最佳做法?

谢谢


更新:

我想保存用户的生日,但我的后端需要时间戳值.我将它绑定到我的jsf前端有问题..

也许一个例子的链接会很有帮助:-)

我尝试了如下:

public void setBday(Date bday) {
            member.setBirthday(new Timestamp(bday.getTime()));
        }
        public Timestamp getBday() {
            return member.getBirthday();
        }
Run Code Online (Sandbox Code Playgroud)

但我得到例外(奇怪):

/createMember.xhtml @34,54 value="#{member.bday}": Cannot convert 13.01.83 01:00 of type class java.util.Date to class java.sql.Timestamp
Run Code Online (Sandbox Code Playgroud)

(这可能是因为get方法吗?)

jsf timestamp converter jsf-2

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

Python脚本冻结没有明显的原因(afaik)

我在python上并不是特别新,但我只是觉得这个程序可能没有正常工作的原因.我已经写了一个类似的,从中得到了,这仍然可以正常工作.它是一个程序,用于绘制一组ping响应的平均时间,以查看当天是否存在任何模式.来源如下

from Tkinter import *
import matplotlib
import time
import os, sys, threading, Queue
matplotlib.use('TkAgg')
from numpy import arange, array, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure

import Tkinter
import sys
class App(object):
    def __init__(self):
        self.q = Queue.Queue()
        self.q2 = Queue.Queue()
        self.avvals=[]
        self.addlist=['bbc.co.uk', 'google.co.uk', 'nhgs.co.uk', 'bing.co.uk', 'msn.com']
        self.addlistlen = len(self.addlist)
        self.root = Tkinter.Tk()
        self.root.wm_title("Connection Speed")
        self.frame = Tkinter.Frame(self.root)
        self.frame.pack(side='top', expand=1, fill='both',)
        self.frame2 = Tkinter.Frame(self.frame)
        self.frame2.pack(side='bottom', expand=1, fill='both',)
        self.f = Figure(figsize=(5,4), dpi=100)
        self.a = self.f.add_subplot(111)
        self.gframe = Tkinter.Frame(self.frame) …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

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

链接器中不必要的链接库

我有一个项目,我可以从链接器中排除一些库并且仍然构建?

在最终产品的性能和内存方面排除它们会更好吗?

c++ linker

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

在jQuery中导出到csv

我动态生成一个div,如:

<div id='PrintDiv'>
        <table id="mainTable">
            <tr>
                <td>
                    Col1
                </td>
                <td>
                    Col2
                </td>
                <td>
                    Col3
                </td>
            </tr>
            <tr>
                <td>
                    Val1
                </td>
                <td>
                    Val2
                </td>
                <td>
                    Val3
                </td>
            </tr>
            <tr>
                <td>
                    Val11
                </td>
                <td>
                    Val22
                </td>
                <td>
                    Val33
                </td>
            </tr>
            <tr>
                <td>
                    Val111
                </td>
                <td>
                    Val222
                </td>
                <td>
                    Val333
                </td>
            </tr>
        </table>
    </div>
Run Code Online (Sandbox Code Playgroud)

页面上还有更多元素.现在,我怎样才能获得这样的csv文件:

Col1,Col2,Col3
Val1,Val2,Val3
Val11,Val22,Val33
Val111,Val222,Val333
Run Code Online (Sandbox Code Playgroud)

使用jQuery?

需要一个文件保存dailog框,如下所示:

替代文字

谢谢.

javascript csv asp.net jquery

45
推荐指数
4
解决办法
12万
查看次数