Segmentation fault on large array sizes

Segmentation fault on large array sizes

The following code gives me a segmentation fault when run on a 2Gb machine, but works on a 4GB machine.int main(){ int c[1000000]; cout << "done\n"; return 0;}The size of the array is just 4Mb. Is there a limit on the size of an array

Android Shared preferences example [closed]

Android Shared preferences example [closed]

I want to retrieve user input in an app for later usage. For example, the user is prompted to enter all 7 days of the week and types into the editText box "Monday", "Tuesday" etc. Then later in the app a question will come up and ask what

.parent().remove() issue

.parent().remove() issue

I have a jQuery-based form where you can add extra people to the application. I'm cloning the first fieldset and adding it onto the end up to a max of 3 additional people. When you've added 1 extra person then you have the option to remove

Why does Visual Studio start localdb and how can I stop that?

Why does Visual Studio start localdb and how can I stop that?

I'm trying to optimize my Visual Studio experience and my machine in general. I noticed that I have two instances of SQL Server running, one of which is LocalDB. This gets started by Visual Studio. I would rather it didnt start local db

Why first element is destroyed?

Why first element is destroyed?

I have a piece of code like this:class Data{ public: Data(const std::vector &_data) { my_data = _data; } private: std::vector my_data;};int main(){ std::vector> vec = { std::shared_ptr(

pyqt: how to remove a widget?

pyqt: how to remove a widget?

I have a QGroupBox widget with children in it that I want to remove. How do I do that? I can't find any removeWidget, removeChild, removeItem, or anything similar in the docs. I can only see how to remove things from a layout, but that, app

Perforce not syncing files correctly

Perforce not syncing files correctly

I'm using Perforce P4V, the graphical tool, to interface with my Perforce server here at work. I have a project I added to the depot and I accidentally deleted it from my workspace on my local computer, problem is when I use the Get Revisi

What is the HTTP response code for failed HTTP Delete operation?

What is the HTTP response code for failed HTTP Delete operation?

I have a resources with uri /api/books/122 , if this resource doesn't exist at the point where a client sends HTTP Delete for this resource, what is the appropriate response code from this action? Is it 404 Not Found?Thanks 1:Yes, it wou

Is it possible to programmatically detect the caret position within a  element?

Is it possible to programmatically detect the caret position within a element?

Assuming a regular text-box with data in it. Is it possible to detect (via JavaScript) the position of the text-coursor inside that text-box? I am able to detect an ARROW LEFT or ARROW RIGHT keydown event - but how to detect the cursor l

Converting a series of images to a video in Java?

Converting a series of images to a video in Java?

Currently, the functioning prototype has everything it needs to work: A semi-transparent window for easy resizing on the place you want to record, multiple threads to manage screen shot taking, etc., but one last task I need it to do has e

Socket.io disconnect client by id

Socket.io disconnect client by id

I'm new to nodejs and trying to write a chat room as so many people have.The chat consists of multiple rooms and clients. Commands such as /nick /join /help /ls users /ls rooms work as you would expect although I'm having trouble with getti

Convert a given array of integers to a sorted one, by deleting the minimum number of elements

Convert a given array of integers to a sorted one, by deleting the minimum number of elements

I am working on the following problem:I have to convert a given array of integers to a sorted one, by deleting the minimum number of elements.For example: [3,5,2,10,11] will be sorted by deleting ‘2‘ : [3,5,10,11].Or [3,6,2,4,5,7,7] will

d3 pattern to add an element if missing

d3 pattern to add an element if missing

With D3, I'm finding myself doing this a lot:selectAll('foo').data(['foo']).enter().append('foo')I'd like to simply add a node if it doesn't already exist, because I need to do updates at different places in the DOM tree, and the data I hav

How do I edit and delete data in Django?

How do I edit and delete data in Django?

I am using django 1.0 and I have created my models using the example in the Django book. I am able to perform the basic function of adding data; now I need a way of retrieving that data, loading it into a form (change_form?! or something),

Delete user in active directory using c#

Delete user in active directory using c#

I've written some code but not works it throws Exception "An operations error occurred."code -DirectoryEntry dirEntry = new DirectoryEntry("LDAP path", "admin-username", "admin-password");dirEntry.Properties["member"].Remove("username-delet

IF NOT EXISTS in trigger

IF NOT EXISTS in trigger

I have tow tables concept_access and concept_access_log. I want to create a trigger that works every time something is deleted from concept_access, check if there is similar record in log table and if not, inserts new one before it is delet

Best way to replace a whole directory tree in Subversion?

Best way to replace a whole directory tree in Subversion?

Within my Subversion project I have a few directories that contain other open source projects that my code needs. For example ffmpeg, freetype, matrixssl and a few others. What is the best way to update SVN to hold the the latest version of

Deleting duplicates from a large table

Deleting duplicates from a large table

I have quite a large table with 19 000 000 records, and I have problem with duplicate rows. There's a lot of similar questions even here in SO, but none of them seems to give me a satisfactory answer. Some points to consider:Row uniqueness

Fix Eclipse java references database corruption?

Fix Eclipse java references database corruption?

How do I make eclipse rebuild the database of classes contained within a project or workspace? This is what it uses to make the "References" menu action work, what it uses for the "Add import" dialog, etc. Basically, it's part of the core u

JS Regex to find href of several a tags

JS Regex to find href of several a tags

I need a regex to find the contents of the hrefs from these a tags : deleteJust the urls, not the href/ tags. I'm parsing a plain text ajax request here, so I need a regex. 1:You can try this regex:/href="([^\'\"]+)/gExample at: http:/

How to delete leading empty space in a SQL Database Table using MS SQL Server Managment Studio

How to delete leading empty space in a SQL Database Table using MS SQL Server Managment Studio

I imported an Excel sheet with countries into a database table.Unfortunately all rows have some leading empty space.So, how can I delete these empty spaces? 1:This will remove leading and trailing spacesUpdate tablename set fieldName = l

Enabling cors in dropwizard not working

Enabling cors in dropwizard not working

I'm working on a dropwizard application and js ui to interacte with the api. I need to load json data to update views but I have to enable cors in dropwizard before that. I did some staff but it seems not working because dropwizard returns

iOS Safari 8 input overflow scroll

iOS Safari 8 input overflow scroll

I have an issue with form fields on mobile Safari, version 8.1. This appears to be a bug with all version of Safari 8 on mobile.When you type text into an input and that text is then longer than the input itself, the cursor keeps moving rig

JavaScript bookmarklet to delete all cookies within a given domain

JavaScript bookmarklet to delete all cookies within a given domain

I am testing a web app that writes cookies to subdomain.thisdomain.com and several subfolders within that. I'm looking for JavaScript that I can put into a bookmarklet that will delete all cookies under that subdomain, regardless of the fol

Delete instance of a class?

Delete instance of a class?

I have a class that was created like this:function T() { this.run = function() { if (typeof this.i === 'undefined') this.i = 0; if (this.i > 10) { // Destroy this instance } else {