有没有一种简单的方法可以在Android中获取RadioGroup的选定索引,或者我是否必须使用OnCheckedChangeListener来监听更改并选择保留最后一个索引的内容?
示例xml:
<RadioGroup android:id="@+id/group1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
<RadioButton android:id="@+id/radio1" android:text="option 1" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RadioButton android:id="@+id/radio2" android:text="option 2" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RadioButton android:id="@+id/radio3" android:text="option 3" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RadioButton android:id="@+id/radio4" android:text="option 4" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RadioButton android:id="@+id/radio5" android:text="option 5" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RadioGroup>
Run Code Online (Sandbox Code Playgroud)
如果用户选择option 3我想获得索引,2.
使用jQuery datepicker,如何更改显示的年份范围?在jQuery UI网站上,它表示默认为"显示当前年份之前和之后的10年".我想用这个作为生日选择,而今天10年之前是不行的.这可以使用jQuery datepicker完成,还是我必须使用不同的解决方案?
链接到datepicker演示:http://jqueryui.com/demos/datepicker/#dropdown-month-year
我们有一个已部署到许多网站只用前端变化的Web应用程序,共享的后端部分都有它的GAC DLL,所以我们只需要更新一个DLL和所有的网站获取更新.
有没有办法在/ bin文件夹中使用DLL覆盖GAC以在新功能发布之前测试它们?
当我在用户模式下调用系统调用时,如何在OS中处理调用?
它会调用一些可执行的二进制文件还是某些标准库?
如果是,完成通话需要什么样的东西?
对于小字符串(20-500个字符),我需要快速校验和(尽可能快).
我需要源代码,而且必须很小!(最多约100 LOC)
如果它可以在Base32/64中生成字符串.(或类似的东西)它会是完美的.基本上校验和不能使用任何"坏"字符..你知道..通常(){} [].,;:/ + - \| 等等
澄清
它可能是强弱的,这无关紧要,因为它仅用于幕后目的.
它不需要包含原始字符串的所有数据,因为我只会与生成的校验和进行比较,我不期望任何类型的"解密".
关于这个问题,从ASP.NET应用程序直接将文件上传到Amazon S3,有没有办法做到这一点,并有一个进度条?
----编辑----
两天后,直接的方式仍然没有运气.找到一件看起来很有前途但不自由的东西:http://www.flajaxian.com/
使用flash通过进度条直接上传到S3.
如果开始一个新项目,你会为ORM NHibernate或LINQ使用什么,以及为什么.每种方法的优缺点是什么?
编辑:LINQ to SQL不仅仅是LINQ(感谢@Jon Limjap)
我正在使用tablesorter插件(http://tablesorter.com)并且在IE7中遇到列宽问题.它在Firefox中看起来很好,有时在IE7中也很好.
这是问题的截图:
这是它应该看起来的样子:
问题是我有一个存储过程在Sql Server Management Server中以2秒的时间一致地运行,但是当从代码调用相同的存储过程时它会超时.
当它从SSMS正确运行时,它应该返回大约30行.
我尝试了几种不同的方法从代码调用过程,但每次都有相同的结果.这刚刚开始发生,昨天它工作正常.
为我们调用该过程的首选方法是使用Linq2Sql,它给出以下错误消息:
超时已过期.操作完成之前经过的超时时间或服务器没有响应.描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:System.Data.SqlClient.SqlException:超时已过期.操作完成之前经过的超时时间或服务器没有响应.
来源错误:
Line 16: public IMultipleResults GetTournamentRatingNonComplaintData([global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> startdate, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> enddate, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> officialSportID, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Char(1)")] System.Nullable<char> gender, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> level)
Line 17: {
Line 18: IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), startdate, enddate, officialSportID, gender, level);
Line 19: return ((IMultipleResults)(result.ReturnValue));
Line 20: }
Run Code Online (Sandbox Code Playgroud)
有谁知道在SSMS中运行它和通过代码之间有什么区别?如何解决此问题可以做些什么?
我有一个类似于以下的Page.cshtml(不起作用):
@{
Layout = "../Shared/Layouts/_Layout.cshtml";
var mycollection = (ViewBag.TheCollection as IQueryable<MyCollectionType>);
}
<h2>@ViewBag.Title</h2>
content here
@if (mycollection != null && mycollection.Count() > 0)
{
@section ContentRight
{
<h2>
Stuff
</h2>
<ul class="stuff">
@foreach (MyCollectionType item in mycollection )
{
<li class="stuff-item">@item.Name</li>
}
</ul>
}
}
Run Code Online (Sandbox Code Playgroud)
正如我所说,这不起作用.如果集合中没有任何内容,我想不定义该部分.有没有办法让这样的工作?如果没有,我的其他选择是什么?我对这款Razor ViewEngine非常陌生.
编辑
在我的布局中我有:
@if(IsSectionDefined("ContentRight"))
{
<div class="right">
RenderSection("ContentRight")
</div>
}
Run Code Online (Sandbox Code Playgroud)
我不想要的是当该部分为空时输出的div.
asp.net ×2
javascript ×2
jquery ×2
.net ×1
ajax ×1
amazon-s3 ×1
android ×1
asp.net-mvc ×1
base32 ×1
base64 ×1
bin ×1
c# ×1
checksum ×1
datepicker ×1
deployment ×1
file-upload ×1
gac ×1
html ×1
java ×1
linq ×1
linq-to-sql ×1
linux ×1
nhibernate ×1
progress-bar ×1
radio-group ×1
razor ×1
sql ×1
sql-server ×1
string ×1
tablesorter ×1
viewengine ×1
xml ×1