How to concatenate twice with the C preprocessor and expand a macro as in “arg ## _ ## MACRO”?

How to concatenate twice with the C preprocessor and expand a macro as in “arg ## _ ## MACRO”?

I am trying to write a program where the names of some functions are dependent on the value of a certain macro variable with a macro like this:#define VARIABLE 3#define NAME(fun) fun ## _ ## VARIABLEint NAME(some_function)(int a);Unfortunat

How should I deal with “package 'xxx' is not available (for R version x.y.z)” warning?

How should I deal with “package 'xxx' is not available (for R version x.y.z)” warning?

I tried to install a package, usinginstall.packages("foobarbaz")but received the warningWarning message:package 'foobarbaz' is not available (for R version x.y.z)Why doesn't R think that the package is available?See also these questions ref

What is the 'new' keyword in JavaScript?

What is the 'new' keyword in JavaScript?

The new keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language.What is it?What problems does it solve?When is it appropriate and when

Using LIMIT within GROUP BY to get N results per group?

Using LIMIT within GROUP BY to get N results per group?

The following query:SELECTyear, id, rateFROM hWHERE year BETWEEN 2000 AND 2009AND id IN (SELECT rid FROM table2)GROUP BY id, yearORDER BY id, rate DESCyields:year id rate2006 p01 82003 p01 7.42008 p01 6.82001 p01 5.92007

Reference: What is variable scope, which variables are accessible from where and what are “undefined

Reference: What is variable scope, which variables are accessible from where and what are “undefined

Note: This is a reference question for dealing with variable scope in PHP. Please close any of the many questions fitting this pattern as duplicate of this one.What is "variable scope" in PHP? Are variables from one .php file accessible in

What is a NullPointerException, and how do I fix it?

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? 1:When you dec

Console.log IE9 issue

Console.log IE9 issue

I made a simple Task Manager using local.storage and I'm using console.log to set some variables but with that, the entire task app doesn't work in IE.Is there any alternative method of doing this? Here is the fiddle of the working Task Man

How can I ensure no code uses an API?

How can I ensure no code uses an API?

I want to ban use of iostreams in a code base I have (for various reasons). Is there a way I can inspect symbol files or force the compiler to emit an error when that API is used? 1:A simple approach is provide a dummy iostream implement

How to emulate a BEFORE INSERT trigger in T-SQL / SQL Server for super/subtype (Inheritance) entitie

How to emulate a BEFORE INSERT trigger in T-SQL / SQL Server for super/subtype (Inheritance) entitie

This is on Azure.I have a supertype entity and several subtype entities, the latter of which needs to obtain their foreign keys from the primary key of the super type entity on each insert. In Oracle, I use a BEFORE INSERT trigger to accomp

Put a button over an ImageView

Put a button over an ImageView

I'm newbie in Android.I would like to know if it's possible to put a button or another component over an ImageView. I've tried setting the image as a background image of a LinearLayout, but when I change between landscape and portrait mode,

How do i find out the JDK version Eclipse is using?

How do i find out the JDK version Eclipse is using?

I see JRE all over the place, but i can not be sure which JDK is compiling my code. How do i find out? 1:Actually Eclipse has its own compiler. You can develop java apps using only the JRE and Eclipse 2:You can still check/set which J

Warning: connect.static is not a function Use --force to continue

Warning: connect.static is not a function Use --force to continue

I am using YO lessapp project, "grunt-contrib-connect" helps me to start a node js server on 9000 port. Whenever I run grunt serve (start the server) the service is aborted due to the below warning.Running "connect:livereload" (connect) tas

CoreData: “Dangling reference to an invalid object.” error

CoreData: “Dangling reference to an invalid object.” error

I'm working on a Cocoa-Touch app, it uses CoreData and has some NSPersistentObject subclasses generated by the XCode model editor.I've noticed that recently, when saving the context I get an error which has as user info the following part:(

How to merge array and preserve keys?

How to merge array and preserve keys?

I have two arrays:$array1 = array('a' => 1, 'b' => 2, 'c' => 3);$array2 = array('d' => 4, 'e' => 5, 'f' => 6, 'a' => 'new value', '123' => 456);I want to merge them and keep the keys and the order and not re-index!!How to get like this?A

How Do You Delete Duplicate Records In SQL

How Do You Delete Duplicate Records In SQL

How to delete duplicate records in sql? 1:In SQL Server 2005 and above:WITH q AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY dup_column ORDER BY dup_column) AS rn FROM mytable )DELETEFROM qWHERE rn

R quantmod chartSeries newTA chob - modify legend and axis (primary and secundary)

R quantmod chartSeries newTA chob - modify legend and axis (primary and secundary)

This is an advanced question.I use my own layout for the chartSeries quantmod function, and I can even create my own newTA. Everything works fine. But ...What I want to do but I can't:a) Manipulate the legend of each of the 3 charts: -

Remove a ReactiveCocoa signal from a control

Remove a ReactiveCocoa signal from a control

If I assign a signal to a property of a control: RAC(self.loginButton.enabled) = [RACSignal combineLatest:@[ self.usernameTextField.rac_textSignal, self.passwordTextField.rac_textSignal

javascript equivalent of PHP's call_user_func()

javascript equivalent of PHP's call_user_func()

Does anyone know if there is one?I want to call a function using a variable name.edit:I posted a fiddle here with what I'm trying to do:http://jsfiddle.net/sAzPA/ ...js:(function($){ $.fn.MyPlugin = function(){ return this.each(functio

Understanding MyISAM record structure

Understanding MyISAM record structure

I am trying to understand how MyISAM physically store its records and how it maintains its structure after record insertion and record deletion. I have read the following link:MyISAM Dynamic Data File LayoutMyISAM Record StructureI want to

Google Script: Conditionally copy rows from one sheet to another in the same spreadsheet

Google Script: Conditionally copy rows from one sheet to another in the same spreadsheet

I read Google Script: Conditionally copy rows from one spreadsheet to another and could not make it work for me.I need a script that will allow me to do the quoted text below. Please feel free to edit my spreadsheet to make a complete work

Request authorization to Media Library programmatically fails

Request authorization to Media Library programmatically fails

iOS 10 now requires the user's permission to access the Media Library. We check if we have access to the Media Library before we use it, and if not we then use [MPMediaLibrary requestAuthorization: to request authorization again from the us

Best practice for conducting a Magento update? [closed]

Best practice for conducting a Magento update? [closed]

What is the best practice for making a Magento update (of a badly maintained Magento installation).I think of things like the following:Have a look at full overwrites modules in app/code/local - compare the files with the old version and fo

How create a P2P web-chat without any server?

How create a P2P web-chat without any server?

is there a way to create a P2P web-chat without any server ? 1:If you're willing to use Flash, check out Adobe Stratus, which allows for peer to peer data and video streaming. http://labs.adobe.com/technologies/stratus/ 2:Yes, but you

Precompiled Headers in Header Files

Precompiled Headers in Header Files

I ran into precompiled headers today for the first time..forever changing my life. I can't believe compiling my C++ code could be that fast. It makes total sense now..Anyway, one thing that is confusing me is that from what I've read so f

php5apache2_4.dll not found error

php5apache2_4.dll not found error

I'm trying to integrate php on Apache. Following is the versions I'm usingApache 2.4 (httpd-2.0.64-win32-x86-openssl-0.9.8o)PHP (php-5.5.0-Win32-VC11-x64.zip)I'm setting this on a 64 bit windows 7 machine. I have made the configurations as