QltAW.png

Base class constructors are automatically called for you if they have no argument. If you want to call a superclass constructor with an argument, you must use the subclass’s constructor initialization list. Unlike Java, C++ supports multiple inheritance (for better or worse), so the base class must be referred to by name, rather than “super()”. … Read more

How to resolve “Cannot use import statement outside a module” in jest

Also using Babel, Typescript and Jest. Had the same failure, driving me crazy for hours. Ended up creating a new babel.config.js file specifically for the tests. Had a large .babelrc that wasn’t getting picked up by jest no matter what i did to it. Main app still uses the .babelrc as this overrides babel.config.js files. Install jest, ts-jest and babel-jest: babel.config.js (only used by … Read more

Git update submodules recursively

You will also probably want to use the –init option which will make it initialize any uninitialized submodules: Note: in some older versions of Git, if you use the –init option, already-initialized submodules may not be updated. In that case, you should also run the command without –init option.

Resize an Array while keeping current elements in Java?

You can’t resize an array in Java. You’d need to either: Create a new array of the desired size, and copy the contents from the original array to the new array, using java.lang.System.arraycopy(…); Use the java.util.ArrayList<T> class, which does this for you when you need to make the array bigger. It nicely encapsulates what you describe in your … Read more

PHP convert XML to JSON

I figured it out. json_encode handles objects differently than strings. I cast the object to a string and it works now.