问题列表 - 第49397页

如何使用t-sql更新xml变量中的xml属性值?

我们有一个示例代码段:

DECLARE @xml XML = N'
<a abb="122">
    <b>
    </b>
</a>
';
SELECT @xml;

--need to update abb to be 344 in @xml here

SELECT @xml;
Run Code Online (Sandbox Code Playgroud)

我不知道如何更新该属性abb的值.

xml sql t-sql sql-server sql-server-2008

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

是否可以使用Javascript从FTP下载文件?

假设,我有一个FTP URL(ftp://xyz.org/file.zip).如果我在浏览器中手动输入,然后按回车键,浏览器将开始下载file.zip并将要求我将其保存在硬盘上.

我的问题是:是否可以用JavaScript编写脚本,运行时应该下载带有所有这些选项的文件(单独)?

  • 在新窗口?
  • 在同一个窗口的新标签中?
  • 没有打开新窗口或标签?

javascript browser ftp

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

C#在字符串内修剪换行问题

我有一个从Xceed数据网格填充的字符串,如下所示:

study = row.Cells["STUDY_NAME"].Value.ToString().TrimEnd  (Environment.NewLine.ToCharArray());
Run Code Online (Sandbox Code Playgroud)

但是,当我将研究字符串传递给程序的另一部分时,它会抛出一个错误,因为字符串仍显示为:"PI3K1003 \n"

我也尝试过:

TrimEnd('\r', '\n');
Run Code Online (Sandbox Code Playgroud)

有人有什么想法吗?

谢谢.

c# string trim

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

预测sprintf()'ed line的len?

我可以用某个函数来预测sprintf()需要的空间吗?IOW,我可以调用一个函数size_t predict_space("%s \n",some_string)来返回由sprintf("%s \n",some_string)产生的C字符串的长度吗?

c printf string-length

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

File.ReadLines没有锁定它?

我可以打开一个FileStream

new FileStream(logfileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Run Code Online (Sandbox Code Playgroud)

没有锁定文件.

我可以这样做File.ReadLines(string path)吗?

c# io file stream filestream

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

在Firefox上的jQuery动画缩放

我有一个很好的效果,你将鼠标悬停在一个特定的元素上,它扩展得更大.我这样做只是为了:

$('#element_to_scale').live('mouseenter', function() {
    $(this).stop().animate({zoom: 2});
}).live('mouseleave', function() {
    $(this).stop().animate({zoom: 1});
});
Run Code Online (Sandbox Code Playgroud)

问题是这对firefox不起作用:(.我现在读到firefox是唯一不支持css zoom的浏览器?看起来很奇怪......那么用jQuery制作缩放机制的最佳方法是什么?

css firefox jquery animation css3

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

如何在Spring MVC 3.0中传递表单中的隐藏值?

如何在Spring MVC 3.0中传递表单中的隐藏值

我无法使用隐藏字段赋值 <form:hidden path="test" />.如何设置测试字段的值并在服务器端访问它.

谢谢

forms spring-mvc hidden-field java-ee

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

如何计算地球和太阳之间的角度?

对于我的应用程序,我需要计算两个不同行之间的角度:

1)第一条线位于地球上由经度和纬度定义的点与太阳中心之间.

2)第二条线位于地球上由经度和纬度定义的点与月球表面之间距离地球的距离较小的点之间.

我不知道应该如何从那里开始.任何提示?

java algorithm

7
推荐指数
1
解决办法
1483
查看次数

Android - 在通知栏中保持通知稳定

我已经编写了通知并在通知栏中显示的功能:

private void showNotification()
    {
            CharSequence title = "Hello";
            CharSequence message = "Notification Demo";

            NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.icon, "A Notification", System.currentTimeMillis());
            Intent notificationIntent = new Intent(this, Main_Activity.class);
            PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

            notification.setLatestEventInfo(Main_Activity.this, title, message, pendingIntent);
            notificationManager.notify(NOTIFICATION_ID, notification);
    }
Run Code Online (Sandbox Code Playgroud)

它工作正常,但what way we can keep the notification steady at Notification bar即使用户按下通知栏中的"清除"通知按钮?

请查看"Yahoo"应用程序的通知栏.

在此输入图像描述

我已经阅读了这篇SDK文章:http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating,但未能找到答案.

android notification-bar android-notification-bar

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

在c#中向IEnumerable添加一列

我认为我实际上不能将字段(列)添加到现有的IEnumerable中.但我想要的是一个新的IEnumerable,它是从一个带有计算字段的现有IEnumerable派生出来的.使用网页的WebMatrix中的伪代码如下所示:

var db = Database.Open("LOS");
var ie = db.Query(sqlAssignments);

// make a new ie2 that has an extra field
// ??? ie2 <=== ie with new field c = ie.a + ie.b

var grid = new WebGrid( ie2, extra parameters );
Run Code Online (Sandbox Code Playgroud)

我知道如何循环遍历ie中的所有行.但我希望有更优雅的东西.

c# linq webmatrix

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