小编Bah*_*mut的帖子

iOS MapKit自定义引脚

如何在地图中显示图像而不是图钉.到目前为止,我只能添加引脚..m的示例代码非常有用,因为我还是iOS编程的新手.

mapkit ios

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

东经北纬经纬度

我有东方/北方格式的位置坐标,但我需要将其转换为适当的纬度,以便将其置于bing地图中.任何公式或细节如何将东/北转换为纬度/经度?

编辑:更具体地说,我需要将SVY21坐标转换为WGS84

gps bing-maps

14
推荐指数
1
解决办法
6万
查看次数

Asp.NET DropDownList SelectedItem.Value没有改变

标记:

            <div style="float:left;margin-top:15px;width:80px">
                <asp:DropDownList ID="MyList" runat="server" Width="100px"></asp:DropDownList>
            </div>
Run Code Online (Sandbox Code Playgroud)

码:

        // clear vehicles list
        MyList.Items.Clear();

        // add 'all' option
        MyList.Items.Add(new ListItem("ALL", "0"));

        // add assets
        foreach (CustomClass item in items)
            MyList.Items.Add(new ListItem(item.Name, item.ID.ToString()));
Run Code Online (Sandbox Code Playgroud)

没有事件触发SelectedIndexChanged,因为没有必要.

当我单击回发按钮时,selecteditem的值仍然是DropDownList中第一个项目的值.我错过了什么?

注意 请停止回复和编辑帖子.我们可以保留它,因为它已经被回答了.

c# asp.net data-binding selectedvalue drop-down-menu

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

在c#中执行参数化查询时出现ORA-01745错误

我正在做类似的事情

...
OracleCommand oCommand = new OracleCommand();
oConnection.Open();
oCommand.Connection = oConnection;
oCommand.CommandText = "SELECT * FROM employees WHERE user = :User";
oCommand.Parameters.AddWithValue(":Name", "Employee1");

DbDataReader dbRdr = oCommand.ExecuteReader();
Run Code Online (Sandbox Code Playgroud)

然后这会引发异常:

ORA-01745:无效的主机/绑定变量名称

编辑:连接字符串如下所示:

"Data Source=orcl;Persist Security Info=True;User ID=user_id;Password=pwd;Unicode=True"
Run Code Online (Sandbox Code Playgroud)

之后没有错误,oConnection.Open();所以我假设我的连接字符串是正确的.

我犯了哪个部分?

.net c# oracle

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

使用jquery或javascript在cdata中解析html

我收到的网站Feed看起来像这样

<rss...>
    <title> some title </title>
    <content>
         <![CDATA[ <div>this tag is ignored<div> who took the cookie in the cookie jar!?  ]]>
    </content>
</rss>
Run Code Online (Sandbox Code Playgroud)

我需要在html中显示cdata的全部内容.我正在使用jquery 1.9.1,当我使用内容部分时 $(xml).find('rss content').text(),它实际上忽略了整个<div>this tag is ignored<div>部分.有没有办法使用javascript或jquery获取CDATA内的所有内容?

javascript jquery cdata

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

iOS Mapkit自定义标注

这是一个示例自定义标注,我希望得到类似的风格.我想继承MKAnnotation,但我失去了如何启动它,我不知道标注的设计是否可以被覆盖.

http://1.bp.blogspot.com/_xfo3fwc97Fg/TJ9RZrHVOaI/AAAAAAAAAU4/buhP3q3y0G4/s1600/fmip_locate_20100622.png

任何想法如何用ui控件实现这个自定义标注?

编辑:这是我的代码来自类似的StackOverflow答案:

