小编Vad*_*tov的帖子

Telegram bot - 如何获得群聊ID?

我一直在使用telegram_bot,并试图让groupChat id向群聊发送通知,但不知道我必须使用哪种方法.

为了获得聊天ID我使用message.chat.id当机器人参与聊天但我必须使用它来获取群聊无法找到/

telegram telegram-bot

126
推荐指数
13
解决办法
28万
查看次数

用空字符串替换非数字

在我们的项目中快速添加需求.我们的数据库中用于保存电话号码的字段设置为仅允许10个字符.所以,如果我通过"(913)-444-5555"或其他任何东西,是否有一种快速的方法来通过某种特殊的替换函数运行字符串,我可以传递一组字符允许?

正则表达式?

c# regex string phone-number

123
推荐指数
6
解决办法
10万
查看次数

Github推送错误:RPC失败; result = 22,HTTP代码= 413

Github正在进行的愚蠢问题.我有大量的更改(大小约为120MB),当我尝试推送时,会发生这种情况:

git config http.postBuffer 524288000
git config http.postBuffer 524288000
git config http.postBuffer 524288000

我已经完成了

git config http.postBuffer 524288000,所以这似乎不是问题.会是什么呢?

git github git-tower

122
推荐指数
6
解决办法
13万
查看次数

chrome撤消"阻止此页面创建其他对话框"的操作

我有时会发现我需要重新启用警报以进行调试.当然我可以关闭标签并重新加载但是有更好的方法吗?

javascript alert google-chrome

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

我如何在Kotlin中获得一个随机数?

一种通用方法,可以返回2个参数之间的随机整数,如ruby rand(0..n).

有什么建议吗?

random jvm kotlin

122
推荐指数
11
解决办法
7万
查看次数

这个gdb输出是什么意思?

我有一个播放声音的按钮,它似乎在模拟器上工作得很好,但我收到这条消息:

Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.605 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.657 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2011-11-01 02:13:02.671 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in …

audio objective-c playback ios ios-simulator

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

类型'Observable <any>'中不存在属性'catch'

在Angular 2文档页面上有一个使用Http服务的例子.

getHeroes (): Observable<Stuff[]> {
  return this.http.get(this.url)
                  .map(this.extractData)
                  .catch(this.handleError);
}
Run Code Online (Sandbox Code Playgroud)

我克隆了angular2-webpack-starter项目并自己添加了上面的代码.

我导入Observable使用

import {Observable} from 'rxjs/Observable';
Run Code Online (Sandbox Code Playgroud)

我假设属性Observable也被导入(.map有效).查看rxjs.beta-6的更改日志,没有提到任何内容catch.

javascript rxjs typescript angular

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

Java:拆分后获取最后一个元素

我正在使用String split方法,我想拥有最后一个元素.Array的大小可以改变.

例:

String one = "Düsseldorf - Zentrum - Günnewig Uebachs"
String two = "Düsseldorf - Madison"
Run Code Online (Sandbox Code Playgroud)

我想拆分上面的字符串并得到最后一项:

lastone = one.split("-")[here the last item] // <- how?
lasttwo = two.split("-")[here the last item] // <- how?
Run Code Online (Sandbox Code Playgroud)

我不知道运行时数组的大小:(

java string split

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

如何设置Android Switch的样式?

API 14中引入的切换小部件默认使用holo主题进行样式设置.我想把它的风格略有不同,改变它的颜色和形状有点因为品牌的原因.怎么会这样呢?我知道它必须是可能的,因为我已经看到默认ICS和三星的touchwiz主题之间的区别

在此输入图像描述

我假设我需要一些状态drawables,我在http://developer.android.com/reference/android/R.styleable.html中看到了一些样式,Switch_thumb和Switch_track看起来像我之后的样子.我只是不知道如何使用它们.

我正在使用ActionbarSherlock,如果这有所作为.当然,只有运行API v14或更高版本的设备才能使用交换机.

android styling android-theme android-styles android-switch

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

Android - 为服务实现startForeground?

所以我不确定在何处/如何实现此方法以使我的服务在前台运行.目前我在另一项活动中通过以下方式开始我的服务:

Intent i = new Intent(context, myService.class); 
context.startService(i);
Run Code Online (Sandbox Code Playgroud)

然后在myServices的onCreate()中我尝试startForeground()......?

Notification notification = new Notification();
startForeground(1, notification);
Run Code Online (Sandbox Code Playgroud)

所以是的,我有点失落,不确定如何实现这一点.

service android android-service

117
推荐指数
7
解决办法
16万
查看次数