AJAX and the NetBurner Version 3

Post your example source code and application notes to share with others
Post Reply
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

AJAX and the NetBurner Version 3

Post by tod »

Updated to use jQuery, Knockout, Bootstrap, Modernizr and HTML5 with CSS3. The project includes all the minimized versions of the libraries. If you start a project from this you'll want to download the full debug versions. I wrote up a brief blog entry which also has an overview video. I took away Prototype and most of my custom JavaScript code. I added in C++ a dumbed down customized version of my JsonCreator class. The full library was not really written for public consumption but I didn't want to do another version where the JSON objects are all created by concatenating strings. Ideally, I'd like to take one of the public JSON creation/serializer libraries and make it work for the NetBurner.

Oh yeah it was written for the MOD5441x dev board, although it should work on other modules as well, but I suspect you'll have to turn off the A/D stuff.
Attachments
NBShell_V3.zip
(6.89 MiB) Downloaded 1306 times
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: AJAX and the NetBurner Version 3

Post by dciliske »

Hey Tod,

I'm having some issues building/running the project. I'm encountering the following error on boot:

Code: Select all

terminate called after throwing an instance of 'std::length_error'
                                                                    what():  basic_string::_S_create
I suspect that this is due to some constructor being called in the global/static context blowing up in my face. Have a guess where to look?

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: AJAX and the NetBurner Version 3

Post by dciliske »

Oh joy... it works when compiled with NBEclipse, but not with Make... -.-

Guess I've got a new project coming up...

Edit: Nevermind... I shoulda known that it was a C++ism with one of Tod's projects. Aparently I need to turn on exceptions in the makefile; NBEclipse does that automagically for C++ projects.

Edit 2: ...And it was still different. It ended up being that the order of the make targets was the culprit, as that determined their link order and therefore the order of their static constructors.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: AJAX and the NetBurner Version 3

Post by tod »

First of all, glad I could help! :)

The resolution to the problem strikes me as somewhat strange. Eclipse does not (to the best of my knowledge) automatically turn on Exception handling. In fact, for this project under the project Properties->C/C++ Build->Settings->Gnu C++ Compiler-> Miscellaneous settings (see image) I have the checkbox enabled for No exceptions handling (-fno-exceptions).

My first course for Pluralsight looks like it's going to be an in depth tour of using Eclipse for C++ and Java. Maybe I'll entice Dan to switch over (you can still keep using MakeFiles in Eclipse).

Dan, if there's something in the code I could do that would have prevented this error (or at least made it more obvious what needed corrected) let me know.
C/C++ Misc. Settings
C/C++ Misc. Settings
Ajax3Settings.png (75.84 KiB) Viewed 18943 times
Tod
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: AJAX and the NetBurner Version 3

Post by tod »

I would guess you're seeing the dependency of TcpServer on TcpServerReset. This is what I get for trying to upgrade old code instead of rewriting it. I might have others in there as well. Instantiating static objects like I'm doing here is a VERY BAD idea. I even talk about the dangers of non-local static objects (NLSOs) on the wiki. A case of do as I say not as I do.

The code should take a lazy loading approach and leave the statics null until requested (more of a standard singleton pattern). Not so much to save the cost of instantiation but to to defer the instantiation until after the program fully boots so that this type of linker dependency is avoided. When I get a chance I'll fix the code and reupload it.
EddieSVab
Posts: 6
Joined: Wed Jun 05, 2019 9:22 am

AJAX and the NetBurner Version 3

Post by EddieSVab »

Afternoon eValid. Ive read on the forums and like to know:

Can you say why eValid is superior for monitoring AJAX applications?

Thanks
Post Reply