Java compilation error: Mac

Java compilation error: Mac

I had a compilation problem with Eclipse with 1.7 JDK installed running on Mavericks:class file has wrong version 51.0, should be 49.0So, as this looked like a javac versioning problem I removed all java versions. Installed 1.7_51, installe

ARC weak ivar released before being returned - when building for release, not debug

ARC weak ivar released before being returned - when building for release, not debug

I have a class that creates an object lazily and stores it as a weak property. Other classes may request this object, but must obviously keep a strong reference to it to keep the object from being deallocated:// [email protected] [email protected]

runtime determine type for C

runtime determine type for C

If the type of a variable must be determined as runtime in C but the variable name is fixed and given, is there any way to reuse the code that involves the variable? Actually I am asking about the C counterpart situation of runtime determin

where does main() return its value?

where does main() return its value?

I'm newly using CODE::BLOCKS+mingw compilerIf I don't type return 0 at the end of program,I can see that main() is returning some integer,I learnt that main() returning 0 infers program executes successfully.I don't find any flaw in my code

Pointers in pure functions

Pointers in pure functions

In order to traverse a linked list in Fortran, I use a pointer to the current element that is moved to the next one inside a loop. Trying to apply this inside a pure function that operates on said linked list results in an error. Example: m

Duplicated using directives in multiple files

Duplicated using directives in multiple files

I have got 5 C# files that have 20 using directives in common. I want to get rid of this code duplication, especially because these 20 using directives belong logically together. In C or C++ I would have created an extra header file contain

Address of C++ pointer to class data member in Visual Studio

Address of C++ pointer to class data member in Visual Studio

I'm reading the book Inside the C++ Object Model. In the book there's an example like:struct Base1{ int v1;};struct Base2{ int v2;};class Derived : public Base1, public Base2 {};printf("&Derived::v1 = %p\n", &Derived::v1); // P

Erlang compilation: mixed of “HiPE object code” and “opcode”?

Erlang compilation: mixed of “HiPE object code” and “opcode”?

Is it possible to have a VM instance that executes both HiPE code and the usual "opcode" based objects at the same time?This question is related to : Erlang OTP release compiles with HiPE? 1:Yes, that is how the native compiler is integr

Output of using sizeof on a function [duplicate]

Output of using sizeof on a function [duplicate]

This question already has an answer here: what does sizeof (function name) return? 4 answers Why does the following code give:#includeint voo(){ pri

How to add a reference to assembly in C#? [duplicate]

How to add a reference to assembly in C#? [duplicate]

This question already has an answer here: C# using others code 3 answers I am getting the error: the type 'system.windows.controls.control' is defined

Pointer vs Array in function definition: what is the difference between void fct1(int *p) and void f

Pointer vs Array in function definition: what is the difference between void fct1(int *p) and void f

i wanna know what is the difference betweenvoid fct1(int *p)andvoid fct1(int p[]) i know that both are pointers but are there any differences 1:There is absolutely no difference when used as a function parameter like that. The compiler t

explicit interface implementation, why explicit casting

explicit interface implementation, why explicit casting

When a class explicitly implements an interface why do you need to explicitly cast the class instance to interface in order to use implemented method?(This example is taken from here: MSDN: Explicit Interface Implementation)You have two int

C++ declare an array based on a non-constant variable?

C++ declare an array based on a non-constant variable?

void method(string a) { int n = a.size(); int array[n];}The above code can compile correctly using gcc. How can the size of the array come from a non-constant variable? Does the compiler automatically translate the int array[n] to int* ar

What does lexical file name order mean?

What does lexical file name order mean?

In the package initialization part of the Go specification, what does "lexical file name order" mean? To ensure reproducible initialization behavior, build systems are encouraged to present multiple files belonging to the same package in

Why is it not possible to use uppercase in naming resources in android?

Why is it not possible to use uppercase in naming resources in android?

I recently started developing applications in android and a lot of tutorials have said that we shouldn't use uppercase in naming the resources. Why is that? Also it is not allowed to give extensions such as .png and .xml. If i have two file

Passing an array as `params` argument

Passing an array as `params` argument

I have the following method:void MyMethod(params object[] args){}which I am trying to call with a parameter of type object[]:object[] myArgs = GetArgs();MyMethod(myArgs);It compiles fine, but inside MyMethod I args == { myArgs}, i.e. an arr

Different code / config in Release & Debug build (Obj-C)

Different code / config in Release & Debug build (Obj-C)

I'm writing a Cocoa app in Objective C that's communicating with a webservice and I want it to connect to a sandbox in debug mode and to the real webservice in release mode. All I need is to change on line of code where an object that holds

Swift minimum implementation for types conforming to protocols with default implementations

Swift minimum implementation for types conforming to protocols with default implementations

I am trying to make my own type conforming to CollectionType. With protocol extensions introduced in Swift 2.0, it is now possible to implement only a subset of the required instance methods and, at the same time, have all other methods imp

TypeScript and dot-notation access to objects

TypeScript and dot-notation access to objects

If TypeScript is a strict superset of JavaScript, why is dot notation on an arbitrary object erroneous? I have JS code that I want to convert over to TS for better type safety, but all access using dot notation (eg, myObj.thing) gives me th

+ operator for String in Java [duplicate]

+ operator for String in Java [duplicate]

This question already has an answer here: How does the String class override the + operator? 7 answers I saw this question a few minutes ago, and decid

Number of comparisons made in median of 3 function?

Number of comparisons made in median of 3 function?

As of right now, my functioin finds the median of 3 numbers and sorts them, but it always makes three comparisons. I'm thinking I can use a nested if statement somewhere so that sometimes my function will only make two comparisons. int medi

Is it well-defined behavior to modify one element of an array while another thread modifies another

Is it well-defined behavior to modify one element of an array while another thread modifies another

Given an array of type foo_t[n] and a set of n threads, where each of the n threads reads and modifies a different element of the array, do I need to explicitly synchronize modifications of the array or can I assume that concurrently modify

Forcing the use of english in JDK7 tools

Forcing the use of english in JDK7 tools

I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How

How is conditional initialization handled and is it a good practice?

How is conditional initialization handled and is it a good practice?

I am trying to decide between several possible practices. Say, my function has a number of if() blocks, that work on data, that is unique to them. Should I declare and initialize the local (for the block) data inside the block? Does this ha

Constant value in conditional expression

Constant value in conditional expression

In a coding style question about infinite loops, some people mentioned they prefer the for(;;) style because the while(true) style gives warning messages on MSVC about a conditional expression being constant.This surprised me greatly, since