问题列表 - 第38647页

在Google Maps API v3中设置DirectionsService的语言

我现在切换到谷歌地图v3 API,并使用谷歌提供一些路线规划DirectionsService.这一切都按预期工作,但语言是英语,我找不到将其设置为德语的方法.地图本身已经是德语 - 只有输出DirectionsService是英文的.

任何人都知道如何设置它de-DE

google-maps google-maps-api-3

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

现成的解决方案来解析Cocoa中的mailto URL?

我有一个UIWebViewiPhone应用程序,并希望截取结构化的mailto-URL mailto:email@address.com?subject=foo&body=bar,以便MFMailComposeViewController在应用程序内显示,而不是将URL交给Mail.app.

现在,如果MFMailComposeViewController根据mailto URL自动设置所有属性,那将会很棒.不幸的是,MFMailComposeViewController不接受mailto URL但需要设置各个属性.

NSURL显然也没有太大的帮助.您是否知道任何现有代码,以便我不必编写解析器代码?;)

mailto iphone cocoa-touch uiwebview ios

4
推荐指数
1
解决办法
1497
查看次数

STL的两个序列中的匹配数

好的,这是另一个问题"如何在STL中做得更好?" 系列.

我们有两个范围,由first1,last1和first2指定.我们想从[0,last1-first1]中找到不同的i的数量*(first1 + i) == *(first2 + i)

例如:

{a, b, c, d, d, b, c, a}
{a, a, b, c, d, c, c, a}
 ^           ^     ^  ^ 
Run Code Online (Sandbox Code Playgroud)

对于这两个范围,答案是4.

有一个很好的STL方式吗?我的意思是最好没有任何手册,而等等.谢谢!

c++ stl

3
推荐指数
1
解决办法
214
查看次数

Android:根据"声音设置">"常规"中选中的选项进行振动

我怎样才能做到这一点?我目前的代码如下所示:

final NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.stat_sys_warning, System.currentTimeMillis());    
notification.defaults |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Intent notificationIntent = new Intent(Intent.ACTION_MAIN, Uri.EMPTY, context, Activity....class).putExtra(...);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, title, text, contentIntent);
manager.notify(1, notification);
Run Code Online (Sandbox Code Playgroud)

notifications android vibration

5
推荐指数
1
解决办法
342
查看次数

Rich modalpanel会自动关闭

我面临与此处描述的相同的问题Rich modalpanel会自动关闭

我正在使用richfaces 3.3.0(包含在接缝2.12中).我试图找出问题所在,Firebug显示在modalpanel出现后,会生成对服务器的请求.面板在几毫秒后关闭.我为rich_modalPanel标签(在窗体外部)中的几个位置进行了多处理.

有任何想法吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:s="http://jboss.com/products/seam/taglib">
<head />
<body id="pgHome">
<f:view>
    <div id="document">
        <h:form id="login">
        <fieldset>
            <h:outputLabel id="UsernameLabel" for="username">Login Name</h:outputLabel>
            <h:inputText id="username" value="#{identity.username}" style="width: 175px;" />
        </fieldset>
        <h:commandButton id="search2" value="modal"
            onclick="#{rich:component('mp')}.show()" />

        </h:form> 
        <rich:modalPanel id="mp" height="200" width="500">
            <f:facet name="header">
                <h:outputText value="Modal Panel Title" />
            </f:facet>
        </rich:modalPanel>
    </div>
</f:view>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

编辑:

我终于使用了这个例子:

<rich:modalPanel id="modalPanelID">
    <f:facet name="header">
        <h:outputText value="header" />
    </f:facet>
    <a onclick="Richfaces.hideModalPanel('modalPanelID');" href="#">Hide</a>
</rich:modalPanel> …
Run Code Online (Sandbox Code Playgroud)

jsf seam richfaces

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

PHP MySQL错误处理

简单的问题(我希望).

目前我正在使用以下代码:

mysql_query($sql) or header("Location: /error");

为了防止脚本的其余部分运行,我需要添加exit;die().有没有办法使用上面的内联方法,或我需要使用:

$result = mysql_query($sql);
if (!result) {
    header("Location: /error");
    exit();
}
Run Code Online (Sandbox Code Playgroud)

谢谢

php mysql

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

Rails + Devise + delayed_job?

我在Heroku上使用Devise有一个Rails 3应用程序.问题是我正在发送带有Sendgrid的电子邮件,而且电子邮件递送速度很慢,这会让应用程序挂起.所以我有兴趣使用delayed_job在后台排队电子邮件,因此我的应用程序响应用户.

Devise如何与delayed_job一起使用?设置Devise以使用delayed_job的任何方法?

ruby-on-rails heroku devise ruby-on-rails-3

19
推荐指数
3
解决办法
5278
查看次数

如何从A - Z为.net项目进行日常构建?

我是一名想要更好地学习软件开发过程的新手开发人员.我的问题是:

  1. 什么是日常建设?
  2. 如果我在VS中构建自己的项目有什么区别?
  3. 我们如何做到.net项目的最佳方式(最好使用TFS)?
  4. 我应该/必须知道的更多事情?

欢迎提及任何文章/书籍/其他问题.

谢谢

.net dailybuilds

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

DotNetZip添加文件而不创建文件夹

using (ZipFile zip = new ZipFile())
{
    foreach(string file in Directory.GetFiles(folder))
    {
        zip.AddFile(file, Path.GetFileName(file));
    }
    zip.Save("test.zip"));
}
Run Code Online (Sandbox Code Playgroud)

每次添加文件时,都会为它创建一个新的子文件夹.

所以我想最终得到:

test.zip
    -  myDoc.doc
    -  myPdf.pdf
Run Code Online (Sandbox Code Playgroud)

但我最终得到:

test.zip
    -  myDoc.doc
        -  myDoc.doc
    -  myPdf.pdf
        -  myPdf.pdf
Run Code Online (Sandbox Code Playgroud)

c# directory zip dotnetzip

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

重用默认的Android图片库?

我在网上找到的用于显示图像库的所有示例都需要创建自定义适配器并进行大量手动工作.是否有一个Intent,我可以简单地传递一个路径或过滤器,以重用默认的图库功能(显示缩略图,触摸查看完整的图片,共享选项等),但限制结果到我的应用程序的存储目录?

java android image gallery

4
推荐指数
1
解决办法
1960
查看次数