我在Yii框架中开发Web应用程序.我需要AJAX在我的一些页面中使用.所以,当我点击按钮(我用AJAX加载它们时,Google Chrome Developer Tools浏览器会说:
Failed to load resource: net::ERR_CACHE_MISS
如何解决这个问题呢?
PS:我知道这是重复的问题,但我无法找到解决问题的方法.在一些帖子中,用户说使用Ctrl+ Shift+ N并尝试一下.它会起作用.和/或有人说:用Ctrl+ 重新加载页面,F5因为谷歌浏览器喜欢缓存所有内容..因此,我阅读了所有这些主题并应用了所有解决方案提示.但没有帮助.请帮我...
而且在其他浏览器中,某些页面无法正常工作.但只有Google Chrome Developer Tools回报我的愚蠢错误.
最好.
我用谷歌搜索了 2 周以找到我想要的东西。但是,我无法找到我的问题的答案,我也不知道 Google 相册开发人员如何做到这一点。以下屏幕截图来自 Google 相册应用。
当我单击 时Take a photo,它会启动(或打开)相机并允许拍照或录制视频。我还可以使用以下代码启动相机以不同的意图拍照和录制视频:
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), ACTION_TAKE_PICTURE_RESULT_CODE);
startActivityForResult(new Intent(MediaStore.ACTION_VIDEO_CAPTURE), ACTION_TAKE_VIDEO_RESULT_CODE);
Run Code Online (Sandbox Code Playgroud)
这些行没有任何错误/问题。但我的问题是,如何启动相机拍照或录制视频?
我希望我的问题(问题)很清楚。
Firebase 崩溃报告捕获的异常:
异常 java.lang.RuntimeException:无法启动活动 ComponentInfo{com.talmir.mickinet/com.talmir.mickinet.activities.HomeActivity}:android.content.res.Resources$NotFoundException:资源 ID 0x7f080058 android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2249) android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2299) android.app.ActivityThread.access$700 (ActivityThread.java:154) android.app.ActivityThread$H.handleMessage ...
由 android.content.res.Resources$NotFoundException 引起:资源 ID 0x7f080058 android.content.res.Resources.getValue (Resources.java:1883) android.support.v7.widget.AppCompatDrawableManager.c (SourceFile:332) android.support .v7.widget.AppCompatDrawableManager.a (SourceFile:197) android.support.v7.widget.AppCompatDrawableManager.getDrawable ...
HomeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home); // line 238
FirebaseCrash.log("HomeActivity");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
if (!canAccessCamera() || !canAccessExternalStorage() || !canAccessContacts())
requestPermissions(INITIAL_PERMISSIONS, INITIAL_REQUEST);
copyRawFile(R.raw.file_receive);
// other codes...
Run Code Online (Sandbox Code Playgroud)
活动主页.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.talmir.mickinet.activities.HomeActivity"
android:background="@color/snow">
<fragment
android:id="@+id/frag_list"
class="com.talmir.mickinet.fragments.DeviceListFragment"
android:layout_width="match_parent"
android:layout_height="@dimen/phone_list_height">
</fragment>
<fragment
android:id="@+id/frag_detail" …Run Code Online (Sandbox Code Playgroud) java android android-lifecycle android-4.2-jelly-bean android-6.0-marshmallow
假设您有大整数,如1253999939979969998746和9999999999.无论如何在C#中乘以这些大整数?
注意:我试过System.Numerics.BigInteger类构造函数编译器说整数太长了.
你的建议是什么?
如果这个问题超出主题,ps警告我.
这个问题可能看起来很愚蠢和/或不在话题中,但对我来说这很有趣.
在C#假设你有一个变量命名为x和它的类型并不重要(类型的x也许就是int,char,long还是其他什么东西......).对于此x,其操作比另一个更快; x.ToString();还是x + "";?
我不知道哪个更快,但我认为在天文学迭代中 x + ""应该更快.但根据逻辑x.ToString()方法应该更快.
我知道C#是高级编程语言.这就是为什么C#远离机器语言.因此,执行时间减慢.
如果有人测试了这个,请告诉我哪种方法和为什么比另一种方法更快.
这个问题可能看似重复和/或太无聊,但我想使用这种特定的方法来做到这一点.
当用户将字符串输入文本框时,我想获得此字符串键.所以为了做到这一点,我创建了一个具有n(n <= 15000)个唯一值的字典.我希望通过值从这本字典中获取密钥.以下方法效果很好:
Dictionary<int, string> artikullar = new Dictionary<int, string>();
int key = (from elem in artikullar where elem.Value == txt_artikul.Text select elem).First().Key;
Run Code Online (Sandbox Code Playgroud)
在此之前,我尝试使用该First()方法获取密钥:
int key = artikullar.AsParallel().First(new Func<KeyValuePair<int, string>, bool>(val => val == txt_artikul.Text)).Key;
Run Code Online (Sandbox Code Playgroud)
但它抛出了这个错误:
运算符'=='不能应用于'KeyValuePair'和'string'类型的操作数
我以前没用过这个方法.
任何有用的评论或答案将不胜感激.