Frustrating development

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Frustrating development

Gregory Beaver
Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

Joaquín Fernández
Hi Greg

You can debug minified code in Chrome step by step using pretty print tool in developer tools.

Go to Sources tab and click in '{}' icon in bottom toolbar. If this icon is selected, all code is beautified when you debug source code including auto generated code in qooxdoo and minified code from build job.

Hope this help you.

Regards

Joaquín F.

Enviado de Samsung Mobile



-------- Mensaje original --------
De: Gregory Beaver <[hidden email]>
Fecha:
Para: qooxdoo Development <[hidden email]>
Asunto: [qooxdoo-devel] Frustrating development


Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

fritz
In reply to this post by Gregory Beaver
On Wed, 28 Aug 2013, Gregory Beaver wrote:

> I wrote a very complicated application based on qooxdoo a few years ago.
> It still works great but there are some kinks that I was trying to work
> out.  I spent 13 hours over the past week trying to get 50 lines of code
> to work.  8 of that was trying to debug a problem with appearance and the
> magical fact you have to tell some things what they should look like in
> some circumstances, but not in others.  No errors or warnings to assist
> either.

Could you make a playground example out of the 50 lines of code in question?

> Then, I ran into a weird bug with selection that I cannot reproduce with
> any shorter code, and spent 6 hours writing no new code and simply trying
> to figure out where the hell selection is converted to actual highlighting
> in qx.ui.list.List

That should be something the core team should be able to answer.

> There has got to be a better way to do things.  Too much is magic, the
> generated code has no line breaks and can't be stepped through even in
> source mode.

There are generator switches to put linebreaks into the generated code, I
believe. And shouldn't the problem als occur in source mode?

Cheers,
Fritz

P.S.: In my experience mysterious bugs usually have little to do with the
       framework/libraries I use, but are most often "home-made".

--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

John Spackman-3
In reply to this post by Gregory Beaver
It sounds like you were using "generate build" - this produces minified code and you'd normally debug/develop with "generate source" which is entirely readable.  I'm not sure what you were doing wrong but it sounds like there was one or two fundamental misunderstandings or you were trying to do something very specialist and unusual because selection in List is usually trivial to make it work.  Can you give us an example of what you were trying to achieve?  Preferably with a playground example (start at [1] and use the "Shorten URL" button)


John

From: Gregory Beaver <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Thursday, 29 August 2013 05:04
To: qooxdoo Development <[hidden email]>
Subject: [qooxdoo-devel] Frustrating development

Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ qooxdoo-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

Thomas Herchenroeder
In reply to this post by Gregory Beaver
Greg,

thanks for you feedback.

On 08/29/2013 06:04 AM, Gregory Beaver wrote:
> Dear qooxdoo,
>
> I wrote a very complicated application based on qooxdoo a few years
> ago.  It still works great but there are some kinks that I was trying
> to work out.  I spent 13 hours over the past week trying to get 50
> lines of code to work.

Maybe you should hit the mailing list earlier. Sometimes you don't see
the trees for the wood, and it just needs another pair of eye balls to
spot it.

>  8 of that was trying to debug a problem with appearance and the
> magical fact you have to tell some things what they should look like
> in some circumstances, but not in others.  No errors or warnings to
> assist either.

The link between widgets and appearance is soft. Maybe you can open an
enhancement bug to the end that, given a certain flag, the source
version would spit out how the runtime is associating application
objects with appearance id's. That might help.

>
> Then, I ran into a weird bug with selection that I cannot reproduce
> with any shorter code, and spent 6 hours writing no new code and
> simply trying to figure out where the hell selection is converted to
> actual highlighting in qx.ui.list.List

50 lines should be fine for the Playground, given it doesn't involve
other application classes.

>
> As of right now, I have erased all the work and thrown in the towel.
>  I have not had this much frustration and impossibility of solving a
> banal issue since I worked with Microsoft Access in 2000.

You must have been very lucky all the way since...

>
> There has got to be a better way to do things.  Too much is magic, the
> generated code has no line breaks and can't be stepped through even in
> source mode.

That's hard to believe as the source version uses the original source
files, with line breaks, comments and all.

>
> I have literally run out of all of my available time allotted for this
> project, and we have to stick with the older not-quite-working code as
> a result.
>
> If any of you have successfully found a time-efficient way to debug
> problems in selection or binding or any other qooxdoo black magic, I
> would appreciate the tips for the next time I have a block of time to
> try something.  Until then, I hope my utter failure is a wake up call
> from a former evangelist of qooxdoo (one of my blog posts is a top hit
> in google search for qooxdoo with many visitors every day).

One thing I cannot stress enough is that you run the qooxdoo migration
on your code base when you update the SDK version (which I assume you
did). The migration will adjust your code to changed APIs, getting a lot
of things out of your way, and will otherwise print out a various
helpful hints for you to follow. Same goes for warnings in the source
version.

T.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

Gregory Beaver
In reply to this post by Joaquín Fernández
Thank you all for the quick feedback.  A few responses:

