FlashBuilder won't import - flash-builder

I am using FlashBuilder 4.6.
My relevant directory structure is as follows:
>src
+(default package)
pandorica.as
pandorica.mxml
+assets
+com
comBrowse.as
comBrowse.mxml
comLoad.as
comLoad.mxml
comSave.as
comSave.mxml
In the pandorica.as file I have the code:
import com.comBrowse;
import com.comLoad;
import com.comSave;
For some reason the compiler throws the errors:
1172: Definition com:comLoad could not be found.
1172: Definition com:comSave could not be found.
The files definitely exist and are in the exact same format as the com.comBrowse file (which the compiler sees).
Any suggestions as to what could be the matter??
Thanks for your constructive answers.

After playing around with this for FAAAAAAR too long I figured out a fix but still have no clue as to why it was happening. Flex was not allowing me to have the .as and .mxml files in the same directory. I ended up having to change the directories as follows:
>src
+(default package)
pandorica.as
pandorica.mxml
+assets
+com
+as
comBrowse.as
comLoad.as
comSave.as
comBrowse.mxml
comLoad.mxml
comSave.mxml

Related

Python.Net: how to execute modules in packages?

I'm not a Python programmer so apologies if I don't get some of the terminology right (pacakages, modules)!
I have a folder structure that looks something like this:
C:\Test\System\
C:\Test\System\intercepts\
C:\Test\System\intercepts\utils1\
C:\Test\System\intercepts\utils2\
The last three folders each contain an empty __init__.py folder, while the latter two folders (\utils1, \utils2) contain numerous .py modules. For the purposes of my question I'm trying to execute a function within a module called "general.py" that resides in the \utils1 folder.
The first folder (C:\Test\System) contains a file called "entry.py", which imports the .py modules from all those sub-folders:
from intercepts.utils1 import general
from intercepts.utils1 import foobar
from intercepts.utils2 import ...
..etc..
And here is the C# code that executes the above module then attempts to call a function called "startup" in a module called "general.py" in the \utils1 folder:
const string EntryModule = #"C:\Test\System\entry.py";
using (Py.GIL())
{
using (var scope = Py.CreateScope())
{
var code = File.ReadAllText(EntryModule);
var scriptCompiled = PythonEngine.Compile(code, EntryModule);
scope.Execute(scriptCompiled);
dynamic func = scope.Get("general.startup");
func();
}
}
However I get a PythonException on the scope.Execute(...) line, with the following message:
No module named 'intercepts'
File "C:\Test\System\entry.py", line 1, in <module>
from intercepts.utils1 import general
I'm able to do the equivalent of this using IronPython (Python 2.7), so I assume I'm doing something wrong with Python.Net (rather than changes to how packages work in Python 3.x).
I'm using the pythonnet 3.0.0 NuGet package by the way.
Edit
I've tried importing my "entry.py" module as follows:
dynamic os = Py.Import("os");
dynamic sys = Py.Import("sys");
sys.path.append(os.path.dirname(EntryModule));
Py.Import(Path.GetFileNameWithoutExtension(EntryModule));
It now appears to get a little further, however there's a new problem:
In the "entry.py" module you can see that it first imports a module called "general", then a module called "foobar". "foobar.py" contains the line import general.
When I run my C#, the stack trace is now as follows:
No module named 'general'
File "C:\Test\System\intercepts\utils1\foobar.py", line 1, in <module>
import general
File "C:\Test\System\entry.py", line 2, in <module>
from intercepts.utils1 import foobar
Why can't the second imported module ("foobar") "see" the module that was imported immediately before it ("general")? Am I even barking up the right tree by using Py.Import() to solve my original issue?
This turned out to be a change in how Python 3 handles imports, compared to 2, and nothing to do with Python.Net.
In my "foobar.py" module I had to change import general to from . import general. The issue is explained here but I've included the pertinent section below:

How to add javascript js files into qmldir with qt_add_qml_module

