I have a Shiny app that works perfectly fine from my PC, but when I export it to Shinyapps.io, the pre-compiled rstan object (product of stan_model()) throws an error. Specifically the error I get looking back at the log is this:
159: object#mk_cppmodule
Warning: Error in prep_call_sampler: could not find function "prep_call_sampler"
Checking the compiled stan object, there is a function called mk_cppmodule. It has "formals", "body", and "environment" subheadings. It seems that the function prep_call_sampler is defined in "body" and takes the argument "object." It also seems that this "object" argument is supposed to be in the "formals" section; however, its value is listed as "missing" there.
Like I said, the model runs perfectly fine from my PC, and it has been successfully moved over to Shinyapps.io; however, it throws the error anytime the model is called, which makes me think that it's something to do with the server side not accessing the compiled C++. The model needs to be run by sampling() for the app to work. Has anyone had success getting a pre-compiled rstan model object to run on the Shinyapps.io?
How to get rid of this annoying error? I do not understand what it want me to do.
This happens when I am trying to run a test
Clicking on "Run" follows up with the following
Screen
Clicking on "Continue Anyway" runs the tests normally.
So what should I do in order to stop this window from popping up every time I ran the tests?
Updated:
Here is what I've found myself meanwhile:
From here
if (targetType == PyRunTargetVariant.PYTHON && !isWellFormed()) {
throw RuntimeConfigurationError("Provide a qualified name of function, class or a module")
}
And a function isWellFormed() declaration from here
/**
* Sanity check for "target" value. Does not resolve target, only check its syntax
* CUSTOM type is not checked.
*/
fun TargetWithVariant.isWellFormed() = when (targetVariant) {
PyRunTargetVariant.PYTHON -> Regex("^[a-zA-Z0-9._]+[a-zA-Z0-9_]$").matches(target ?: "")
PyRunTargetVariant.PATH -> !VfsUtil.isBadName(target)
else -> true
}
Everything looks good with a regex of my test class and method names.
Ok, this is really weird.
I took a good look at a regex and found that it doesn't want any '-' in the target path. So renaming a filename from ads_wrapper-tests.py to ads_wrapper_tests.py solves the problem and the window is not popping up any more.
With this issue Error: Provide a qualified name of a function, class or module just got fixed, soon Pycharm would allow using all valid identifier names in target name.
Xcode 8/Swift 3
Can anyone please tell me why I am getting this "expected declaration" error? The use of delegates answered my last question perfectly without getting this error.
Googling other "expected declaration" problems suggests function calls etc being in the wrong place but I don't think thats the case here - I have tried placing delegate?.loadFirstView(viewFromModel: firstView) in a separate function and then calling that function but I just get the same error. See the screenshot below:
Thanks in advance!
P.S: below is a screenshot of when my use of a delegate worked perfectly.
Third Screenshot with delegate call in a separate function:
You have the code (delegate?.loadFirstView(viewFromModel : firstView)) in the wrong place in the class. So move it to any function.
In your working screenshot, the code is written inside the updateClock()method, thus working without any error.
class modelClass{
var delegate : LoadFirstViewProtocol?
let firstView = "First view loaded"
func testing()//Write here user defined method named
{
delegate?.loadFirstView(viewFromModel: firstView)
}
}
I have an error that seems to be associated with <cfscript> db operation
// traffic tracking
myQry = new Query();
myQry.setSQL("INSERT INTO dbo.Traffic (Circuit, Fuseaction, IP_hash) VALUES (:circuit, :fuseaction, :ip_hash)");
myQry.addParam(name="circuit", value="#listfirst(rc.fuseaction, '.')#", cfsqltype="CF_SQL_VARCHAR");
myQry.addParam(name="fuseaction", value="#listlast(rc.fuseaction, '.')#", cfsqltype="CF_SQL_VARCHAR");
myQry.addParam(name="ip_hash", value="#cgi.remote_addr#", cfsqltype="CF_SQL_VARCHAR");
myQry.execute();
The really strange thing is, it looks like the operation completed. What kind of a error is this?
Short answer: It's probably a scoping issue. Try:
var myQry = new Query();
Long-winded waffley answer:
I'd call it an Adobe-developers-being-useless kind of error.
If you look at line 460 of that file, you'll see the error is due to a failure of StructFind to find the query name in the variables scope, and the reason it's appearing in debug input is because there's a try/catch with type any surrounding it. The same functionality could be achieved without causing/catching an error by replacing the try/catch with <cfif StructKeyExists(variables,tagAttributes['name']) > which is basic CFML knowledge, and certainly something a developer of the CF product should know!
The same code still exists in the CF10 version of base.cfc, so you may or not feel like submitting it as a bug in Adobe's CF bugbase - though it's unlikely they'll fix it for CF9 (and uncertain whether they'll feel CF10 is worth the effort either).
However, that would only be side-stepping the issue of the variable not existing, not addressing the real issue of why it doesn't actually exist. Given that the debug info shows the query is successfully executing, and the query code is basically right above that line (starts at line 442), it shouldn't be a repeated/common error, but it may be due to your myQry variable not being scoped, and thus it could be colliding with another variable also called myQry (or even the same var from a separate call to the function) which is happening between the execution of the new Query() and .execute() lines, and thus causing the original query to not be there when the StructFind looks for it.
The solution is to put the keyword var before the first use of myQry which will place it in the local scope for that function - something that should be done for all variables that are only for use within an instance of a function, (otherwise they are placed in the variables scope of the component/request that the function exists within).
I've figured out what caused the problem but I still don't know why - it happened when I started using fmod, and it must have something to do with how the linker decides to bring in and execute static libraries and .dll's. My code under test is a static lib; it refers to fmodex_vc, another static lib, which at some point (though I know not when) decides to load in its fmodex.dll. (Which is in the same directory as everything else, so I don't know why it wouldn't find it.) As far as I know, the code under test absolutely does not call the fmod initialization functions, but maybe fmod has some static global initializers that initialize themselves and load in the dll? And that code only gets pulled in if code in a module that uses it gets...used?
I'm testing unmanaged C++ code using the Visual Studio test framework and when I started using fmod it stopped working: Every test, even "test" tests that do nothing, would report (wrapped for readability):
Unable to get type SlidersTest.UnitTest1, SlidersTest.
Error: System.IO.FileNotFoundException:
The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
After a lot of trial and error, excluding .cpp files and re-adding them, I discovered that only one of the test files elicits the problem; and it only does if this line is called:
EntityMgr::Init();
Interestingly, all the tests start failing with that message if that line is in the code. EntityMgr::Init() is a function that does very little:
EntityMgr* EntityMgr::instG = null;
and
void EntityMgr::Init()
{
instG = new EntityMgr;
}
and
class EntityMgr
{
private:
static EntityMgr* instG;
public:
EntityMgr() // does nothing beyond the default
{
}
static void Init();
static EntityMgr* Inst() { return instG; }
...
vector<Entity> entitiesG;
};
Entity, FWIW, is a pretty vanilla class with no pointers, just various floats for its fields.
No matter how I run the tests (from test view, run selected, run all, run from the command line, from the test menu) I get the error.
Attempting to step into the test with the debugger fails - the test fails before the debugger gets to step in. Setting the debugger to break on System exceptions did nothing as well.
The code under test is a static .lib. CLR support is /clr.
Oh, and this just in: if I call a static Entity member function, same deal. If I move said static function outside of the class, same deal. But, if I move that function to another module, it's fine.
If I set the debugger to break on any exception, I do get something interesting:
First-chance exception at 0x7c812aeb in vstesthost.exe: Microsoft C++ exception: HRException at memory location 0x05129890..
There's no source code at that location, of course. Here's the call stack:
kernel32.dll!7c812aeb()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c812aeb()
[External Code]
msvcr80.dll!78158ed7()
msvcr80.dll!78158e34()
msvcr80.dll!78158047()
msvcr80.dll!7815850e()
msvcr80.dll!78158872()
msvcr80.dll!78158a57()
msvcr80.dll!78158b11()
ntdll.dll!7c9032a8()
ntdll.dll!7c90327a()
ntdll.dll!7c92a9ef()
ntdll.dll!7c90e46a()
kernel32.dll!7c812aeb()
kernel32.dll!7c812aeb()
kernel32.dll!7c812aeb()
msvcr80.dll!78139c4d()
msvcr80.dll!781323ff()
msctf.dll!74755764()
msctf.dll!74721557()
ws2_32.dll!71ab12bb()
ntdll.dll!7c90118a()
ntdll.dll!7c91b084()
ntdll.dll!7c90de7c()
ntdll.dll!7c90d04c()
ntdll.dll!7c90e43f()
kernel32.dll!7c80b713()
And here's the stack trace that mstest reports - I don't get anything useful out of it.
Unable to get type SlidersTest.game_EntityMgr_test, SlidersTest. Error: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.GetType(UnitTestElement unitTest, String type)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.ResolveMethods().
Why is fmod doing this?
I suggest running your application under Dependency Walker's Profile mode (http://www.dependencywalker.com/). It can record all attempts to load DLLs and EXEs, along with the resulting error codes - it sounds likely that the File not Found error is coming from an indirect dependency - perhaps being pulled in from linking FMod.
If this is the case, profiling your application with Dependency Walker will show one or more failed attempts to load a library. One of them will be the one responsible for the error.
Maybe some property was modified for that file? Probably already looked at this, but make sure that all the settings are from "Inherit from parent" in Visual Studio.
Jay
My best guess, from what you've posted so-far is that the exception is being thrown somewhere inside the CLR type loader — it looks like an assembly that you're indirectly dependent on either isn't in the GAC, or isn't being copied to the test directory.
Is there an actual stack trace in the test results? That might help narrow down what type(s) its trying to load.
Since you say that this started happening all of a sudden, I assume that tests with this line of code were working just fine previously. This may be a radical choice, but in the absence of another solution, perhaps you would consider reinstalling visual studio (a long procedure to be sure)
Can you set Visual Studio to break on all exceptions, regardless of where they come from during debugging?
It sounds as if cosmic rays or a faulty hard drive have caused a test .dll to become corrupt, or the dll you're building is corrupt (consistently). Before re-installing all of Visual Studio, you may want to ask it to do a repair, which should check for inconsistencies between your current install and what's on your installation medium.
How is the FMod .dll getting into your test directory? Do you have it set up to copy it to wherever mstest wants the test to occur? Note that "Copy to Output Directory" doesn't actually accomplish this. There's some other method, though I can't remember quite what it is.
I'd run it in a debugger and check the run output - in particular the "loading path\fmodex.dll" line to see if it's loading the right dll.
I've seen similar errors when mixing dlls from different configurations.