1) the prettify feature in chrome was a new one and will make debugging the generated accessors possible, one problem solved
2) I debug in source mode, sorry that was not explicit.  I am not a masochist in that way :)
3) although I was trying to debug 50 lines of code, I neglected to explicitly state that I was drawing upon about 4000 lines of pre-existing code and simply trying to add a new widget in the mix.
4) when a selection is updated in the model, the actual rendering happens magically later and this is where debugging breaks down.  I was able to verify that the selection was properly becoming no selection, but the rendered view selected the same widget even though its underlying model had completely changed.  Even after pouring over the source on github (lots easier than on disk) for hours I was still unable to determine where rendering occurs.  Trying to break on any exception, stepping through the code also failed to locate where it happens.  This is what I mean by "black magic."  Perhaps there is a way to spit out debug info on events in qooxdoo, but I did not see a way when stepping through event handling.
5) what am I actually trying to do?  This should help you all help me.  :)

I am working on the backed to my quartet's website.  We have a calendar which is directly linked to our google calendar.  When an event appears on the private calendar, a cron job pulls the data into a database, spits out an email with the details etc. etc.  I then log into our backend and using qooxdoo, update the event to include detailed information like the concert program, ticket information, the presenter and concert hall, etc.  the backend generates info for our public google calendar, and our website pulls the data out and renders it using PHP.  The qooxdoo backend is 100% separated, and the whole thing uses SQLite and git.  Changes to the website appear at a test site and have to be manually pushed and then pulled to the public website, so it is all redundantly backed up.

The part I am working on is the concert programs.  



On Aug 29, 2013, at 0:53, "Joaquín Fernández" <[hidden email]> wrote:

Hi Greg

You can debug minified code in Chrome step by step using pretty print tool in developer tools.

Go to Sources tab and click in '{}' icon in bottom toolbar. If this icon is selected, all code is beautified when you debug source code including auto generated code in qooxdoo and minified code from build job.

Hope this help you.

Regards

Joaquín F.

Enviado de Samsung Mobile



-------- Mensaje original --------
De: Gregory Beaver <[hidden email]>
Fecha:
Para: qooxdoo Development <[hidden email]>
Asunto: [qooxdoo-devel] Frustrating development


Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

Gregory Beaver
Ack!  Accidentally clicked send.

I have a database of composers, the pieces they wrote and the movements of those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made into 3 classes.  The kids property in composers stores the array of pieces, and the same is true for the kids property of pieces, which stores an array of movements.

I use this to render a tree in one tab of the backend, and I can add composers, pieces and movements as needed.  However, because the data set is so large, I do some lazy loading.  At first, each composer's only child node is a piece called "Loading..."  When the code sees it, it lazy loads the children and updates the display.  All this works perfectly for years and still works.

In the tab where I edit concert info, I am re-using the data from the composers/pieces/movements tab to provide the source to choose program info.  I created a widget years ago that allows clicking a composer from a selectbox qx.ui.form.List, which populates another selectbox with the composer's pieces, lazy loading as necessary, and then chooses movements, lazy loading as necessary.

This process is too slow, it takes me hours because there is a subtle bug where selecting the movements does not actually work unless I de-select them and re-select them.  Also, scrolling through the list of composers and pieces is too slow.

Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a text field and using that to filter the list.  So if we are playing Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will filter the list of 115 composers to just Beethoven.  I click Beethoven and the qx.ui.list.List model changes to the pieces he wrote and the text field changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2" and disables itself.  Meanwhile, the list updates to the 4 movements and I can deselect any we are not playing on that concert.

All of this worked except when I clicked Beethoven, the widget remained selected after the model change and often the movements would not display properly sometimes, with no clear cause-effect, implying an asynchronous issue of some sort.

I pulled out the specific code, and the bug disappeared.  So, there is something about the interaction of the larger code and the smaller that triggers the bug.  This is why I erased the whole thing.  It needs a smarter re-imagining before I can restart it, and as I said, my available development time was this week.  I won't have another window for a month or so.

If you have read this far, thank you!

Thank you also for the quick and calmly measured responses.  Much appreciated

Greg



On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]> wrote:

Thank you all for the quick feedback.  A few responses:

1) the prettify feature in chrome was a new one and will make debugging the generated accessors possible, one problem solved
2) I debug in source mode, sorry that was not explicit.  I am not a masochist in that way :)
3) although I was trying to debug 50 lines of code, I neglected to explicitly state that I was drawing upon about 4000 lines of pre-existing code and simply trying to add a new widget in the mix.
4) when a selection is updated in the model, the actual rendering happens magically later and this is where debugging breaks down.  I was able to verify that the selection was properly becoming no selection, but the rendered view selected the same widget even though its underlying model had completely changed.  Even after pouring over the source on github (lots easier than on disk) for hours I was still unable to determine where rendering occurs.  Trying to break on any exception, stepping through the code also failed to locate where it happens.  This is what I mean by "black magic."  Perhaps there is a way to spit out debug info on events in qooxdoo, but I did not see a way when stepping through event handling.
5) what am I actually trying to do?  This should help you all help me.  :)

I am working on the backed to my quartet's website.  We have a calendar which is directly linked to our google calendar.  When an event appears on the private calendar, a cron job pulls the data into a database, spits out an email with the details etc. etc.  I then log into our backend and using qooxdoo, update the event to include detailed information like the concert program, ticket information, the presenter and concert hall, etc.  the backend generates info for our public google calendar, and our website pulls the data out and renders it using PHP.  The qooxdoo backend is 100% separated, and the whole thing uses SQLite and git.  Changes to the website appear at a test site and have to be manually pushed and then pulled to the public website, so it is all redundantly backed up.

