小编Nik*_*ntz的帖子

如何摆脱年长的mercurial头?

嗨,我希望你可以从我的i/o告诉如何继续将所有内容合并到最新更新而不会丢失我的更改:

$ hg merge
avbryter: grenen 'default' har 4 huvuden - sammanfoga med en specifik rev
(kör 'hg heads .' för att se huvuden)
ubuntu@ubuntu:/media/Lexar/montao$ hg heads
ändring:     192:e571b17295e9
märke:       tip
förälder:    175:f50d4c4461e5
användare:   tekniklas
datum:       Sat Jan 08 04:45:07 2011 +0000
kortfattat:  twitter support added

ändring:     191:9e419ce3e7e1
användare:   tekniklas
datum:       Wed Mar 09 12:56:27 2011 +0000
kortfattat:  adsense maps

ändring:     159:f8d974793b12
förälder:    157:ef1d955b9236
användare:   tekniklas
datum:       Sat Dec 18 17:05:45 2010 +0000
kortfattat:  remove

ändring:     89:008a2ac46b4f
användare:   tekniklas
datum: …
Run Code Online (Sandbox Code Playgroud)

mercurial

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

MIPS和RISC有什么区别?

它说MIPS是一种RISC.历史是什么?是格式/指令模型/编程模型,如何从RISC告诉MIPS?RISC是一个更广泛的概念吗?

mips

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

如何在服务器端完全启用Facebook OAuth 2.0?

我基本上想要保存给定用户的Facebook ID,以便我可以通过Facebook接收更多资料.理想情况下,我想要一个既不使用javascript也不使用cookie的解决方案,只是服务器端,但没有示例,只是方向,所以我把我们可以讨论的内容放在一起.当我将用户链接到我的网站的OAuth对话框时,这是我认为有用的代码:

https://www.facebook.com/dialog/oauth?client_id=164355773607006&redirect_uri=http://www.kewlbusiness.com/oauth

然后我像这样处理它以获取userdata:

class OAuthHandler(webapp2.RequestHandler):
    def get(self):
      args = dict(
        code = self.request.get('code'),
        client_id = facebookconf.FACEBOOK_APP_ID,
        client_secret = facebookconf.FACEBOOK_APP_SECRET,
        redirect_uri = 'http://www.koolbusiness.com/oauth',
      )
      file = urllib.urlopen("https://graph.facebook.com/oauth/access_token?" + urllib.urlencode(args))
      try:
        token_response = file.read()
      finally:
        file.close()
      access_token = cgi.parse_qs(token_response)["access_token"][-1]
      graph = facebook.GraphAPI(access_token)
      user = graph.get_object("me")   
      self.response.out.write(user["id"])
      self.response.out.write(user["name"])
Run Code Online (Sandbox Code Playgroud)

所以有了这个我可以"登录Facebook"为我的网站没有很多杂乱的javascript和我们不想要的cookie.我想为我的网站启用"使用Facebook登录".它应该没有cookie和没有javascript工作,但他们试图让你做的第一件事是Javascript和cookie.所以我已经制定了一个似乎没有cookie而且没有javascript的解决方案,只有OAuth 2.0:你能谈谈我的"解决方案"吗?我正在寻找的实际用途是启用简单的功能,FB用户在我的网站上做了什么,并承认Facebook帐户以标准化的方式登录.

我只是认为它必须工作没有JavaScript SDK和没有cookie,似乎是这种情况.你能说出这个"解决方案"的优点和缺点是什么吗?我认为它比Javascript + Cookie好得多,所以当最小的例子似乎是100%服务器端时,他们为什么欺骗我们使用javascript和cookie?

谢谢

更新 它似乎正确,行为正确,我也可以使用userdata与数据库,并将我的FB名称渲染到首页没有javascript和没有cookie,只是python:

class FBUser(db.Model):
    id = db.StringProperty(required=True)
    created = db.DateTimeProperty(auto_now_add=True)
    updated = db.DateTimeProperty(auto_now=True)
    name = db.StringProperty(required=True)
    profile_url = db.StringProperty()
    access_token = db.StringProperty(required=True)
    name = db.StringProperty(required=True)
    picture = …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine facebook facebook-graph-api facebook-oauth

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

