OpenLaszlo 5.0.x - HTML5 compile issues - openlaszlo

I know this has got to be something stupid as it use to work...
We have an app that works great in V4.2.0.4... some time ago (year or so) we started playing in the nightly builds and seeing how well our apps work under the HTML5 runtime. After much playing around an a few coding changes, we got there. Still some differences we're trying to work through, but all in all we got it working. The nightly build I was using was from the last one in 2011.
So with all the improvements that have come through, we thought we'd try the newest and see if some of the things we were trying to work around have been fixed. After upgrading, it's looking good until we create the solo version. Once we create the solo when we compile it, we get tons of redefining errors and the solo version also doesn't load at all, I'm guessing the redefining errors are causing problems.
Thinking since it's the new nightly build thats the issue, I go back to the previous version that we had that was working for us. But the issue continues to happen... I don't know how it's possible when our specific code didn't change.
If we make a coding change, even adding a space somewhere, it will compile without the redefining errors again until we create the solo, then they are back.
I'm at a complete loss. We didn't make code changes on our end so if nothing else the version we were using for the past year should still at least preform as before? What am I missing or being dumb about? Any ideas?
Sorry can't really do any code snippit as it's on a whole application type thing.
Here are a few of the errors.. all point to LFCdhtml-debug.js (line 698)
ERROR:
Redefining $lzc$class__mvd from () to () (an empty string)
LFCdhtml-debug.js (line 698)
ERROR:
Redefining $lzc$class__mve from () to () (an empty string)
LFCdhtml-debug.js (line 698)
ERROR:
Redefining $lzc$class__mw8 from () to () (an empty string)
LFCdhtml-debug.js (line 698)
ERROR:
Redefining $lzc$class__mw9 from () to () (an empty string)
LFCdhtml-debug.js (line 698)
I use the developer console to create the solo. Is the command line tool better? Haven't had a chance to use it.
I will try the lzt=clearcache and see if it helps.
Thanks for the help so far!

Related

Cargo Clippy throws error 'Question mark operator is useless here' - are suggestions okay to implement?