The part I am working on is the concert programs.  



On Aug 29, 2013, at 0:53, "Joaquín Fernández" <[hidden email]> wrote:

Hi Greg

You can debug minified code in Chrome step by step using pretty print tool in developer tools.

Go to Sources tab and click in '{}' icon in bottom toolbar. If this icon is selected, all code is beautified when you debug source code including auto generated code in qooxdoo and minified code from build job.

Hope this help you.

Regards

Joaquín F.

Enviado de Samsung Mobile



-------- Mensaje original --------
De: Gregory Beaver <[hidden email]>
Fecha:
Para: qooxdoo Development <[hidden email]>
Asunto: [qooxdoo-devel] Frustrating development


Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

John Spackman-3
In reply to this post by Gregory Beaver
Are you using the binding mechanism?  There are occasions where the binding can be a pain with selections, particularly in cases where the selection can become empty and there is a whole tree of bound widgets; while binding knows how to apply a value, I often find I have to handle empty selection separately (or, ideally, not allow empty selection).

Without a specific example though it's difficult to say what the problem is.

I know what you mean able difficulty in tracing through the Qx source sometimes – heavily abstracted code (e.g. binding or event handling) can be difficult to track down and set meaningful breakpoints.  One way I've had success with this in the past is to temporarily hack in some extra code into Qx to help – EG I might add a method in qx.ui.form.List overriding a base method so that I can put a breakpoint in it, or add some code that executes "debugger" on some complex condition.  The code doesn't have to pass any kind of review, just make sure you remove after you've fixed the problem :)

John

From: Gregory Beaver <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Thursday, 29 August 2013 13:44
To: Joaquín Fernández <[hidden email]>, qooxdoo Development <[hidden email]>
Subject: Re: [qooxdoo-devel] Frustrating development

Thank you all for the quick feedback.  A few responses:

1) the prettify feature in chrome was a new one and will make debugging the generated accessors possible, one problem solved
2) I debug in source mode, sorry that was not explicit.  I am not a masochist in that way :)
3) although I was trying to debug 50 lines of code, I neglected to explicitly state that I was drawing upon about 4000 lines of pre-existing code and simply trying to add a new widget in the mix.
4) when a selection is updated in the model, the actual rendering happens magically later and this is where debugging breaks down.  I was able to verify that the selection was properly becoming no selection, but the rendered view selected the same widget even though its underlying model had completely changed.  Even after pouring over the source on github (lots easier than on disk) for hours I was still unable to determine where rendering occurs.  Trying to break on any exception, stepping through the code also failed to locate where it happens.  This is what I mean by "black magic."  Perhaps there is a way to spit out debug info on events in qooxdoo, but I did not see a way when stepping through event handling.
5) what am I actually trying to do?  This should help you all help me.  :)

I am working on the backed to my quartet's website.  We have a calendar which is directly linked to our google calendar.  When an event appears on the private calendar, a cron job pulls the data into a database, spits out an email with the details etc. etc.  I then log into our backend and using qooxdoo, update the event to include detailed information like the concert program, ticket information, the presenter and concert hall, etc.  the backend generates info for our public google calendar, and our website pulls the data out and renders it using PHP.  The qooxdoo backend is 100% separated, and the whole thing uses SQLite and git.  Changes to the website appear at a test site and have to be manually pushed and then pulled to the public website, so it is all redundantly backed up.

The part I am working on is the concert programs.  



On Aug 29, 2013, at 0:53, "Joaquín Fernández" <[hidden email]> wrote:

Hi Greg

You can debug minified code in Chrome step by step using pretty print tool in developer tools.

Go to Sources tab and click in '{}' icon in bottom toolbar. If this icon is selected, all code is beautified when you debug source code including auto generated code in qooxdoo and minified code from build job.

Hope this help you.

Regards

Joaquín F.

Enviado de Samsung Mobile



-------- Mensaje original --------
De: Gregory Beaver <[hidden email]>
Fecha:
Para: qooxdoo Development <[hidden email]>
Asunto: [qooxdoo-devel] Frustrating development


Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ qooxdoo-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

John Spackman-3
In reply to this post by Gregory Beaver
Just a thought for when you get back to it then – is there a chance that two bits of code were trying to change the model(s) at the same time?  I have had something similar where recursive binding can cause conflicts and the wrong things get added/removed - e.g. An event changes the model which causes an event which indirectly causes a change to the model etc.  Have you tried setting a long timeout (e.g. a second or two) before adjusting the model?

John

From: Gregory Beaver <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Thursday, 29 August 2013 14:01
To: Joaquín Fernández <[hidden email]>, qooxdoo Development <[hidden email]>
Subject: Re: [qooxdoo-devel] Frustrating development

Ack!  Accidentally clicked send.

I have a database of composers, the pieces they wrote and the movements of those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made into 3 classes.  The kids property in composers stores the array of pieces, and the same is true for the kids property of pieces, which stores an array of movements.

I use this to render a tree in one tab of the backend, and I can add composers, pieces and movements as needed.  However, because the data set is so large, I do some lazy loading.  At first, each composer's only child node is a piece called "Loading..."  When the code sees it, it lazy loads the children and updates the display.  All this works perfectly for years and still works.

