从昨天起我在Android 4.2上遇到问题,当我收到推送通知时,即使我没有将其设置为振动,也需要获得许可
Notification notification = new Notification(icon, notificationItem.message, when);
notification.setLatestEventInfo(context, "App", notificationItem.message,
PendingIntent.getActivity(context, 0, intent, 0));
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_SOUND;
NotificationManager nm =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(notificationItem.notificationID, notification);
Run Code Online (Sandbox Code Playgroud)
nm.notify引发了异常
我在两个不同的应用程序中遇到此问题,我从不修改代码
我试图第一次将代码推送到我的git存储库但是我收到以下错误:
Run Code Online (Sandbox Code Playgroud)Counting objects: 222026, done. Compressing objects: 100% (208850/208850), done. Write failed: Broken pipe222026) error: pack-objects died of signal 13 fatal: The remote end hung up unexpectedly error: failed to push some refs to 'ssh://git@bitbucket.org/<...>'
我试图增加http缓冲区大小(git config http.postBuffer 524288000),我试过git repack,但它没有用.
我能够将一个非常相似的大小代码推送到另一个存储库(它不像这个git repack一样工作,但它确实工作后).我想把它推到bitbucket.
有任何想法吗?
我最近将我的一个测试iphone升级到iOS 8,然后升级了PUSH注册码,如下所示(使用xCode 6)
-(BOOL)hasNotificationsEnabled {
NSString *iOSversion = [[UIDevice currentDevice] systemVersion];
NSString *prefix = [[iOSversion componentsSeparatedByString:@"."] firstObject];
float versionVal = [prefix floatValue];
if (versionVal >= 8)
{
NSLog(@"%@", [[UIApplication sharedApplication] currentUserNotificationSettings]);
//The output of this log shows that the app is registered for PUSH so should receive them
if ([[UIApplication sharedApplication] currentUserNotificationSettings].types != UIUserNotificationTypeNone) {
return YES;
}
}
else
{
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types != UIRemoteNotificationTypeNone){
return YES;
}
}
return NO;
}
-(void)registerForPUSHNotifications { …Run Code Online (Sandbox Code Playgroud) 19/06/10更新:更多证据问题是服务器端问题.在Windows 7命令行上接收此错误(请参阅下面的完整回溯):
URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
abort: error: An existing connection was forcibly closed by the remote host
Run Code Online (Sandbox Code Playgroud)
当试图将包含6个大文件(.exe,.dmg等)的变更集推送到我的远程服务器时,我的客户端(MacHG)报告错误:
"推送期间出错.Mercurial报告错误号255:中止:HTTP错误404:未找到"
这个错误甚至意味着什么?!关于此提交,唯一唯一的(我可以告诉)是文件的大小,类型和文件名.如何确定变更集中的哪个确切文件失败?如何从存储库中删除损坏的变更集?在另一篇文章中,有人报告使用"mq"扩展来有效地从存储库中的历史记录中删除错误的变更集,但是对于我正在尝试解决的问题,mq看起来过于复杂.
我可以使用MacHG和toirtoise HG推送和提取以下内容:源文件,目录,.class文件和.jar文件进出服务器.
我成功地向我的本地存储库添加了第一次添加6个大型.exe,.dmg等安装程序文件(总共约130Mb).
在我对本地存储库的以下提交中,我删除了("未跟踪"/忘记)导致问题的6个文件,但是先前(失败的)更改集仍然排队等待推送到服务器(即我的本地主机正在尝试推送"添加"然后"移除"到远程服务器 - 并与源控制系统中的"保持历史中的一切"理念保持一致.
我可以使用Windows PC上的TortoiseHG提交.txt .java文件等.我实际上没有使用TortoiseHG测试提交或推送相同的大文件.
请帮忙!
客户端应用程序= MacHG v0.9.7(SCM 1.5.4)和TortoiseHG v1.0.4(SCM 1.5.4)
Server = HTTPS,IIS7.5,Mercurial 1.5.4,Python 2.6.5,使用以下说明进行设置:
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
在IIS7.5中,CGI处理程序配置为处理所有动词(不仅仅是GET,POST和HEAD).
我在服务器上的hgweb.cgi文件如下:
#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# Path to repo or hgweb config to serve …Run Code Online (Sandbox Code Playgroud) 场景:在我离开办公室之前的本地回购
$ hg status
M important/update1
M another/important/update2
M work/in/progress
Run Code Online (Sandbox Code Playgroud)
我想提交并推送重要的/ update1和important/update2,因为当我回到家时,我想将这些文件拉到我的本地仓库.我还没准备好投入工作/进展.实际上它甚至没有正确解析.该文件在我的IDE中打开,我只是想保持原样.
现在我做:(赶紧,电车三分钟后离开)
$ hg commit important/update1 another/important/update2
$ hg push
pushing to https://**censored**
searching for changes
abort: push creates new remote heads on branch 'default'!
(did you forget to merge? use push -f to force)
Run Code Online (Sandbox Code Playgroud)
好.同事推了一些东西......(电车在两分钟后离开...)
$ hg pull (really important update!)
$ hg update
abort: outstanding uncommitted changes
Run Code Online (Sandbox Code Playgroud)
废话.我需要同事的更新,但我不会提交工作/进展/进展,更不用说推动了!我只是错过了我的电车......
你怎么处理这个?
当我尝试推送时,我的NuGet服务器正在抛出405 Not Allowed.至少,这就是NuGet控制台所说的:
Failed to process request. 'Method Not Allowed'.
The remote server returned an error: (405) Method Not Allowed..
Run Code Online (Sandbox Code Playgroud)
但是当我看到Fiddler的实际HTTP响应时,问题似乎完全不同:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="en-US">The URL representing the root of the service only supports GET requests.</message>
</error>
Run Code Online (Sandbox Code Playgroud)
关于可能发生的事情的任何想法?
谢谢!
您知道在应用程序完全关闭时是否可以从Google云消息接收通知?
我知道它是开放的还是在后台是的,但它可以以任何方式编程以便接收它们吗?
编辑:
应用程序关闭时,我会继续收到通知
我附上代码,以防我有错误,我不看.
表现
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.frab"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.frab.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<permission
android:name="com.frab.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.frab.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".GGMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" > …Run Code Online (Sandbox Code Playgroud) 我正在尝试推送到二维数组而不会弄乱,目前我的数组是:
var myArray = [
[1,1,1,1,1],
[1,1,1,1,1],
[1,1,1,1,1]
]
Run Code Online (Sandbox Code Playgroud)
我正在尝试的代码是:
var r = 3; //start from rows 3
var c = 5; //start from col 5
var rows = 8;
var cols = 7;
for (var i = r; i < rows; i++)
{
for (var j = c; j < cols; j++)
{
myArray[i][j].push(0);
}
}
Run Code Online (Sandbox Code Playgroud)
这应该导致以下结果:
var myArray = [
[1,1,1,1,1,0,0],
[1,1,1,1,1,0,0],
[1,1,1,1,1,0,0],
[0,0,0,0,0,0,0],
[0,0,0,0,0,0,0],
[0,0,0,0,0,0,0],
]
Run Code Online (Sandbox Code Playgroud)
但它不会也不确定这是否是正确的方法.
所以问题是如何实现这一目标?
在我们公司,我们正在从svn转向git.对于问题跟踪,我们使用Atlassian的JIRA.
现在我们要强制执行每个提交消息都包含一个问题编号(就像我们使用svn一样).
我们找到了commit-msg钩子,如果它不包含问题编号,我们用它来拒绝提交.
JIRA使用Fisheye扫描git repo.如果提交消息包含问题编号,则更改将显示在该问题下.
问题是克隆git存储库时不会复制钩子.因此,不会强制执行提交消息中的问题编号.这意味着当向上推送新提交时,Jira可能不会列出问题下的更改.
问题是; 我们以某种方式以错误的方式使用Git并且有没有办法在提交消息中真正强制执行问题编号?或者是否有任何人只有一个脚本/钩子(除了commit-msg钩子)来完成这个?