我在我的Android应用程序中使用谷歌地图.我已经创建了密钥并在清单文件中添加了必要的权限.但很快我启动应用程序,我在调试器中收到此消息:
GoogleService初始化失败,状态:10,缺少预期资源:'R.string.google_app_id'用于初始化Google服务.可能的原因是缺少google-services.json或com.google.gms.google-services gradle插件.
我不确定什么是错的.地图工作正常,我可以毫无问题地使用它.我的gradle文件有这个条目:
编译'com.google.android.gms:play-services:8.4.0'
什么是抱怨,我该如何缓解它?
我知道那里所以这里的许多相同经历的问题,我的问题是,如果我想删除说1K左右行相当少,给出List<int>
的RecordID
,我会避免使用DataTable
,并发送翻译成语句列表:
string ParmRecordsToDelete_CsvWhereIN = "("
for(int CurIdx=0; CurIdx < RecIdsToDelete.Count; CurIdx++)
{
ParmRecordsToDelete_CsvWhereIN += RecIdsToDelete[CurIdx] + ", ";
//this method to create passed parameter
//logic to remove on last Coma on last Index..
//or use stringJoin and somehow remove the last coma
}
ParRecordsToDelete_CsvWhereIN +=")";
Run Code Online (Sandbox Code Playgroud)
这将创建像"('1','2','3'......)"
然后创建一个SqlCommand
调用存储过程:
Delete * From @TblName WHERE @ColName IN @RecordsToDeleteCsvWhereIN
Run Code Online (Sandbox Code Playgroud)
这是一种有效的方法吗?单个参数的长度是否有限制?我猜这是N/VARCHAR(MAX)
长度.
我想如果它不是一个有点hackish解决方案它不会受到长度的限制......
什么是最好的快速解决方案,还是我在正确的轨道上?
我不知道为什么我找不到这个文档,但是隐含了哪些扩展名:
{-# LANGUAGE Haskell2010 #-}
Run Code Online (Sandbox Code Playgroud)
我大多只关心ghc如何处理这个问题,但我认为这是标准的一部分.
我需要将两个Future [List]合并为一个,我想出了以下解决方案:
def mergeFutureLists[X]( fl1: Future[List[X]], fl2: Future[List[X]] ): Future[List[X]] =
{
val lf = List( fl1, fl2 )
val fll = Future.sequence( lf )
return fll.map{ x => x.flatMap{ el => el } }
}
Run Code Online (Sandbox Code Playgroud)
它做我想要的,但它是正确的方式进行?
我想在文本字符串的末尾添加文本.我的代码下面的任何想法都不起作用?
#include <stdio.h>
int main() {
char text[20];
int i;
printf("Enter a text\n");
scanf("%s", &text);
printf("\n\n");
for (i = 0; i < strlen(text); i++) {
printf("%c", text[i]);
if (text[i] == '\0') { //There seems to be something wrong with '\0'
printf("This is the end of this string");
}
}
return(0);
}
Run Code Online (Sandbox Code Playgroud) 在.bashrc中,我通常设置许多环境变量来存储路径名。
因此,我可以按如下所示转到该特定目录:
cd $PARTICULAR_DIR
Run Code Online (Sandbox Code Playgroud)
在IPython中有做过这件事吗?上面的命令不起作用,因此我尝试了以下操作:
cd os.environ['PARTICULAR_DIR']
Run Code Online (Sandbox Code Playgroud)
但是上述方法也不起作用。
你能启发我吗?
我有一个非常简单的程序,只需要一个重量并将其转换为铂金的价值.我是C的新手,所以错误可能在任何地方.但是当我使用scanf时,它会在一开始就要求输入,而不是遵循代码序列:
码:
#include <stdio.h>
int main(void)
{
float weight;
float value;
printf("Are you worth your weight in platinum?\n");
printf("Let's check it out.\n");
printf("Please enter your weight in pounds: ");
scanf("%f", &weight);
printf("%.2f\n", weight);
value = 1700.0 * weight * 14.5833;
printf("Your weight in platinum is worth $%.2f.\n", value);
printf("You are easily worth that! If platinum prices drop,\n");
printf("eat more to maintain your value.\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
123
Are you worth your weight in platinum?
Let's check it out.
Please …
Run Code Online (Sandbox Code Playgroud) 我一直在寻找测试查询.我希望数据库延迟响应,直到经过一段时间.我想象一个查询会在回复之前等待30秒,如下所示:SELECT SYSDATE FROM DUAL DELAY(30,'second')
我不希望它成为数据库的负担,但我确实希望它强制我的Java代码处理长期运行的事务到数据库.
有任何想法吗?
我正在尝试在Symfony 2.8中使用新的LdapUserProvider.我相信我已根据文档配置了所有内容.
我的用户可以成功进行身份验证,然后重定向到受保护的页面.重定向后问题开始.Symfony尝试绑定为经过身份验证的用户,但使用空密码,open ldap会拒绝该密码.
以下是相关的日志条目和配置值.
配置:
services:
app.ldap:
class: Symfony\Component\Ldap\LdapClient
arguments: [ "localhost" ]
Run Code Online (Sandbox Code Playgroud)
安全:
security:
firewalls:
restricted_area:
provider: app_users
form_login_ldap:
service: app.ldap
dn_string: "uid={username},DC=mydomain,DC=net"
check_path: login_check
login_path: login
providers:
app_users:
ldap:
service: app.ldap
base_dn: dc=mydomain,dc=net
search_dn: cn=Manager,DC=mydomain,DC=net
search_password: secretPassword
filter: "(&(aptAccountEnabled=1)(ObjectClass=aptAccount)(uid={username}))"
default_roles: ROLE_USER
Run Code Online (Sandbox Code Playgroud)
和日志文件:
[2015-12-18 13:55:11] request.INFO: Matched route "login_check". {"route_parameters":{"_route":"login_check"},"request_uri":"http://ancdev.admin.aptalaska.net/~dmorphis/Portal/web/app_dev.php/Login/Verify"} []
[2015-12-18 13:55:11] security.DEBUG: Read existing security token from the session. {"key":"_security_restricted_area"} []
[2015-12-18 13:55:11] security.DEBUG: User was reloaded from a user provider. {"username":"dan.smartrg","provider":"Symfony\\Component\\Security\\Core\\User\\LdapUserProvider"} []
[2015-12-18 …
Run Code Online (Sandbox Code Playgroud) 我试图拉伸.side-bar
div,使其占据整个窗口的高度.
我在flex容器中添加了flex并指定了flex项目的宽度和高度,但是side-bar的高度显示与flex项目相同.
是因为我的CSS类的顺序?
* {
margin: 0;
}
.flex-container {
display: flex;
height: 500px;
border: 1px solid blue;
}
.flex-items {
width: 100px;
height: 250px;
border: 1px solid red;
}
.side-bar {
width: 400px;
align-self: stretch;
}
Run Code Online (Sandbox Code Playgroud)
<div class="flex-container">
<div class="flex-items side-bar"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div>
<div class="flex-items"></div> …
Run Code Online (Sandbox Code Playgroud)