facebook-oauth目前的纯python解决方案?

看起来我并不是唯一一个试图完全避免使用OAuth 2.0服务器端的解决方案的人.人们可以做任何事情,但他们无法注销:

Facebook Oauth退出

使用facebook图api的Oauth注销

Facebook OAuth2 Logout不会删除fb_ cookie

OAuth 2.0与Facebook 的官方文档说:

您可以通过将用户指向以下URL来将用户从Facebook会话中注销:

https://www.facebook.com/logout.php?next=YOUR_URL&access_token=ACCESS_TOKEN

YOUR_URL必须是您的站点域中的URL,如Developer App中所定义.

我想做所有服务器端,我发现建议的链接方式离开cookie,以便注销链接不起作用: https://www.facebook.com/logout.php?next=http://{{host}}&access_token={{current_user.access_token}} 它确实重定向,但它不会将用户从我的网站中注销.它似乎是一个Heisenbug,因为这改变了我,并没有太多的文件.无论如何我似乎能够通过操纵cookie的处理程序来实现功能,这样实际上用户就会被注销:

class LogoutHandler(webapp2.RequestHandler):
    def get(self):
        current_user = main.get_user_from_cookie(self.request.cookies, facebookconf.FACEBOOK_APP_ID, facebookconf.FACEBOOK_APP_SECRET)
        if current_user:
          graph = main.GraphAPI(current_user["access_token"])
          profile = graph.get_object("me")
          accessed_token = current_user["access_token"] 
        self.set_cookie("fbsr_" + facebookconf.FACEBOOK_APP_ID, None, expires=time.time() - 86400)
        self.redirect("https://www.facebook.com/logout.php?next=http://%s&access_token=%s" get_host(), accessed_token)
    def set_cookie(self, name, value, expires=None):
        if value is None:
            value = 'deleted'
            expires = datetime.timedelta(minutes=-50000)
        jar = Cookie.SimpleCookie()
        jar[name] = value
        jar[name]['path'] = '/'
        if expires:
            if isinstance(expires, datetime.timedelta): …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine facebook facebook-graph-api facebook-oauth

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

是否需要文件persistence.xml?

我的开发环境(IBM RAD 8 + WAS 8)抱怨我的项目没有persistence.xml文件.似乎我仍然可以构建和运行我的项目.是否需要该文件,如果添加一个这样的文件以使我的项目通过验证,那该文件应该是什么?

该项目是一个使用会话bean和来自其他项目的实体bean的Web项目,这个persistence.xml错误是项目中唯一的错误,所以我很乐意摆脱它.

谢谢你的帮助

更新

