runtime-error

Modifying a char *const string

主宰稳场 提交于 2019-11-26 23:09:19
I know that const char * is a pointer to a const char, while char *const is a constant pointer to a char. I am testing this in the following code: const char *s = "hello"; // Not permitted to modify the string "hello" char *const t = "world"; // Not permitted to modify the pointer t s = "hello2"; // Valid // t = "world2"; // Invalid, gives compilation error // *(s + 1) = 'a'; // Invalid, gives compilation error *(t + 1) = 'a'; // Why does this not work? The last line does not give any error, but causes the program to terminate unexpectedly. Why is modifying the string pointed to by t not

codeigniter CSRF error: “The action you have requested is not allowed.”

心不动则不痛 提交于 2019-11-26 22:58:08
i enabled the csrf_protection option in the codeigniter's config file, and used form_open() function to creat my forms. but when i submit the form, this error occurs: The action you have requested is not allowed. i have done the answers like this topic (taht is most related to my question): question but they didn't work and The problem still remains. config.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-----------------------------------------------------------------

Call requires permissions that may be rejected by user

半腔热情 提交于 2019-11-26 22:46:01
问题 I am trying to make an application that sends location updates of a user after every five minutes. I suppose my code is working just fine but i get an error regarding the permissions that are being used by the application. I am pretty sure that i have added the permissions in the manifest file. Can someone tell me what's wrong? Here is my code. MainActivity.java LocationManager locationManager ; String provider; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

“query function not defined for Select2 undefined error”

笑着哭i 提交于 2019-11-26 21:46:23
Trying to use Select2 and getting this error on multiple item input/text field: "query function not defined for Select2 undefined error" Covered in this google group thread The problem was because of the extra div that was being added by the select2. Select2 had added new div with class "select2-container form-select" to wrap the select created. So the next time i loaded the function, the error was being thrown as select2 was being attached to the div element. I changed my selector... Prefix select2 css identifier with specific tag name "select": $('select.form-select').select2(); This error

Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException Error

陌路散爱 提交于 2019-11-26 20:28:12
问题 Hello I'm a new programmer at an high school level as a result I do not know much about programming and am getting quite a few errors which have been resolved while others I completely do not understand. I am to make a simple Check Box selection program where the user gets to pick between a variety of choices and depending on their action the image changes. The program itself compiles perfectly but when I run it however it gives me some complications. Here is my program: package components;

Error: Could not access the Package Manager. Is the system running? - At Android Studio

牧云@^-^@ 提交于 2019-11-26 20:24:04
问题 I installed android studio and tried to run easy projects. But I caught strange error message: Waiting for device. /usr/local/idea/android-studio/sdk/tools/emulator -avd Nexus-4-18-xhdpi -netspeed full -netdelay none emulator: emulator window was out of view and was recentered Device connected: emulator-5554 Device is online: emulator-5554 Target device: Nexus-4-18-xhdpi [emulator-5554] Uploading file local path: /home/nazar/Documents/coursera-android/Examples/HelloAndroid/out/production

Laravel Error: Method Illuminate\View\View::__toString() must not throw an exception

坚强是说给别人听的谎言 提交于 2019-11-26 20:19:20
问题 Have you seen this lovely error while working in Laravel? Method Illuminate\View\View::__toString() must not throw an exception I have seen it and it's incredibly annoying. I have found out two reasons why this error gets thrown. I just want to help people not take hours and hours of time. View answers & situations below. :) 回答1: There is a very simple solution: don't cast View object to a string. Don't: echo View::make('..'); or echo view('..'); Do: echo View::make('..')->render(); or echo

could not access the package manager. is the system running while installing android application

混江龙づ霸主 提交于 2019-11-26 19:49:31
While installing the android application in the emulator I am getting the following error. Please help me to resolve this error. Error message: emulator.exe -avd avd_name adb wait-for-device adb install path-to.apk could not access the package manager. is the system running while installing android application.... ssaltman You need to wait for the emulator to full start - takes a few minutes. Once it is fully started (UI on the emulator will change), it should work. You will need to restart the app after the emulator is running and choose the running emulator when prompted. As other have said,

Double free or corruption after queue::push

僤鯓⒐⒋嵵緔 提交于 2019-11-26 18:38:56
#include <queue> using namespace std; class Test{ int *myArray; public: Test(){ myArray = new int[10]; } ~Test(){ delete[] myArray; } }; int main(){ queue<Test> q Test t; q.push(t); } After I run this, I get a runtime error "double free or corruption". If I get rid of the destructor content (the delete ) it works fine. What's wrong? derekerdmann Let's talk about copying objects in C++. Test t; , calls the default constructor, which allocates a new array of integers. This is fine, and your expected behavior. Trouble comes when you push t into your queue using q.push(t) . If you're familiar with

OpenCV 2.1: Runtime error

有些话、适合烂在心里 提交于 2019-11-26 18:33:41
问题 I have a program which uses OpenCV. I have a webcam and it captures color frames and I want to convert the color frames to gray-scale frames. So, I used the cvCvtColor(color_frame, gray_frame, CV_BGR2GRAY); to convert the color frames to BW frames. Upon using this color->Grayscale conversion function, I get a runtime error as: OpenCV Error: Null pointer (NULL array pointer is passed) in unknown function, file ..\..\..\..\ocv\opencv\src\cxcore\cxarray.cpp, line 2376 Anyone experienced this