What is the type of string literals in C and C++?

What is the type of string literals in C and C++?

What is the type of string literal in C? Is it char * or const char * or const char * const?What about C++? 1:In C the type of a string literal is a char[] - it's not const according to the type, but it is undefined behavior to modify th

Best XML Parser for PHP [duplicate]

Best XML Parser for PHP [duplicate]

This question already has an answer here: How do you parse and process HTML/XML in PHP? 28 answers I have used the XML Parser before, and even though i

What is the most efficient method to groupby on a JavaScript array of objects?

What is the most efficient method to groupby on a JavaScript array of objects?

What is the most efficient way to groupby objects in an array?For example, given this array of objects:[ { Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5" }, { Phase: "Phase 1", Step: "Step 1", Task: "Task 2", Value: "10

Is there a CSS selector for elements containing certain text?

Is there a CSS selector for elements containing certain text?

I am looking for a CSS selector for the following table:Peter | male | 34Susanne | female | 12Is there any selector to match all TDs containing "male"? 1:If I read the specification correctly, no. You can match on an element, th

Return row only if value doesn't exist

Return row only if value doesn't exist

I have 2 tables - reservation: id | some_other_column ----+------------------ 1 | value 2 | value 3 | valueAnd second table - reservation_log: id | reservation_id | change_type ----+----------------+------------- 1

console.log() async or sync?

console.log() async or sync?

I am currently reading Async Javascript by Trevor Burnham. This has been a great book so far.He talks about this snippet and console.log being 'async' in the Safari and Chrome console. Unfortunately I can't replicate this. Here is the code

Why do I need to override the equals and hashCode methods in Java?

Why do I need to override the equals and hashCode methods in Java?

Recently I read through this Developer Works Document. The document is all about defining hashCode() and equals() effectively and correctly, however I am not able to figure out why we need to override these two methods. How can I take the d

How do I test multiple variables against a value?

How do I test multiple variables against a value?

I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to translate this into Python. So say:x = 0y = 1z = 3mylist = []if x or y or z == 0 :

Visual Studio 2013 Preview: No Publish To File System?

Visual Studio 2013 Preview: No Publish To File System?

So I've built my project and I want to use the VS2008/2010/2012 "Publish To File System" option in Visual Studio 2013 Preview to push my project to a staging server for testing... but I can't find it anywhere in any of the menus.It's bad en

Record/Capture Android App Behavior - Convert To Animated GIF

Record/Capture Android App Behavior - Convert To Animated GIF

I would like to capture/record the behavior of my Android app, running on an emulator and make a GIF image out it. Just like this one - 1:First record video from AndroidStudio Select "Screen Record" and save .mp4 video then go to any on

Boost c++ library install

Boost c++ library install

I am not familiar with the usual build technique in linux I am using boost c++ library. Can any body guide me in installing and configuring boost c++ library. Thanks in advance 1:My environment is Linux Fedora 15. On it, one can easily

How can I create a SQLite3 database file using a SQL command file?

How can I create a SQLite3 database file using a SQL command file?

I have a file which contains some SQL commands, something that looks like this:CREATE DATABASE IF NOT EXISTS `db_name`;USE `db_name`;CREATE TABLE IF NOT EXISTS `customers` ( `id` int(10) unsigned NOT NULL, `f_name` varchar(50) DEFAULT NUL

Why doesn't `std::initializer_list` provide a subscript operator?

Why doesn't `std::initializer_list` provide a subscript operator?

Suppose that you are writing a function that accepts an std::initializer_list called list, and that the function requires random access to list's elements. It would be convenient to write list[i] instead of list.begin()[i]. So why doesn't s

Multiple DbContexts on one DB with Code First Migrations

Multiple DbContexts on one DB with Code First Migrations

I stumbled uppon the same problem as described in this question. In addition, i didn't want to loose the __migrationHistory table from the database.I tried it with the suggested Solution of using one "super" context which contains all DbSet

square puzzle solution

square puzzle solution

Question: given an integer number n, print the numbers from 1 up to n2 like this:n = 4result is:01 02 03 0412 13 14 0511 16 15 0610 09 08 07How do you solve it (apart from the solution provided in the link below)?http://www.programmersheave

Parse boolean arithmetic including parentheses with regex?

Parse boolean arithmetic including parentheses with regex?

Is there a single regular expression that can parse a string (in Python and/or Javascript, does not need to be the same expression) that represents simple boolean arithmetic? For example I want to parse this string:a and (b and c) and d or

Installer/packager for a Java application for Ubuntu and SuSE

Installer/packager for a Java application for Ubuntu and SuSE

I have a Java application complied to a collection of jars that I want to make installable on Ubuntu and SuSE. I Want the installer to be able to check for the JRE, register a file association and be able to load a website on un-install.I u

Make a pixel transparent in Matlab

Make a pixel transparent in Matlab

I have imported an image in matlab and before I display it how would I make the background of the image transparent? For example I have a red ball on a white background, how would i make the white pixels of the image tranparent so that only

How do I adapt my svn:externals strategy to git submodules?

How do I adapt my svn:externals strategy to git submodules?

I'm having trouble figuring out how to change my mindset to git and have run in to the following problem. I have the situation where we have a shared engine and multiple projects that use the engine. Internal development teams and second pa

Valid use case for django admin?

Valid use case for django admin?

I want to build a django site where a certain group of trusted users can edit their profile information. Does it make sense to have each trusted user go through the django admin interface? I'd only want them to be able to see and edit their

What is the easiest way in C# to check if hard disk is SSD without writing any file on hard disk?

What is the easiest way in C# to check if hard disk is SSD without writing any file on hard disk?

I need to check in C# if a hard disk is SSD (Solid-state drive), no seek penalty?I used: ManagementClass driveClass = new ManagementClass("Win32_DiskDrive"); ManagementObjectCollection drives = driveClass.GetInstances(); But its only

Which one runs faster, ArrayList or LinkedList? [duplicate]

Which one runs faster, ArrayList or LinkedList? [duplicate]

This question already has an answer here: When to use LinkedList over ArrayList? 28 answers Performance differences between ArrayList and L

Rename multiple directories matching pattern

Rename multiple directories matching pattern

I would like to rename all directories under a basedir which match a name. For example:In basedir/, I have:- foo/bar/blah- my/bar/foo- some/bar/foo1- other/foo/barI would like to rename all directories matching bar, but I would like to pres

GNU Make silent by default

GNU Make silent by default

Is it possible to suppress command echoing by default from within the Makefile?I know that running make in --silent mode will do it, as will prefixing every command with @.I'm looking for a command or stanza I can include inside the Makefil

Is there a way to locate which part of the process used the most of the memory, only looking at a ge

Is there a way to locate which part of the process used the most of the memory, only looking at a ge

I have a process (that is started by a watch-dog every time, it's stopped for some reason), that uses usually about 200MB memory. Once I saw it's eating up the memory - with memory usage about 1.5-2GB, which definitely means a "memory leak"