我搜索了我的文件中的persistence.xml,它出现在EJB项目的src /和bin /中,而带有servlets和jsp的web项目没有persistence.xml,根据我的同事,web项目正在使用持久性.来自EJB项目的xml,即:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

    <persistence-unit name="PandoraArendeWeb" transaction-type="JTA">

        <jta-data-source>jdbc/Mainframe_TEST_ADBUTV2</jta-data-source>
        <class>se.prv.pandora.arendeprocess.entity.PRVNummer</class>
        <class>se.prv.pandora.arendeprocess.entity.Ansokan</class>
        <class>se.prv.pandora.arendeprocess.entity.NatAnsokan</class>
        <class>se.prv.pandora.arendeprocess.entity.PctAnsokan</class>
        <class>se.prv.pandora.arendeprocess.entity.ArendePerson</class>
        <class>se.prv.pandora.arendeprocess.entity.Nyregistrering</class>
        <class>se.prv.pandora.arendeprocess.entity.Anstalld</class>
        <class>se.prv.pandora.arendeprocess.entity.Handlaggare</class>
        <class>se.prv.pandora.arendeprocess.entity.OrgElement</class>
        <class>se.prv.pandora.arendeprocess.entity.FysiskHandlaggare</class>
        <class>se.prv.pandora.arendeprocess.entity.AnsvarigHandlaggare</class>
        <class>se.prv.pandora.arendeprocess.entity.AnsvarigFysiskHandlaggare</class>
        <class>se.prv.pandora.arendeprocess.entity.TeknikOmrade</class>
        <class>se.prv.pandora.arendeprocess.entity.Person</class>
        <class>se.prv.pandora.arendeprocess.entity.PRVNummerPerson</class>
        <class>se.prv.pandora.arendeprocess.entity.Notering</class>
        <class>se.prv.pandora.arendeprocess.entity.Lock</class>
        <class>se.prv.pandora.arendeprocess.entity.LandKod</class>
        <class>se.prv.pandora.arendeprocess.entity.ArbetsMomentLog</class>
        <class>se.prv.pandora.arendeprocess.entity.SystemTypDel</class>
        <class>se.prv.pandora.arendeprocess.entity.ArbetsMoment</class>
        <class>se.prv.pandora.arendeprocess.entity.UnderStatus</class>
        <class>se.prv.pandora.arendeprocess.entity.PatPers</class>
        <class>se.prv.pandora.arendeprocess.entity.PrvLandP</class>
        <class>se.prv.pandora.arendeprocess.entity.PkaPerln</class>
        <class>se.prv.pandora.arendeprocess.entity.PctnPerl</class>
        <class>se.prv.pandora.arendeprocess.entity.PersonToPatPersKoppl</class>
        <class>se.prv.pandora.arendeprocess.entity.PRVNummerPersonKoppl</class>
        <class>se.prv.pandora.arendeprocess.entity.Region</class>
        <class>se.prv.pandora.arendeprocess.entity.Historik</class>
        <class>se.prv.pandora.arendeprocess.entity.Egenskap</class>
        <exclude-unlisted-classes>true</exclude-unlisted-classes>

    </persistence-unit>

<!-- <persistence-unit name="PandoraArendeWeb_MSSQL" transaction-type="JTA">

        <jta-data-source>jdbc/MSSQL_TEST_XA</jta-data-source>
        <class>se.prv.pandora.arendeprocess.entity.PersonSearch</class>
        <exclude-unlisted-classes>true</exclude-unlisted-classes>

    </persistence-unit>
 -->    
</persistence>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

java xml java-ee ibm-rad websphere-8

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

MS Visual Studio 2012可以与Windows Vista一起使用吗?

我运行Windows Vista业务,并想尝试MS Visual Studio Express 2012.它们兼容吗?兼容性列表在哪里?

windows visual-studio visual-studio-2012

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

为什么不"有"......有效的JavaBean方法签名的开头?

JavaBeans方法的签名必须遵循某些约定,例如set .../get ...等.它们有一个约定...例如,isEven()可以是Integer类测试布尔值的方法.但后来我想知道为什么没有...也是一个合法的标识符,因为我有必要测试一些东西,例如hasCar()Person类或同样的东西.

你明白我的问题吗?你怎么看?

java javabeans

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

加载词和移动之间的区别?

有什么区别

ldw r8,0(r4)

mov r8, r4

加载字表示"从内存中复制"但是当从r4加载字复制时,它是从寄存器复制而不是从内存中复制吗?

assembly mips nios

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

正确的定义NULL和NULL_POINTER的方法?

据我所知,C定义NULL如下:

#define NULL ( (void *) 0)
Run Code Online (Sandbox Code Playgroud)

然后,我们应该如何定义NULL_POINTER?我在我的程序中将它定义为相同并且它有效,但我认为这只是一个巧合:

#define NULL_POINTER ( (void *) 0)
Run Code Online (Sandbox Code Playgroud)

如果有的话,逻辑定义是什么?

c null pointers c-preprocessor

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

我该如何修复我的pyCharm安装?

当我启动pyCharm时,我收到此错误信息:

Load Settings
Cannot load settings from file 'C:\Users\cleanup\.PyCharm40\config\options\editor.codeinsight.xml': content truncated File content will be recreated
Run Code Online (Sandbox Code Playgroud)

我能做些什么呢?

windows pycharm

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