In the tab where I edit concert info, I am re-using the data from the composers/pieces/movements tab to provide the source to choose program info.  I created a widget years ago that allows clicking a composer from a selectbox qx.ui.form.List, which populates another selectbox with the composer's pieces, lazy loading as necessary, and then chooses movements, lazy loading as necessary.

This process is too slow, it takes me hours because there is a subtle bug where selecting the movements does not actually work unless I de-select them and re-select them.  Also, scrolling through the list of composers and pieces is too slow.

Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a text field and using that to filter the list.  So if we are playing Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will filter the list of 115 composers to just Beethoven.  I click Beethoven and the qx.ui.list.List model changes to the pieces he wrote and the text field changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2" and disables itself.  Meanwhile, the list updates to the 4 movements and I can deselect any we are not playing on that concert.

All of this worked except when I clicked Beethoven, the widget remained selected after the model change and often the movements would not display properly sometimes, with no clear cause-effect, implying an asynchronous issue of some sort.

I pulled out the specific code, and the bug disappeared.  So, there is something about the interaction of the larger code and the smaller that triggers the bug.  This is why I erased the whole thing.  It needs a smarter re-imagining before I can restart it, and as I said, my available development time was this week.  I won't have another window for a month or so.

If you have read this far, thank you!

Thank you also for the quick and calmly measured responses.  Much appreciated

Greg



On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]> wrote:

Thank you all for the quick feedback.  A few responses:

1) the prettify feature in chrome was a new one and will make debugging the generated accessors possible, one problem solved
2) I debug in source mode, sorry that was not explicit.  I am not a masochist in that way :)
3) although I was trying to debug 50 lines of code, I neglected to explicitly state that I was drawing upon about 4000 lines of pre-existing code and simply trying to add a new widget in the mix.
4) when a selection is updated in the model, the actual rendering happens magically later and this is where debugging breaks down.  I was able to verify that the selection was properly becoming no selection, but the rendered view selected the same widget even though its underlying model had completely changed.  Even after pouring over the source on github (lots easier than on disk) for hours I was still unable to determine where rendering occurs.  Trying to break on any exception, stepping through the code also failed to locate where it happens.  This is what I mean by "black magic."  Perhaps there is a way to spit out debug info on events in qooxdoo, but I did not see a way when stepping through event handling.
5) what am I actually trying to do?  This should help you all help me.  :)

I am working on the backed to my quartet's website.  We have a calendar which is directly linked to our google calendar.  When an event appears on the private calendar, a cron job pulls the data into a database, spits out an email with the details etc. etc.  I then log into our backend and using qooxdoo, update the event to include detailed information like the concert program, ticket information, the presenter and concert hall, etc.  the backend generates info for our public google calendar, and our website pulls the data out and renders it using PHP.  The qooxdoo backend is 100% separated, and the whole thing uses SQLite and git.  Changes to the website appear at a test site and have to be manually pushed and then pulled to the public website, so it is all redundantly backed up.

The part I am working on is the concert programs.  



On Aug 29, 2013, at 0:53, "Joaquín Fernández" <[hidden email]> wrote:

Hi Greg

You can debug minified code in Chrome step by step using pretty print tool in developer tools.

Go to Sources tab and click in '{}' icon in bottom toolbar. If this icon is selected, all code is beautified when you debug source code including auto generated code in qooxdoo and minified code from build job.

Hope this help you.

Regards

Joaquín F.

Enviado de Samsung Mobile



-------- Mensaje original --------
De: Gregory Beaver <[hidden email]>
Fecha:
Para: qooxdoo Development <[hidden email]>
Asunto: [qooxdoo-devel] Frustrating development


Dear qooxdoo,

I wrote a very complicated application based on qooxdoo a few years ago.  It still works great but there are some kinks that I was trying to work out.  I spent 13 hours over the past week trying to get 50 lines of code to work.  8 of that was trying to debug a problem with appearance and the magical fact you have to tell some things what they should look like in some circumstances, but not in others.  No errors or warnings to assist either.

Then, I ran into a weird bug with selection that I cannot reproduce with any shorter code, and spent 6 hours writing no new code and simply trying to figure out where the hell selection is converted to actual highlighting in qx.ui.list.List

As of right now, I have erased all the work and thrown in the towel.  I have not had this much frustration and impossibility of solving a banal issue since I worked with Microsoft Access in 2000.

There has got to be a better way to do things.  Too much is magic, the generated code has no line breaks and can't be stepped through even in source mode.

I have literally run out of all of my available time allotted for this project, and we have to stick with the older not-quite-working code as a result.

If any of you have successfully found a time-efficient way to debug problems in selection or binding or any other qooxdoo black magic, I would appreciate the tips for the next time I have a block of time to try something.  Until then, I hope my utter failure is a wake up call from a former evangelist of qooxdoo (one of my blog posts is a top hit in google search for qooxdoo with many visitors every day).

Thanks,
Greg

Sent from Mailbox for iPhone
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ qooxdoo-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

Gregory Beaver
It suddenly occurred to me this evening, well after I had given up and erased my code, that there is a simple and elegant solution to my problems with using a single qx.ui.list.List and swapping the model to avoid all the headaches with incorrect selection:

qx.ui.container.Stack