I've taken over a deploy process and part of this runs Cargo Clippy which was working fine up until late last week, when I started getting this error:
error: Question mark operator is useless here
I've read the suggested link https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
and understand that the ? is no longer required, and have had a look at the suggested changes it offers. I just want to know whether it is okay for me to make the changes as suggested, as some seem to remove some code so I'm not sure whether the result will be the same.
Some of the suggested changes seem to be simple and okay:
From this
Ok(dsl::orgs
.filter(dsl::salesforce_id.eq(salesforce_id))
.get_result(conn)?)
To this:
dsl::orgs
.filter(dsl::salesforce_id.eq(salesforce_id))
.get_result(conn)
So I'm guessing that the above type of change is safe to accept?
Then I have these
Here the 'optional' has disappeared in the suggested fix. From:
Ok(dsl::orgs
.filter(
dsl::customer_id
.eq(new_org.customer_id)
.and(dsl::name.eq(&new_org.name)),
)
.get_result(conn)
.optional()?)
To
dsl::orgs
.filter(
dsl::customer_id
.eq(new_org.customer_id)
.and(dsl::name.eq(&new_org.name)),
)
And this one, where the inner join has disappeared in the suggested fix:
Ok(orgs::dsl::orgs
.filter(orgs::dsl::customer_id.eq(customer_id))
.filter(orgs::dsl::kind.eq(org_kind))
.filter(
orgs::dsl::kind
.eq(OrgKind::Production)
.or(orgs::dsl::name.eq(&org_name)),
)
.inner_join(schema::customers::dsl::customers)
.get_result(conn)?)
to this:
orgs::dsl::orgs
.filter(orgs::dsl::customer_id.eq(customer_id))
.filter(orgs::dsl::kind.eq(org_kind))
.filter(
orgs::dsl::kind
.eq(OrgKind::Production)
Are these 2 suggested fixes okay to implement? Could someone please provide some help?
I've taken over a deploy process and part of this runs Cargo Clippy which was working fine up until late last week,
The lint appeared last week because Rust 1.51 and a new accompanying Clippy version was released last Thursday, and it added needless_question_mark.
when I started getting this error:
Your CI should probably not consider all Clippy lints to be errors. Clippy is designed to give warnings about many things that are simply code style improvements, or possible problems; counting them as errors will lead to unnecessary breakage in the future.
So I'm guessing that the above type of change is safe to accept?
Ok(some_expression?) is almost the same as some_expression. The only difference is that the version with ? may implicitly convert the error type of the expression (the E in Result<T, E>) to the error type expected by the function. If the error types are the same and no conversion is required, then you can remove the Ok and ? and get the same results; if the error types are different, the simplified version will not compile.
Here the 'optional' has disappeared in the suggested fix.
This seems like a bug in Clippy or whatever tool is applying the fix, as the resulting code is semantically different and would not even compile. I'd remove the Ok and ? manually in that case, and report the bug.

VS 2010 C++ phantom compile errors

problem: when attempting to build completed code VS 2010 returns with compile errors. when "errors" are checked in text environment after a few seconds VS 2010 recognizes that "errors" were in fact not errors at all with no external input. when build is attempted again the entire chain of events restarts.
theories: when i attempt to build VS 2010 it appears to "forget" many of the classes and structs that i have defined. many of the errors are required ';' in between a class or struct declaration and the variable name that it is attached to and the red squiggle that indicates an error appears under the struct / class definition.
Example: myStruct myNamedStruct; //in this case "myStruct" would show a red line underneath for a few seconds when viewed after each build attempt but then VS would decide it is fine after a few seconds.
Trouble Shooting: i have hit the "clean solution" button within the build tab and it consistently returns "Clean: 1 succeeded, 0 failed, 0 skipped" which seams like a positive response to me. i have tried restarting VS, hiding the .suo file (to make intellisense behave), systematically opening each program file forcing VS to properly run it's error diagnostic on each, along with tinkering with turning off and on some of the code environment settings within the tools -> options window.
The rest: i am not naive i am fairly certain my code does have errors within it, but these odd fake errors make it impossible to find and test the real errors. any suggestions would be appreciated.
after significant trouble shooting and research i have come to the conclusion that i was declaring my structs incorrectly (i was not using typedef). i still don't understand why the compiler was only saying they were bad when i tried to build and was ok with these errors the rest of the time.
edit: well after more tinkering the problem still persists. typedef solved the issue for my structs, but my classes are still popping the same "errors".
edit2: after more troubleshooting it was discovered that i had header files indirectly calling themselves through other header files. i guess in effect i was creating endless loops on build. i am still not sure why VS found these errors acceptable in the coding environment but producing errors at build.

Processing insists pause() is not a function, when it very much is

Aite, [first poster here, pls don't bash]
So, I'm using the sound library, which I of course remembered to import, and works just fine, proof being given by the fact that all the other functions I used work as expected and give no problems neither in editor nor in execution.
Except, of course, for this little bugger of a pause() function, which I wrote as per below using no different a syntax from all the other functions, only to find out Processing isn't very keen on accepting its existence.
Problem shows both using 3.3.6 and 3.5.
Oh, and also, apparently isPlaying() returns an int, what's up with that?
If, as I'd suspect, that single line below won't be enough code to couple with the info to get to the bottom of it, here's a Dropbox link to the code (since it uses a bunch of files) so you can test it yourself.
It kinda won't work if you try to run it as is tho because it messes up when trying to load all the songs (in the last line of setup), yeah I kinda need some help with that too... works fine if you only load the first one tho!
https://www.dropbox.com/sh/di7mwit0w2l4513/AABipGDAdoKx277f8Hg_ZfhDa?dl=0
(Please, don't expect clear, extensively commented coding. I started working on this way before I learnt that was a thing. Deeply sorry. Of course, you can ask away about anything baffling you)
What did I try, er, writing it well???
I used .play(), .stop(), the volume ones, and they all, as per stated, work fine.
import processing.sound.*;
SoundFile[] songs= new SoundFile[1];
void setup(){
songs[0]=new SoundFile(this,"Small Bump.mp3");
songs[0].play();
}
void draw(){
}
void keyPressed(){
if (songs[0].isPlaying()==1)songs[0].pause();
}
When I copy your code into my Processing editor, I get a couple errors:
songs[0]="Small Bump.mp3";
The sounds array holds instances of SoundFile, but you're trying to store a String value here. Maybe you're looking for the SoundFile constructor?
if (songs[0].isPlaying()==1)
The isPlaying() function returns a boolean value, but you're comparing it to an int value.
songs[i].pause();
You haven't declared this i variable anywhere. Probably meant for this to be a 0.
If I fix all of these errors, then your code compiles fine.
You might want to take a look at the reference for the Sound library here.
The Sound library I had installed was 1.3.2, or something of the likes.
All the references I'd read were for 2.0+.
Having updated that through the "add library" menu, all was solved.

PTVS2.1 for VS2012 IntelliSense not work

I already refresh DB!
The example can be work.
My problem is IntelliSense is work on line 5, 6
But at the line 7, tree(parameter) can't not find the method xpath()
IntelliSense is not work on line 7, why?
I try to find the answer, someone say need to Removing project __init__.py can fix the problem.
Where is the __init__.py ?
And there exists other good method to solve problem? like: update VS2013?
This is actually just a limitation of PTVS. To figure out the type of tree, it needs to figure out what etree.parse will return when passed a StringIO and HTMLParser. Depending on the code in parse, this may be near impossible to do without actually executing it.
If you hover over tree, I suspect you'll see that it is an unknown type. To force it to have a certain type, you can write:
assert isinstance(tree, WhateverType)
This will let PTVS know that it will definitely be of that type, though at runtime your program will crash if you are wrong. When support for type hints is added, you will be able to use those instead (but that will likely require updating to the very latest version of Visual Studio).

VC++ EXE standalone has bugs that don't happen in IDE

My program has a very specific error that took me a while to track down - now I don't know how to fix it. My code is very long and in many files and I don't see much point in posting it here.
In the IDE, everything runs fine, in both Debug and Release (with the runtime library set to either /MTd or /MT, respectively, so I'm assuming all dependencies are included).
However, when I run the standalone, I get a crash. At first I thought it was a dependency problem but it doesn't seem so.
At some point in the code, I am accessing a vector via a method call: t->GetList(), where GetList is defined as std::vector<T*> & GetList() and the method simply returns a member variable (simply defined as std::vector<T*> field in the class).
It turns out, if I print out the size of the list while running from the IDE, I get 0 (which is the correct answer in this case).
However, when doing the same thing running from standalone, I get the size as 467467353.
I tried changing the method declaration to std::vector<T*> * GetList() and doing return &field; and updating the rest of the code but this didn't fix anything.
I then tried replacing the member variable field with a pointer, and in the constructor instantiating a new vector and deleting it in the destructor. Still no luck.
So I made a simple test case program that simply made a class with a vector field, and a method to return a reference to it. Then in main I would create an instance variable and getting the vector and printing the size. This worked both in VC++ and as a standalone - both returned zero.
This is driving me nuts and I can't figure out why I'm getting different behaviour. Why is the standalone running differently, and what should I be looking at to fix this?
Thanks
Okay so it was literally a bug in my code that was very well hidden. I was dynamically casting to a wrong type.
Somehow it slipped past when I was running on Windows and OSX in both Debug and Release, and as a standalone on OSX. Good thing I found it.

Resources