- (MKAnnotationView *)mapView:(MKMapView *)mapview viewForAnnotation:(id <MKAnnotation>)annotation
{
    if ([annotation isKindOfClass:[MKUserLocation class]])
        return nil;
    static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
    MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];
    if(annotationView)
        return annotationView;
    else
    {
        UIImage *img = [UIImage imageNamed:@"default_thumb.png"];

        MKAnnotationView *annotationView = 
            [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];
        annotationView.canShowCallout = YES;
        annotationView.image = img;
        annotationView.draggable = YES;

        /*
        // change left accessory view button with image
        UIImageView *leftAccView = [[UIImageView alloc] initWithImage:img];
        annotationView.leftCalloutAccessoryView = leftAccView;

        //include a right button to show more info         
        UIButton* rightButton …
Run Code Online (Sandbox Code Playgroud)

mapkit ios

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

获取运行时期间的本地对象/变量列表

我正在尝试创建一个简单的记录器来检查客户端发生了什么.如何获取本地列表(在调试时显示在visual studio上)?

有点像当一个断点被击中时,当前现有的对象/变量实例显示在Locals选项卡上,或者每当我在日志上写字时我应该只获取变量的当前值?

c# debugging logging

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

MVC 3 输入文件始终为空

我添加了一个输入文件字段,但它在控制器上始终为空。我缺少什么?

这是我的视图和控制器的代码。

看法:

...
@using (Html.BeginForm())
{
    ...

    <input type=file name="file" id="file" class="post-attachment" />

    ...
}
Run Code Online (Sandbox Code Playgroud)

控制器:

[HttpPost]
public ViewResult _Details(HttpPostedFileBase file, ViewTopic viewTopic, string SearchField, string submitBtn)
{
    // save file to server
    if (file != null && file.ContentLength > 0)
    {
        var fileName = DateTime.Today.ToString("yy.MM.dd") + Path.GetFileName(file.FileName);
        var path = Path.Combine(Server.MapPath("~/Attachments"), fileName);
        file.SaveAs(path);
    }

...
}
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc asp.net-mvc-3

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

Html 5 canvas getElementById() 返回 null/未定义

这是代码:

HTML:

<body onload="initializeMap()">
    <div id="map_canvas" style="width:100%; height:100%; z-index:1"></div>
    <canvas id="control" style="width:100%; height:100%; z-index:2">Does Not Support Canvas Element</canvas>
</body>
Run Code Online (Sandbox Code Playgroud)

JavaScript:

<script type="text/javascript">
    var canvas = document.getElementById('control');
    var context = canvas.getContext('2d');

    function draw(){
        context.font = "bold 12px sans-serif";
        context.fillText("x", 248, 43);
    }
</script>
Run Code Online (Sandbox Code Playgroud)

绘制函数是在谷歌地图初始化后调用的,所以 DOM 应该已经加载了,对吗?我可能做错了什么?

html html5-canvas

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

从地理列中搜索附近的点

我的表中有一个带有空间索引的地理类型列.如何在使用索引来提高性能的同时选择在给定纬度/经度的X米范围内的前N行?

sql geolocation sql-server-2008-r2 sqlgeography

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

Rfc2898DeriveBytes 与密码的 Sha2 哈希生成

我最近知道使用 SHA256 为加盐密码生成密码哈希。阅读一些关于盐渍密码和安全性,我看到后rfc2898derivebytes,并passwordderivebytes在.NET类。使用rfc2898derivebytes类比通常的散列方法有什么优势(生成盐,生成盐密码,将两者都存储在数据库中)?

.net security passwords

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

WCF:无法为localhost建立SSL/TLS安全通道的信任关系

设置是我在相同的HTTPS网站上使用相同的应用程序池和证书托管2个类似的WCF应用程序.

现在,第一个WCF应用程序在某个函数上调用第二个WCF.在第一个调用第二个WCF之后,抛出异常

"Could not establish trust relationship for the SSL/TLS secure channel..."
Run Code Online (Sandbox Code Playgroud)

我见过类似的问题,但不同之处在于我的工作应该有效,因为它使用相同的证书.可能会发生什么?

编辑:

基本上这里是如何在第一个WCF中的方法内调用第二个WCF,

public void SomeMethod(string parameter)
{
   SecondServiceClient svc2 = new SecondServiceClient ("BasicHttpBinding_IService2");
   svc2.DoWork(parameter);
}
Run Code Online (Sandbox Code Playgroud)

第一个WCF的第二个WCF的web.config端点有这样的:

...
<client>
  <endpoint address="https://192.168.1.100/MyService2/Service2.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService2"
    contract="SecondService.IService" name="BasicHttpBinding_IService" />
</client>
...
Run Code Online (Sandbox Code Playgroud)

我说,HTTPS很难玩.

ssl https wcf web-services

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