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

When should I use Arrow functions in ECMAScript 6?

When should I use Arrow functions in ECMAScript 6?

The question is directed at people who have thought about code style in the context of the upcoming ECMAScript 6 (Harmony) and who have already worked with the language.With () => {} and function () {} we are getting two very similar ways t

Why does an overridden function in the derived class hide other overloads of the base class?

Why does an overridden function in the derived class hide other overloads of the base class?

Consider the code : #include class Base {public: virtual void gogo(int a){ printf(" Base :: gogo (int) \n"); }; virtual void gogo(int* a){ printf(" Base :: gogo (int*) \n"); };};class Derived : public Bas

How to select a random element in std::set in less than O(n) time?

How to select a random element in std::set in less than O(n) time?

This question with an added constraint.I'm willing to allow not-uniform selection as long as it's not to lop sided. Given that "sets are typically implemented as binary search trees" and I expect they will contain some kind of depth or size

Sub Directory to a different server

Sub Directory to a different server

Is it possible to for a domain e.g. www.myclient.com to have a sub directory hosted on a completly different (our) server?They don't want to point subdomain.myclient.com to our servers so they want it as folder www.myclient/subdomain/Thanks

What are app domains used for?

What are app domains used for?

I understand roughly what an AppDomain is, however I don't fully understand the uses for an AppDomain.I'm involved in a large server based C# / C++ application and I'm wondering how using AppDomains could improve stability / security / per

Why does MPI_Init accept pointers to argc and argv?

Why does MPI_Init accept pointers to argc and argv?

this is how we use MPI_Init functionint main(int argc, char **argv){ MPI_Init(&argc, &argv);…}why does MPI_Init use pointers to argc and argv instead of values of argv? 1:According to the answer stated here:Passing arguments via comma

iOS Google+ Safari cannot open page because address is invalid

iOS Google+ Safari cannot open page because address is invalid

I have two apps one is free and another is paid version. I have implemented google+ share on paid and its working fine. But when I copied code to my free version it doesn't work. I have one Google apis project and added two clients for both

How to use Querystring with $location.path() in AngularJS

How to use Querystring with $location.path() in AngularJS

I want to redirect user to another page after successful login using query string. If I copy & paste to browser's address bar http://example.com/#/login?ref=/path/to/redirect it works fine. But if I use$location.path("/login?ref=/path/to/re

Getting Nested Object Property Value Using Reflection

Getting Nested Object Property Value Using Reflection

I have the following two classes:public class Address{ public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { g

Complex Types of Nullable Values

Complex Types of Nullable Values

For a complex type in entity framework with only nullable properties, why is that for something like the following requires the complex type be instantiated:[ComplexType]public class Address { public string Address1 { get; set; }}public

C#: Get IP Address from Domain Name?

C#: Get IP Address from Domain Name?

How can I get an IP address, given a domain name?For example: www.test.com 1:Dns.GetHostAddresses 2:You could use the GetHostAddresses method:var address = Dns.GetHostAddresses("www.test.com")[0];

Doctrine 2: how to clone all values from one object onto another except ID?

Doctrine 2: how to clone all values from one object onto another except ID?

In $entity variable, there is an object of same type as $other_address, but with all field values filled in.I want to set all fields in $other_address object to have exact same values as $entity object.Is this doable in less then N number o

What is meant by the term “dirty object”?

What is meant by the term “dirty object”?

I see the term "dirty" or "dirty objects" a lot in programming. What does this mean? 1:A dirty object is an object that has changed in its content, but this content has not been synchronized back into the database/disk. It's a typical si

Universal Windows project - HttpClient exception

Universal Windows project - HttpClient exception

I'm trying to implement REST client in Universal Windows project (in Windows 10 universal app) using HttpClient, but the following line:var response = _client.GetAsync(address).Result;throws an AggregateException with the following message:

How to install Boost with specified compiler (say GCC)

How to install Boost with specified compiler (say GCC)

I would like to install boost with specified compilers, such as the gcc-4.9.1 that I have installed in . The current OS is Mac OS X 10.9.4, but I would like this installation process to work on other OS. The documentation of boost is quite

Paramiko Error: Error reading SSH protocol banner

Paramiko Error: Error reading SSH protocol banner

I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different

Wrong payload when using BlueZ stack as peripheral

Wrong payload when using BlueZ stack as peripheral

I tried to follow the steps provided by davidgyoung in this question. Here are the commands I use:hciconfig hci0 uphciconfig hci0 noleadvhcitool -i hci0 cmd 0x08 0x0008 48 45 4c 4c 4f 57 4f 52 4c 44hciconfig hci0 leadvWhich gives me this ou

IndexedDB Performance and IndexedDB v/s WebSQL performance comparison

IndexedDB Performance and IndexedDB v/s WebSQL performance comparison

WebSQL and IndexedDB are both DB API for accessing (CRUD) the underlying embedded database in the web browser. Which, if I am correct, is like SQL for accessing (CRUD) any client-server database like Oracle etc. (in many case support for bo

C fgets versus fgetc for reading line

C fgets versus fgetc for reading line

I need to read a line of text (terminated by a newline) without making assumptions about the length. So I now face to possibilities:Use fgets and check each time if the last character is a newline and continuously append to a bufferRead eac

Excel hyperlink to a specific cell

Excel hyperlink to a specific cell

I need to hyperlink a cell in one spreadsheet to a corresponding cell in another spreadsheet.So for example, C7 in sheet1 has a hyperlink that will bring you to C7 in sheet 2. I need to do this for a fairly large spreadsheet and each hyper

SWIG in typemap works, but argout does not

SWIG in typemap works, but argout does not

I have this file foobar.hclass Foobar {public: void method(int arg[2]) {};};After compiling SWIG interface to Python, if I try to run this method from Python it saysTypeError: in method 'Foobar_method', argument 2 of type 'int [2]'Certainly

Loading .xibs into a UIView

Loading .xibs into a UIView

I have a UIViewController with its own .xib, and I want to use a UISegmentedControl to display different information on the bottom half of the screen. I created a UIView in the container's .xib and connected it to a UIView property called

C# plugin for Google Chrome

C# plugin for Google Chrome

Can I communicate to Google Chrome in C#?For writing a chrome plugin for example. 1:Quick short answer: No, because Extensions require JSON, JavaScript, and HTML.Hi Tony,There are multiple templates on the internet that you can download

Segmentation fault in malloc_consolidate (malloc.c) that valgrind doesn't detect [duplicate]

Segmentation fault in malloc_consolidate (malloc.c) that valgrind doesn't detect [duplicate]

This question already has an answer here: Segfaults in malloc() and malloc_consolidate() 2 answers My program goes in segmentation faults, and I cannot