我无法将通知发送到iphone.一切似乎都很好,因为服务很好,但要给iphone留言.
这是代码:
using (NetworkStream networkStream = client.GetStream())
{
Console.WriteLine("Client connected.");
//X509Certificate clientCertificate = new X509Certificate(@"C:\Users\yagizozturk\Documents\Visual Studio 2010\Projects\GarantiKampanya\Garanti.Web.Service\apns-prod.pem", "");
X509Certificate clientCertificate = new X509Certificate(@"C:\Users\yagizozturk\Documents\Visual Studio 2010\Projects\GarantiKampanya\Garanti.Web.Service\apns-prod-cert.p12", "1234567");
X509CertificateCollection clientCertificateCollection = new X509CertificateCollection(new X509Certificate[1] { clientCertificate });
// Create an SSL stream that will close the client's stream.
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback(ValidateServerCertificate),
null
);
try
{
sslStream.AuthenticateAsClient("gateway.sandbox.push.apple.com", clientCertificateCollection, SslProtocols.Default, false);
}
catch (AuthenticationException e)
{
Console.WriteLine("Exception: {0}", e.Message);
if (e.InnerException != null)
{
Console.WriteLine("Inner exception: {0}", e.InnerException.Message); …Run Code Online (Sandbox Code Playgroud) 我试图找出Mercurial的优势,我已经阅读了一些关于在开发人员之间提交而不影响主分支的内容.
我知道我必须承诺我当地的回购,然后呢?我不喜欢将它推送到服务器(然后每个人都会看到它吗?),但仅限于一个具体的用户.我希望他为我修理一些东西,然后把他的变更寄回给我.然后我会把所有东西都推到服务器上.
我怎样才能做到这一点?我应该如何在mercurial中做到这一点?
var a = { property: ((type == 'files') ? 'id' : ((type == 'folders') ? 'name' : '')) }; // have to create a dummy object property...
return_json[type].push({ a['property']: Content[type][index][a['property']] });
Run Code Online (Sandbox Code Playgroud)
我正在尝试为客户端查询返回一些JSON,但我需要返回对象的键基于变量,并且它不起作用.我的印象是创建一个虚拟对象会起作用,但事实并非如此.
Firefox告诉我错误,丢失:在第二行的['property']的属性ID之前.
谢谢!
以下是您需要的所有代码.是的,它主要是面向对象的.这两个函数用于在删除文件的ajax请求或用户尝试执行的任何操作之前获取用户选择的文件列表(这是文件管理器).但是对于某些事情我只想返回每个文件的ID,而不是整个对象,这就是我遇到问题的地方.对于文件,它需要返回"id",而它应该返回文件夹的"名称".
GetSelectedJSON: function(which = 0, onlyselected = true, justids = false) { // add another param to only get IDs!
var return_json = { files: [], folders: [] }
this.ForEachItem(which, onlyselected, function(index,type) {
var type = ((type == 1) ? 'files' : ((type == 2) ? …Run Code Online (Sandbox Code Playgroud) 我的git有一个简单的问题:
我在github上的存储库中有这个文件inc.conf.php.我不想从回购中删除他,这是一个基本的配置文件.
现在,在我的本地仓库中,我有自己的配置文件inc.cong.php,我不希望这个文件被提交.
所以我创建了一个.gitignore并在其中添加了inc.config.php.(. gitignore是提交并推送回购)
但是当我更新本地和磁带中的文件inc.config.php时git status:
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Swindle-Foundation5/inc.config.php
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
但我不想从github更改存储库中的文件.我怎么能这样做?
我更新了一个CSS文件.使用时显示为已更改:
git status
Run Code Online (Sandbox Code Playgroud)
然后我打电话给: git add/build/public/css/base.css
然后,当我 git push
我知道该文件是最新的,GitHub尚未更改:
我究竟做错了什么?
我有以下代码:
list1 = {
Items: [
{
ID: 1,
Name: "Zurich"
},
{
ID: 2,
Name: "London"
}, {
ID: 3,
Name: "New York"
}
]
};
list2 = {
Items: [
{
ID: -1,
Name: "Dummy"
},
{
ID: 0,
Name: "Dummy2"
}
]
};
list1.push(list2);
Run Code Online (Sandbox Code Playgroud)
我希望得到以下结果:
列表1:
- 0:对象(苏黎世)
- 1:对象(伦敦)
- 3:对象(纽约)
- 4:对象(虚拟)
- 5:对象(Dummy2)
但是我得到了这个:
列表1:
我怎样才能得到我的预期结果?
谢谢和欢呼.
有什么方法可以找出我的数据何时使用push()方法保存在数据库中?我写了下面的代码,但它多次保存数据......
db.ref('news').push(opts).then(() => {
// do smth. (e.g. hide preloader) when data were succesfully saved
})
Run Code Online (Sandbox Code Playgroud) 我在Mac上并尝试"git push"到本地repo模拟器目录:
mkdir ~/gitremote
cd ~/gitremote
git init --bare
Run Code Online (Sandbox Code Playgroud)
然后在另一个目录中:
git clone /Users/trosky/gitremote
vi readme (add one line)
git add .
git commit -m "1st file"
git push -u origin master
Counting objects: 2, done.
Writing objects: 100% (2/2), 211 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 0 (delta 0)
To /Users/trosky/gitremote/
c0a3498..ff5511b master -> master
Branch master set up to track remote branch master from origin.
Run Code Online (Sandbox Code Playgroud)
一切似乎都好.但在〜/ gitremote下:
$ls
HEAD config hooks objects
branches description info …Run Code Online (Sandbox Code Playgroud) 我听说git push -f如果可能的话,推力()是一种危险的做法.话虽如此,如果在一个小团队之间共享一个私人仓库,那么这样做的安全程序是什么?我想它会是这样的:
有人可以完成此程序或废弃它并提供更好的程序吗?我正在寻找最简单的安全程序.
在许多lisp实现中,push是一个宏看起来像这样:
(push new list)
;; equal to
(setf list (cons new list))
Run Code Online (Sandbox Code Playgroud)
但是setf无法修改参数,例如:
(defun add-item (new list)
(push new list))
Run Code Online (Sandbox Code Playgroud)
不起作用,因为函数参数不是原始符号.
为什么不推这样的工作:
(defun my-push (new list)
(setcdr list (cons (car list)
(cdr list)))
(setcar list new)
list)
Run Code Online (Sandbox Code Playgroud)
然后push可以在函数的参数上工作.是否有任何理由让lisp推动这种方式?
我只是emacs lisp和sicp计划的新手.