So, I whipped up a new proof-of-concept widget that creates 3 qx.ui.list.List objects, 1 for composers, 1 for pieces, and 1 for movements.  As of right now, it literally worked on the first try after I fixed the expected typo bugs and minor omissions.

So for anyone struggling with using a qx.ui.list.List with changing model and selection issues, use more than one of the things with a stack and your problem disappears.  You do lose some memory efficiency, but it's a pretty small footprint since the data will be re-used.  Here is the actual code (minus the guess box stuff, which is irrelevant to this discussion)

/**
 * programinfo widget for complex program handling
 */
qx.Class.define("qooxdoo.Widgets.SimpleProgram", {
  extend: qx.ui.core.Widget,
  include: [qx.ui.form.MModelProperty],

  properties :
  {
    appearance :
    {
      refine : true,
      init : "simpleprogram"
    }
  },

  events :
  {
    removeProgram : "qx.event.type.Data",
  },

  construct: function()
  {
    this.base(arguments);
    this._setLayout(new qx.ui.layout.VBox(5));
    this._add(this._createChildControl("erasebutton"));
    this._add(this._createChildControl("guessbox"));
    this._add(this._createChildControl("composerpiece"));
  },
  members: {
    _stack : null,
    _composerList: null,
    _pieceList: null,
    _movementsList: null,
    _makeEraseButton: function(id)
    {
      var control;
      control = new qx.ui.form.Button;
      control.addListener("execute", function() {
        this.fireDataEvent("removeProgram", this);
      }, this);
      control.setAppearance("programinfo/erasebutton");
      return control;
    },
    _makeComposerPiece: function(id)
    {
      var control;
      control = new qx.ui.container.Stack();
      this._stack = control;
      control.add(this.getChildControl("composer"));
      control.add(this.getChildControl("piece"));
      control.add(this.getChildControl("movements"));
      return control;
    },
    _makeComposer: function(id)
    {
      var control = new qx.ui.list.List();
      control.setLabelPath("title");
      control.setModel(qx.core.Init.getApplication().getRepModel().getKids());
      this._composerList = control;
      return control;
    },
    _makePiece: function(id)
    {
      var control = new qx.ui.list.List();
      control.setLabelPath("title");
      this._pieceList = control;
      return control;
    },
    _makeMovements: function(id)
    {
      var control = new qx.ui.list.List().set({
        labelPath: "title",
        selectionMode: "additive"
      });
      control.setLabelPath("title");
      this._movementList = control;
      return control;
    },
    _loadPieces: function() {
      this._pieceList.setModel(this._composerList.getSelection().getItem(0).getKids());
      this._stack.setSelection([this._pieceList]);
      for (var i = 0; i < this._composerList.getSelection().getItem(0).getKids().getLength(); i++) {
        var piece = this._composerList.getSelection().getItem(0).getKids().getItem(i);
        // try to head off some of the bullshit at the pass
        piece.lazyLoadKids();
      }
    },
    _switchMovements: function() {
      this._movementList.setModel(this._pieceList.getSelection().getItem(0).getKids());
      for (var i = 0; i < this._pieceList.getSelection().getItem(0).getKids().getLength(); i++) {
        var movement = this._pieceList.getSelection().getItem(0).getKids().getItem(i);
        this.getModel().getMovements().push(movement.getId());
        this._movementList.getSelection().push(movement);
      }
      this._stack.setSelection([this._movementList]);
    },
    _createChildControlImpl: function(id)
    {
      var control;
      if (id == "erasebutton") {
        control = this._makeEraseButton(id);
        this._add(control);
      } else if (id == "guessbox") {
        control = new qx.ui.form.TextField();
      } else if (id == "composerpiece") {
        control = this._makeComposerPiece(id);
        this._add(control);
      } else if (id == "composer") {
        control = this._makeComposer(id);
        control.getSelection().addListener("change", function(e) {
          this.getModel().setMovements(new qx.data.Array());
          this.getModel().setPiece(0);
          this.getModel().getComposer().setId(e.getData());
          if (this._composerList.getSelection().getItem(0).getTitle() == "Loading...") {
            var composer = this._composerList.getSelection().getItem(0);
            composer.lazyLoadKids();
            composer.addListenerOnce("changeKids", this._loadPieces, this);
          } else {
            this._loadPieces();
          }
        }, this);
      } else if (id == "piece") {
        control = this._makePiece(id);
        control.getSelection().addListener("change", function(e) {
          this.getModel().setMovements(new qx.data.Array());
          this.getModel().setPiece(e.getData());
          this._switchMovements();
        }, this);
      } else if (id == "movements") {
        control = this._makeMovements(id);
      }
      return control || this.base(arguments, id);
    }
  }
});
 


August 29, 2013 8:19 AM
Just a thought for when you get back to it then – is there a chance that two bits of code were trying to change the model(s) at the same time?  I have had something similar where recursive binding can cause conflicts and the wrong things get added/removed - e.g. An event changes the model which causes an event which indirectly causes a change to the model etc.  Have you tried setting a long timeout (e.g. a second or two) before adjusting the model?

John

From: Gregory Beaver <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Thursday, 29 August 2013 14:01
To: Joaquín Fernández <[hidden email]>, qooxdoo Development <[hidden email]>
Subject: Re: [qooxdoo-devel] Frustrating development