I am creating a Qt6 QML module with qt_add_qml_module.
qt_add_qml_module(SQUtils_Logger_Qml
URI SQUtilsLogger.Qml
VERSION 1.0
SOURCES
LoggerQml.cpp
QML_FILES
Log.js
Logm.mjs
LoggerQml.qml
)
But the generated qmldir contains only the information about the qml file: the js and mjs files are missing.
module SQUtils.Logger.Qml
linktarget SQUtils_Logger_Qmlplugin
optional plugin SQUtils_Logger_Qmlplugin
classname SQUtils_Logger_QmlPlugin
typeinfo SQUtils_Logger_Qml.qmltypes
prefer :/SQUtils/Logger/Qml/
LoggerQml 1.0 LoggerQml.qml
It is a problem because when I run ninja all_qmllint, the compiler/linter complains that Log is not defined:
// View.qml
import SQUtils_Logger_Qml
//import "qrc:/SQUtils/Logger/Qml/Log.js" as Log
ApplicationWindow {
Component.onCompleted: {
Log.debug("QML main application complete")
}
}
Warning: View.qml:120:13: Unqualified access
Log.debug("QML main application complete)
If I append Log 1.0 Log.js to the qmldir file, then the linting works.
What I am doing wrong? Is this a bug? The qt documentation for qt_add_qml_module quotes:
QML_FILES lists the .qml, .js and .mjs files for the module. [...]
The files will also be used to populate type information in the generated qmldir file.
Thank you for your help!
Note: I can manage to run my code by uncommenting import "qrc:/SQUtils/Logger/Qml/Log.js" as Log, but the lint still does not work.
It was indeed a Qt bug, corrected two days ago. It will be corrected in versions greater than 6.2.2:
https://bugreports.qt.io/browse/QTBUG-100326

what exactly is `xla_client` in the jax library?

If you read the jax source code you'll hit something called xla_client. Often imported like this
from . import xla_client
This implies that xla_client is a python module, but I can't find any file with that name or reference to a variable of that name.
I assume that it is related to https://pypi.org/project/jaxlib/, but this package just links back to the jax source code.
Can anybody clue me in?
The file you're referring to is stored at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/xla/python
Let me expound further: xla_client is partly a wrapper around a specially compiled c++ file called xla_extension.so, for example see
from . import xla_extension as _xla
and numerous references to _xla throughout xla_config. The source for this file is https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/python/xla.cc, which we know because it says so quite clearly in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/python/BUILD
pybind_extension(
name = "xla_extension",
srcs = [
"xla.cc",
],
...

Compiling and Llnking to used modules in external directory Compaq Fortran command prompt

I've already asked a similar question, here:
Linking to modules in external directory Compaq Visual Fortran command prompt
And I thought that the first answer was correct (that is, in the manual they say you can simply specify the path name before the module), but after deleting the temporary files in my library folder, this approach seemed to stop working. Trying with the /include[:path] approach, here is my .bat file:
df /include:..\FORTRAN_LIB\ __constants
myIO griddata_mod myfdgen myDiff magneticField /exe:magneticField
And an error is returned saying:
__constants
myIO
griddata_mod
myfdgen
myDiff
magneticField
f90: Severe: No such file or directory
... file is '__constants'
Again, I apologize that this question is VERY specific, but it seems like it should be simple and does not work at all.
p.s. Originally, I was using:
df ..\FORTRAN_LIB\__constants ..\FORTRAN_LIB\myIO
..\FORTRAN_LIB\griddata_mod ..\FORTRAN_LIB\myfdgen
..\FORTRAN_LIB\myDiff magneticField /exe:magneticField
But, as I've said, it stopped working after I deleted the temporary files in my FORTRAN_LIB folder. Also note, these .bat files used only one line, I've broken them into several lines just for readability. I would prefer using the /include[:path] option since that seems like a better solution.
Okay, so I think I figured out a workaround at the very least. I understood that the /include[:dir] specifies to search in "dir" for included files. But it seemed from documentation, that this also specifies to search for USEd modules but that doesn't seem to be the case.
My program now looks like this:
include '..\FORTRAN_LIB\__constants.f90'
include '..\FORTRAN_LIB\computeError.f90'
include '..\FORTRAN_LIB\griddata_mod.f90'
include '..\FORTRAN_LIB\myfdgen.f90'
include '..\FORTRAN_LIB\myDiff.f90'
include '..\FORTRAN_LIB\myIO.f90'
program magneticField
use constants
use computeError_mod
use griddata_mod
use myfdgen_mod
use myDiff_mod
use myIO_mod
implicit none
...
And my DF command like this:
df magneticField /exe:magneticField
And everything seems to work fine. It would be nicer to have the /include[:dir] option, but so long I'm able to reach in a separate directory, I'm satisfied. If anyone can find a better solution I'll switch the checkmark. I hope this helps with anyone else who was confused like me.

Linking Error in Class Import

"_OBJC_CLASS_$_CustomerNameViewController", referenced from:
objc-class-ref-to-CustomerNameViewController in Kunden.o
I am getting this error even i have already imported header file of "CustomerViewController.h" in "Kunden.h"
Help me!
Make sure that CustomerNameViewController.m (implementation file for CustomerNameViewController class) is added to a target you're building.