Parse Issue: Module 'stringByAppendingFormat' not found - objective-c

Writing an iOs7 project, with Xcode 5
I have the following simple code
NSString* inflation=#"test'", *import=#"";
if ([inflation length]>0){
import=[import stringByAppendingFormat:#"\nExports %#",inflation];
}
And I keep getting this error when I try to compile:
Module 'stringByAppendingFormat' not found

LLVM uses import for importing modules (currently an experimental feature but seems to be enabled by default in Xcode). Have a look at the docs.
To resolve your issue, just rename the variable, or compile with "-fno-modules".

There is not an issue with this code, so don't blame ios7 :P
Just change your variable name.
NSString* inflation=#"test'", *importString=#"";
if ([inflation length]>0){
importString=[importString stringByAppendingFormat:#"\nExports %#",inflation];
}

Related

Missing Template Arguments for pcl::gpu::EuclideanClusterExtraction in PCL-1.12

I am trying this example to use PCL with GPU and get the error
~/gpu-pcl/main.cpp:85: error: missing template arguments before ‘gec’
pcl::gpu::EuclideanClusterExtraction gec;
I have tried that example with pcl-1.11.1 and it worked well .But when updated to pcl-1.12.1, I get that error.
My work environment:
Ubuntu 18.04,
with Cmake version 3.20,
Is there anything that I have missed out??
In the documentation of pcl1.12:
template
class pcl::gpu::EuclideanClusterExtraction< PointT >
EuclideanClusterExtraction is a template class, thus the type of point of the point cloud is needed in the position of PointT, for example, PointXYZ.[https://pointclouds.org/documentation/classpcl_1_1gpu_1_1_euclidean_cluster_extraction.html#details]

The 'graphlib' utility is a mandatory dependency

I am using joint js 3.1.1 version and graphlib 2.1.8 version.
I have a code in my app to check cyclic reference in graph. For that purpose I have written below code
graphlib.alg.findCycles(graph.toGraphLib())
This line gives following error
Uncaught Error: The the "graphlib" utility is a mandatory dependency.
at Object.toGraphLib (joint.min.js?de6d:8)
at child.He.toGraphLib (joint.min.js?de6d:8)
at RestrictCyclicConnection (links.js?2d1e:46)
at child.eval (businessobjectdesigner.vue?b25b:856)
at triggerEvents (backbone.js?ab5c:338)
at triggerApi (backbone.js?ab5c:322)
at eventsApi (backbone.js?ab5c:110)
at child.Events.trigger (backbone.js?ab5c:312)
at child.notify (joint.min.js?de6d:8)
at child._notifyConnectEvent (joint.min.js?de6d:8)
I have imported graphlib in my file also. But still getting following error.
I have imported graphlib as
import graphlib from 'graphlib'
You can try by passing graphlib as a part of the options object, as follows-
graph.toGraphLib({graphlib: graphlib})

"inferred type is FragmentManager? but FragmentManager was expected" error after moving to androidX

I just moved my project to androidX. I used android studio refactor->upgrade to androidX. TargetSDK was already 28 and was working fine. So was not expecting many errors. But I was wrong and getting many errors, most of them are about fragmentManager
inferred type is FragmentManager? but FragmentManager was expected
This is when I am calling show method of a custom bottomSheetDialogue in a fragment.
bottomDialog.newInstance(//options here
).show(fragmentManager, bottomDialog.TAG)
The method is annotated as Nullable. Change like this
fragmentManager?.let { manager ->
bottomDialog.newInstance(//options here
).show(manager, bottomDialog.TAG)
}
Make sure you import androidx.fragment.app.FragmentManager instead of a android.app.FragmentManager
I ended up using parentFrgamentManager and it solved the issue. I tried with supportFragmentManager but it wasn't recognised, so used parentFragmentManager. This is the code I used.
bottomDialog.newInstance(//options here
).show(parentFragmentManager, bottomDialog.TAG)

Using sun.reflect package with openjdk11

Is there a way to use sun.reflect in OpenJDK11, by maybe adding something in "--add-exports"? Our code fails since a jide pkg internally uses sun.reflect package and I'm trying to see if there's a way to make it work.
I've already tried with the below but that doesn't help.
"--add-exports jdk.unsupported/sun.reflect=ALL-UNNAMED"
Here's the exception, where the underlying class references sun.reflect.Reflection
java.lang.NoClassDefFoundError: sun/reflect/Reflection
I had this problem and fixed it by using a newer version of jide. Changing from jide-whatever:3.2.3 to jide-whatever:3.7.6 was enough to make it work in my case.
If you cannot migrate to newer versions, the solution is to make a wrapper around Throwable().getStackTrace()[n].getClass() and put it in WEB-INF/classes folder
This is simple workaround. It works in many cases.
package sun.reflect;
public class Reflection {
public static Class<?> getCallerClass(int n){
StackTraceElement[] elements = new Throwable().getStackTrace();
return elements[n].getClass() ;
}
}
https://github.com/rafaljot/NoClassDefFoundError-sun-reflect-Reflection
It can be fixed when you update the version of the jars.

Elm Graphics.Input

I'm trying to run the Elm input examples from this page. Specifically, the Text Field example, and I'm getting an error saying that the Graphics.Input module is missing.
I've got this in a file called Main.elm:
import Graphics.Input as Input
main = let (field, state) = Input.field "Type here!"
in lift2 display field state
display field state =
field `above` asText state
If I run elm-server and navigate to localhost:8000, I get the error
Your browser may not be supported. Are you using a modern browser?
Runtime Error in Main module:
Error: Module 'Graphics.Input' is missing. Compile with --make flag or load missing module in a separate JavaScript file.
The problem may stem from an improper usage of:
Input.field, above
Compiling the project with elm --make Main.elm gives me
elm: Graphics/Input.elm: openFile: does not exist (No such file or directory)
Is there something extra I need to do to install the Graphic.Input?
Additional Notes:
I'm running this on a Debian machine, and installed it using cabal install elm fairly recently (Jun 15 2013). The current version is labeled Elm-0.7.1.1.
If I hop into the chromium JS prompt and poke around, it turns out there's no Elm.Graphics.Input module, but there is an Elm.Input. There isn't a function called field, there's a similar looking one called textField, but it isn't trivially interchangeable.
Running this:
import Input
main = let (field, state) = textField "Type here!"
in lift2 display field state
display field state =
field `above` asText state
gives me the error
Your browser may not be supported. Are you using a modern browser?
Runtime Error in Main module:
TypeError: a is undefined
The problem may stem from an improper usage of:
above
The Graphics.Input package is new in version 0.8. So, since you're running version 0.7, that explains your problem.
0.8 was released somewhat recently, but it's definitely been out longer than June 15th, so you probably just forgot to cabal update before installing it. Running cabal update now and then updating elm to 0.8 should fix your issue.