Ack!  Accidentally clicked send.

I have a database of composers, the pieces they wrote and the movements of those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made into 3 classes.  The kids property in composers stores the array of pieces, and the same is true for the kids property of pieces, which stores an array of movements.

I use this to render a tree in one tab of the backend, and I can add composers, pieces and movements as needed.  However, because the data set is so large, I do some lazy loading.  At first, each composer's only child node is a piece called "Loading..."  When the code sees it, it lazy loads the children and updates the display.  All this works perfectly for years and still works.

In the tab where I edit concert info, I am re-using the data from the composers/pieces/movements tab to provide the source to choose program info.  I created a widget years ago that allows clicking a composer from a selectbox qx.ui.form.List, which populates another selectbox with the composer's pieces, lazy loading as necessary, and then chooses movements, lazy loading as necessary.

This process is too slow, it takes me hours because there is a subtle bug where selecting the movements does not actually work unless I de-select them and re-select them.  Also, scrolling through the list of composers and pieces is too slow.

Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a text field and using that to filter the list.  So if we are playing Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will filter the list of 115 composers to just Beethoven.  I click Beethoven and the qx.ui.list.List model changes to the pieces he wrote and the text field changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2" and disables itself.  Meanwhile, the list updates to the 4 movements and I can deselect any we are not playing on that concert.

All of this worked except when I clicked Beethoven, the widget remained selected after the model change and often the movements would not display properly sometimes, with no clear cause-effect, implying an asynchronous issue of some sort.

I pulled out the specific code, and the bug disappeared.  So, there is something about the interaction of the larger code and the smaller that triggers the bug.  This is why I erased the whole thing.  It needs a smarter re-imagining before I can restart it, and as I said, my available development time was this week.  I won't have another window for a month or so.

If you have read this far, thank you!

Thank you also for the quick and calmly measured responses.  Much appreciated

Greg



On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]> wrote:

------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ qooxdoo-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
August 29, 2013 8:01 AM
Ack!  Accidentally clicked send.

I have a database of composers, the pieces they wrote and the movements of those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made into 3 classes.  The kids property in composers stores the array of pieces, and the same is true for the kids property of pieces, which stores an array of movements.

I use this to render a tree in one tab of the backend, and I can add composers, pieces and movements as needed.  However, because the data set is so large, I do some lazy loading.  At first, each composer's only child node is a piece called "Loading..."  When the code sees it, it lazy loads the children and updates the display.  All this works perfectly for years and still works.

In the tab where I edit concert info, I am re-using the data from the composers/pieces/movements tab to provide the source to choose program info.  I created a widget years ago that allows clicking a composer from a selectbox qx.ui.form.List, which populates another selectbox with the composer's pieces, lazy loading as necessary, and then chooses movements, lazy loading as necessary.

This process is too slow, it takes me hours because there is a subtle bug where selecting the movements does not actually work unless I de-select them and re-select them.  Also, scrolling through the list of composers and pieces is too slow.

Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a text field and using that to filter the list.  So if we are playing Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will filter the list of 115 composers to just Beethoven.  I click Beethoven and the qx.ui.list.List model changes to the pieces he wrote and the text field changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2" and disables itself.  Meanwhile, the list updates to the 4 movements and I can deselect any we are not playing on that concert.

All of this worked except when I clicked Beethoven, the widget remained selected after the model change and often the movements would not display properly sometimes, with no clear cause-effect, implying an asynchronous issue of some sort.

I pulled out the specific code, and the bug disappeared.  So, there is something about the interaction of the larger code and the smaller that triggers the bug.  This is why I erased the whole thing.  It needs a smarter re-imagining before I can restart it, and as I said, my available development time was this week.  I won't have another window for a month or so.

If you have read this far, thank you!

Thank you also for the quick and calmly measured responses.  Much appreciated

Greg



On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]> wrote:


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Frustrating development

fritz
Congratulations!

Fritz

On Thu, 29 Aug 2013, Gregory Beaver wrote:

