我试图找回我在数据库中保存的所有对象,但并非所有对象都返回:
var everything = session.Query<MyObject>()
.Where(x => !x.IsDeleted &&
x.WorkflowStatus == WorkflowStatus.Published);
Run Code Online (Sandbox Code Playgroud)
我总共有206个对象,其中80%符合上述标准,但只返回127个.
谁能明白为什么?
我在我的Android
应用程序中使用以下错误Parse
:
You must register this ParseObject subclass before instantiating it.
在我的Application
对象中,我正在做以下内容onCreate
:
Parse.enableLocalDatastore(this);
Parse.initialize(this, "code", "code");
Run Code Online (Sandbox Code Playgroud)
那么为什么我仍然会收到此错误?它昨天工作正常,但它突然停止工作.
这是我的清单文件:
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
....
Run Code Online (Sandbox Code Playgroud)
logcat的:
java.lang.IllegalArgumentException: You must register this ParseObject subclass before instantiating it.
at com.parse.ParseObject.<init>(ParseObject.java:157)
at com.parse.ParseObject.<init>(ParseObject.java:119)
at usmaan.app.models.Game.<init>(Game.java:25)
at usmaan.app.models.Game.to(Game.java:86)
at usmaan.app.adapters.GamesAdapter.getView(GamesAdapter.java:47)
at android.widget.AbsListView.obtainView(AbsListView.java:2344)
at android.widget.ListView.makeAndAddView(ListView.java:1864)
Run Code Online (Sandbox Code Playgroud) 我想制作一个Javascript弹出窗口,询问我是否要删除列表.
这是我现在所拥有的(不起作用 - 当被控制器捕获时,Guid为null).
@Html.ActionLink("Delete", "Delete", "Listing", listing.Guid, new { onclick = "return confirm('Are you sure you want to delete this listing?')" })
Run Code Online (Sandbox Code Playgroud)
第一个Delete是字符串,第二个Delete是方法的ActionName,Listing是Controller名称,listing.Guid是我要发送的参数,最后,当然,onclick是Javascript.
知道我可能会走错路吗?
编辑另外,任何想法如何我有一个更漂亮的确认对话框?使用Bootstrap.
在我的C#应用程序中,我有一组对象,其int Order
属性范围从1到n.
当我喜欢这样的时候:
var listings = session.Query<Listing>().Where(x => !x.IsDeleted && x.CategoryId == category.Id && x.WorkflowStatus == WorkflowStatus.Published).OrderBy(x => x.Order);
Run Code Online (Sandbox Code Playgroud)
我得到了一系列列表,但没有按正确的顺序100%.按顺序,顺序如下:
0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 28, 29, 3, 30, 31, 32, 33, 4 ....
Run Code Online (Sandbox Code Playgroud)
知道为什么OrderBy
不完全应该这样做吗?
我在最新的Android Studio上创建了一个全新的Android项目.我做的第一件事是通过将以下内容添加到gradle文件中来将"Realm"库添加到项目中:
compile 'io.realm:realm-android:0.80.3'
Run Code Online (Sandbox Code Playgroud)
如果我尝试编译,我会收到以下错误:
Note: C:\....\MainActivity.java uses or overrides a deprecated API.
Run Code Online (Sandbox Code Playgroud)
原点2:C:\ Users\Usmaan.gradle\_caches\modules-2\files-2.1\io.realm\realm-android\0.80.3\7979d05ba7b919c53766bf98e31aaf0e9feb0590\realm-android-0.80.3.jar错误:重复文件包装APK C:...\app\build\outputs\apk\app-debug-unaligned.apk存档中的路径:META-INF/services/javax.annotation.processing.Processor原点1:C:\ Users\Usmaan .gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\6.1.0\63735f48b82bcd24cdd33821342428252eb1ca5a\butterknife-6.1.0.jar你可以忽略build.gradle中的那些文件:android {
packagingOptions { exclude'META -INF/services/javax.annotation.processing.Processor'}错误:任务':app:packageDebug'的执行失败.在APK META-INF/services/javax.annotation.processing.Processor中复制的重复文件文件1:C:\ Users\Usmaan.gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\6.1.0\63735f48b82bcd24cdd33821342428252eb1ca5a\butterknife-6.1.0.jar文件2:C:\ Users\Usmaan.gradle\caches\modules-2\files-2.1\io.realm\realm-android\0.80.3\7979d05ba7b919c53766bf98e31aaf0e9feb0590\realm-android-0.80 .3.jar}
有任何想法吗?
这是我的脚本:
<script>
jQuery(document).ready(function () {
jQuery('#btnCalculate').click(function () {
var salaries = parseInt(jQuery('#txtEmployeeSalaries').val(), 10);
var nationalInsurance = parseInt(jQuery('#txtENIC').val(), 10);
var pensionCont = parseInt(jQuery('#txtEPC').val(), 10);
var expenses = parseInt(jQuery('#txtAnyExpenses').val(), 10);
var income = parseInt(jQuery('#txtIncome').val(), 10);
var labourCost = (((salaries + nationalInsurance + pensionCont + expenses) / (income)) * 100);
alert(labourCost);
jQuery('#txtTotal').val(labourCost).toFixed(2);
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
但是,在Chrome控制台中,它指出:
Uncaught TypeError: Object [object Object] has no method 'toFixed'
有人看到任何明显错误吗?
我不明白为什么我得到一个错误:
'System.Collections.Generic.List Notify.MainPage.webClient_OpenReadCompleted(object,System.Net.OpenReadCompletedEventArgs)'返回类型错误
码:
webClient.OpenReadCompleted += webClient_OpenReadCompleted;
Run Code Online (Sandbox Code Playgroud)
和:
private List<SightingType> webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
DataContractJsonSerializer ser = null;
var sightingT = new List<SightingType>();
try
{
ser = new DataContractJsonSerializer(typeof(ObservableCollection<SightingType>));
ObservableCollection<SightingType> sightingTypes = ser.ReadObject(e.Result) as ObservableCollection<SightingType>;
foreach (var sightingType in sightingTypes)
{
sightingT.Add(sightingType);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return sightingT;
}
Run Code Online (Sandbox Code Playgroud)
有谁知道我哪里出错了?
我的一个页面上有一个地图控件,我想拍一张照片并将其显示在不同的屏幕上.有谁知道我怎么能做到这一点?地图在a <Grid>
.
我正在使用Retrofit在Android中使用API。成功响应看起来与错误/失败响应不同。因此,我该如何实现呢?
我目前对此有一些影响:
Call<AuthenticateUserResponse> authenticateUser(String id);
Run Code Online (Sandbox Code Playgroud) c# ×4
android ×3
ravendb ×2
actionlink ×1
asp.net-mvc ×1
java ×1
jquery ×1
map ×1
realm ×1
retrofit ×1
return-type ×1
tofixed ×1