> It suddenly occurred to me this evening, well after I had given up and erased
> my code, that there is a simple and elegant solution to my problems with
> using a single qx.ui.list.List and swapping the model to avoid all the
> headaches with incorrect selection:
>
> qx.ui.container.Stack
>
> So, I whipped up a new proof-of-concept widget that creates 3 qx.ui.list.List
> objects, 1 for composers, 1 for pieces, and 1 for movements.  As of right
> now, it literally worked on the first try after I fixed the expected typo
> bugs and minor omissions.
>
> So for anyone struggling with using a qx.ui.list.List with changing model and
> selection issues, use more than one of the things with a stack and your
> problem disappears.  You do lose some memory efficiency, but it's a pretty
> small footprint since the data will be re-used.  Here is the actual code
> (minus the guess box stuff, which is irrelevant to this discussion)
>
> /**
> * programinfo widget for complex program handling
> */
> qx.Class.define("qooxdoo.Widgets.SimpleProgram", {
>  extend: qx.ui.core.Widget,
>  include: [qx.ui.form.MModelProperty],
>
>  properties :
>  {
>    appearance :
>    {
>      refine : true,
>      init : "simpleprogram"
>    }
>  },
>
>  events :
>  {
>    removeProgram : "qx.event.type.Data",
>  },
>
>  construct: function()
>  {
>    this.base(arguments);
>    this._setLayout(new qx.ui.layout.VBox(5));
>    this._add(this._createChildControl("erasebutton"));
>    this._add(this._createChildControl("guessbox"));
>    this._add(this._createChildControl("composerpiece"));
>  },
>  members: {
>    _stack : null,
>    _composerList: null,
>    _pieceList: null,
>    _movementsList: null,
>    _makeEraseButton: function(id)
>    {
>      var control;
>      control = new qx.ui.form.Button;
>      control.addListener("execute", function() {
>        this.fireDataEvent("removeProgram", this);
>      }, this);
>      control.setAppearance("programinfo/erasebutton");
>      return control;
>    },
>    _makeComposerPiece: function(id)
>    {
>      var control;
>      control = new qx.ui.container.Stack();
>      this._stack = control;
>      control.add(this.getChildControl("composer"));
>      control.add(this.getChildControl("piece"));
>      control.add(this.getChildControl("movements"));
>      return control;
>    },
>    _makeComposer: function(id)
>    {
>      var control = new qx.ui.list.List();
>      control.setLabelPath("title");
>      control.setModel(qx.core.Init.getApplication().getRepModel().getKids());
>      this._composerList = control;
>      return control;
>    },
>    _makePiece: function(id)
>    {
>      var control = new qx.ui.list.List();
>      control.setLabelPath("title");
>      this._pieceList = control;
>      return control;
>    },
>    _makeMovements: function(id)
>    {
>      var control = new qx.ui.list.List().set({
>        labelPath: "title",
>        selectionMode: "additive"
>      });
>      control.setLabelPath("title");
>      this._movementList = control;
>      return control;
>    },
>    _loadPieces: function() {
>      this._pieceList.setModel(this._composerList.getSelection().getItem(0).getKids());
>      this._stack.setSelection([this._pieceList]);
>      for (var i = 0; i <
> this._composerList.getSelection().getItem(0).getKids().getLength(); i++) {
>        var piece =
> this._composerList.getSelection().getItem(0).getKids().getItem(i);
>        // try to head off some of the bullshit at the pass
>        piece.lazyLoadKids();
>      }
>    },
>    _switchMovements: function() {
>      this._movementList.setModel(this._pieceList.getSelection().getItem(0).getKids());
>      for (var i = 0; i <
> this._pieceList.getSelection().getItem(0).getKids().getLength(); i++) {
>        var movement =
> this._pieceList.getSelection().getItem(0).getKids().getItem(i);
>        this.getModel().getMovements().push(movement.getId());
>        this._movementList.getSelection().push(movement);
>      }
>      this._stack.setSelection([this._movementList]);
>    },
>    _createChildControlImpl: function(id)
>    {
>      var control;
>      if (id == "erasebutton") {
>        control = this._makeEraseButton(id);
>        this._add(control);
>      } else if (id == "guessbox") {
>        control = new qx.ui.form.TextField();
>      } else if (id == "composerpiece") {
>        control = this._makeComposerPiece(id);
>        this._add(control);
>      } else if (id == "composer") {
>        control = this._makeComposer(id);
>        control.getSelection().addListener("change", function(e) {
>          this.getModel().setMovements(new qx.data.Array());
>          this.getModel().setPiece(0);
>          this.getModel().getComposer().setId(e.getData());
>          if (this._composerList.getSelection().getItem(0).getTitle() ==
> "Loading...") {
>            var composer = this._composerList.getSelection().getItem(0);
>            composer.lazyLoadKids();
>            composer.addListenerOnce("changeKids", this._loadPieces, this);
>          } else {
>            this._loadPieces();
>          }
>        }, this);
>      } else if (id == "piece") {
>        control = this._makePiece(id);
>        control.getSelection().addListener("change", function(e) {
>          this.getModel().setMovements(new qx.data.Array());
>          this.getModel().setPiece(e.getData());
>          this._switchMovements();
>        }, this);
>      } else if (id == "movements") {
>        control = this._makeMovements(id);
>      }
>      return control || this.base(arguments, id);
>    }
>  }
> });
>
>
>> John Spackman <mailto:[hidden email]>
>> August 29, 2013 8:19 AM
>> Just a thought for when you get back to it then -- is there a chance that
>> two bits of code were trying to change the model(s) at the same time?  I
>> have had something similar where recursive binding can cause conflicts and
>> the wrong things get added/removed - e.g. An event changes the model which
>> causes an event which indirectly causes a change to the model etc.  Have
>> you tried setting a long timeout (e.g. a second or two) before adjusting
>> the model?
>>
>> John
>>
>> From: Gregory Beaver <[hidden email]
>> <mailto:[hidden email]>>
>> Reply-To: qooxdoo Development <[hidden email]
>> <mailto:[hidden email]>>
>> Date: Thursday, 29 August 2013 14:01
>> To: Joaquín Fernández <[hidden email]
>> <mailto:[hidden email]>>, qooxdoo Development
>> <[hidden email]
>> <mailto:[hidden email]>>
>> Subject: Re: [qooxdoo-devel] Frustrating development
>>
>> Ack!  Accidentally clicked send.
>>
>> I have a database of composers, the pieces they wrote and the movements of
>> those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made
>> into 3 classes.  The kids property in composers stores the array of pieces,
>> and the same is true for the kids property of pieces, which stores an array
>> of movements.
>>
>> I use this to render a tree in one tab of the backend, and I can add
>> composers, pieces and movements as needed.  However, because the data set
>> is so large, I do some lazy loading.  At first, each composer's only child
>> node is a piece called "Loading..."  When the code sees it, it lazy loads
>> the children and updates the display.  All this works perfectly for years
>> and still works.
>>
>> In the tab where I edit concert info, I am re-using the data from the
>> composers/pieces/movements tab to provide the source to choose program
>> info.  I created a widget years ago that allows clicking a composer from a
>> selectbox qx.ui.form.List, which populates another selectbox with the
>> composer's pieces, lazy loading as necessary, and then chooses movements,
>> lazy loading as necessary.
>>
>> This process is too slow, it takes me hours because there is a subtle bug
>> where selecting the movements does not actually work unless I de-select
>> them and re-select them.  Also, scrolling through the list of composers and
>> pieces is too slow.
>>
>> Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a
>> text field and using that to filter the list.  So if we are playing
>> Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will
>> filter the list of 115 composers to just Beethoven.  I click Beethoven and
>> the qx.ui.list.List model changes to the pieces he wrote and the text field
>> changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters
>> to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field
>> changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2"
>> and disables itself.  Meanwhile, the list updates to the 4 movements and I
>> can deselect any we are not playing on that concert.
>>
>> All of this worked except when I clicked Beethoven, the widget remained
>> selected after the model change and often the movements would not display
>> properly sometimes, with no clear cause-effect, implying an asynchronous
>> issue of some sort.
>>
>> I pulled out the specific code, and the bug disappeared.  So, there is
>> something about the interaction of the larger code and the smaller that
>> triggers the bug.  This is why I erased the whole thing.  It needs a
>> smarter re-imagining before I can restart it, and as I said, my available
>> development time was this week.  I won't have another window for a month or
>> so.
>>
>> If you have read this far, thank you!
>>
>> Thank you also for the quick and calmly measured responses.  Much
>> appreciated
>>
>> Greg
>>
>>
>>
>> On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>
>> ------------------------------------------------------------------------------
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ 
>> <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________>
>> qooxdoo-devel mailing list [hidden email]
>> <mailto:[hidden email]>
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>> ------------------------------------------------------------------------------
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>> Gregory Beaver <mailto:[hidden email]>
>> August 29, 2013 8:01 AM
>> Ack!  Accidentally clicked send.
>>
>> I have a database of composers, the pieces they wrote and the movements of
>> those pieces.  It is sent to qooxdoo as Json, and using a Json marshal made
>> into 3 classes.  The kids property in composers stores the array of pieces,
>> and the same is true for the kids property of pieces, which stores an array
>> of movements.
>>
>> I use this to render a tree in one tab of the backend, and I can add
>> composers, pieces and movements as needed.  However, because the data set
>> is so large, I do some lazy loading.  At first, each composer's only child
>> node is a piece called "Loading..."  When the code sees it, it lazy loads
>> the children and updates the display.  All this works perfectly for years
>> and still works.
>>
>> In the tab where I edit concert info, I am re-using the data from the
>> composers/pieces/movements tab to provide the source to choose program
>> info.  I created a widget years ago that allows clicking a composer from a
>> selectbox qx.ui.form.List, which populates another selectbox with the
>> composer's pieces, lazy loading as necessary, and then chooses movements,
>> lazy loading as necessary.
>>
>> This process is too slow, it takes me hours because there is a subtle bug
>> where selecting the movements does not actually work unless I de-select
>> them and re-select them.  Also, scrolling through the list of composers and
>> pieces is too slow.
>>
>> Thus I had the idea of instead using qx.ui.list.List.  Coupling this with a
>> text field and using that to filter the list.  So if we are playing
>> Beethoven String Quartet Op. 59 No. 2, I could type "bee" and it will
>> filter the list of 115 composers to just Beethoven.  I click Beethoven and
>> the qx.ui.list.List model changes to the pieces he wrote and the text field
>> changes to "Beethoven, Ludwig can ".  I type "59" after that and it filters
>> to the 3 Op. 59 quartets he wrote.  I click 59 No. 2 and the text field
>> changes to "Beethoven, Ludwig van String Quartet in E minor Op. 59 No. 2"
>> and disables itself.  Meanwhile, the list updates to the 4 movements and I
>> can deselect any we are not playing on that concert.
>>
>> All of this worked except when I clicked Beethoven, the widget remained
>> selected after the model change and often the movements would not display
>> properly sometimes, with no clear cause-effect, implying an asynchronous
>> issue of some sort.
>>
>> I pulled out the specific code, and the bug disappeared.  So, there is
>> something about the interaction of the larger code and the smaller that
>> triggers the bug.  This is why I erased the whole thing.  It needs a
>> smarter re-imagining before I can restart it, and as I said, my available
>> development time was this week.  I won't have another window for a month or
>> so.
>>
>> If you have read this far, thank you!
>>
>> Thank you also for the quick and calmly measured responses.  Much
>> appreciated
>>
>> Greg
>>
>>
>>
>> On Aug 29, 2013, at 7:44, Gregory Beaver <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>
--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel