Processing, window gets distorted - processing

Just downloaded Processing on a laptop using Windows 7 64bit. This is the very first and basic work that is being done inside of processing itself.
So far, I am trying to re-create the example from the processing tutorial on the site here:
Processing Example.
When doing that simple example my window becomes distorted as soon as I do the following seen in this picture here:
I am completely unsure of why this is happening and sometimes as soon as it does happen, I cannot get it to go away, even after moving the ellipse to another area.
Any ideas?

You have two tabs in there. Unlike in a more traditional IDE, Processing considers all code from all tabs part of the same sketch, so it'll run all the code you have in those tabs. Not just the size/rect/ellipse calls, but also everything in that "test" tab. Fire up a new instance of Processing and just add the size/rect/ellipse calls (or delete the test tab). If it doesn't do weird resizing, problem found.

Related

UFT - Object Identification not working on Run Time

I have written a code for Web page. The process requires me to click on a weblink which opens up a new window, then perform some operations on the browser window. Then I close the new browser. This is repeated multiple times in the code. All the elements on all the browser windows are normally identifiable using the object spy. However, intermittently during run time when a new browser window opens up the elements on the page are not getting recognized (hence it throws errors). When i go into the debug mode and try using the object spy the maximum identification i can capture is Browser(<>).Page(<>). Nothing in the page is getting recognized.
Now if i close this browser and reopen it and check again, the elements on the page are getting captured by the object spy and i can continue with my script execution. Sometimes I have to close and reopen multiple times for it to work.
Is there any way to handle this scenario. check for object identifications on the run time maybe. Dunno if it this is any relevant but i am not making use of the OR in my project.
Thanks in advance.
This sounds like a bug in UFT and you should contact HP's support.
A workaround if you know where the problem is probable to appear is to add Browser("<name>").RefreshWebSupport. This is an undocumented feature of UFT that sometimes helps in cases like this.

How to debug Dojo in browser?

I'm currently (trying) to develop an app with Worklight Studio 5.0.6 and Dojo (Mobile) 1.8.3. I have a really hard time to to find a proper method for debugging. After waiting 5-10 minutes for the build an deploy-process on the server, an error usually looks like this in the Chrome debugger:
How am I supposed to track down this error in MY source? The whole stack trace consists entirely of Dojo code which generates an absolutely useless error message after 20 abstraction layers.
Seriously, how do you guys handle this in real life? What methods do you use for debugging Dojo-driven apps in the browser?
spyro
For dojo.parse errors, I find it useful to pause the Chrome debugger on all exceptions (the purple icon on your screenshot, should be blue). You usally get more details about the cause of the error, the name of the DOM node being parsed, etc. in the first exception being raised.
Rémi.
Debugging dojo based application should be the same as debugging any javascript application.
Usually I will follow these steps:
add console.log() somewhere in code: this is fast and most of time this is enough.
set breakpoint in debugger: if step 1 is not enough, you can base on error information to set breakpoint before error line, then step in or step out.
comment out recently changes: for some error which is hard to find the error line, for example, parse error in your case, the good way is comment out your recently changes one by one till back to your last working version. Or, return to your last working version, then add code back one by one.
Create a simple application to reproduce the error : if your application is very complicate and it is hard for you to follow above methods, you can try to create a new application which mimics your current application but with simple logics and try to reproduce the error.
Based on experience : Some errors, for example, extra ',' in the end of array which works at chrome and firefox, will report a nonsense error information at IE. Debug these kinds of errors is very difficult, you can base on your experience or do a google search.
Did you provide isDebug: true in your dojoConfig? Also, try to see if the same occurs in other browsers.
Update: I recently discovered that there are issues with Google Chrome and Dojo debugging and I think it has to do with the asynchronous loading of files. As you can see in the provided screenshot of #spyro, the ReferenceError object is blank (which you can notice because of the empty brackets {}). If you want to solve that, reopen the console of Google Chrome, (for example by tapping F12 twice). After reopening the ReferenceError should not be empty anymore and now you can expand that object by using the arrow next to it and get a more detailed message about what failed.
Usually what I do in situations like that is to place a breakpoint inside the error callback (line 3398 in your case) and then look into the error variable ("e").
I am not sure how familiar you are with the Web Inspector, but once you hit the breakpoint open the Web Inspector 'console' and check for the error properties "e.message" and "e.stack" (just type in "e.message " in the console).
Also, during development it is better to avoid Dojo optimization / minification, which greatly improve your debug-ability.
Bottom line is to try to place the breakpoint before the error is thrown.

Tools/code to automatically click ok on dialogs

We have an 'enterprisey' system with a scheduling component which gets floored if any dialogs come up. If any modal dialogs come up in the processes it is running, it gets 'paused' and can't kick off any new processes.
Excuse me a minute ...
*goes outside*
*laughs*
*cries*
*comes back*
.. ahem ... so anyway we need some sort of tool/technique that can lurk in the background and automatically detect specific dialogs and click OK on them. Any recommendations?
The offending system is running in Windows XP.
(NB: changing the third-party-enterprisey system or making its developers sit on the naughty step until they improve it are not options in the short term)
From this similar question I found:
Buzof by Basta Computing
which did the trick.
There is also a product called DialogDevil which looked promising but didn't work in our situation for some reason.
AutoIT is absolutely perfect for this. You can use the tool to help identify the dialog, write your own simple code and distribute the "auto clicker" via exe. It lurks in the background by running from the task tray.
DialogDavil will require exact same parameters on your dialog (for which you want buttons to be autoclicked) every time that same dialog pops up. And thats why it didnt work for me in first pass. Then i changed the control file at the following path to remove the changing items (a text box text in my case)
C:\Users\userName\AppData\Roaming\DAIR\DialogDevil\control.xml
And then it worked like a charm.
HTH,

Is there a way to record and playback a coding session in Visual Studio?

I've read in Robert Martin's "Clean Code" that in the 80's Emacs was already capable of recording and playing back your coding session.
I just realised how much I'd learn from that practice, I'd love to profile myself!
However I really don't think it'd be very effective to record the screen (as in video) especially because Visual Studio is already unbearably slow and besides it'd be boring to seek the video in a player.
Instead, it would be really awesome to have some plugin that could record what I've coded (so not the debugging and visual designer, etc) and could play it back for me to see how much I suck and where.
Is this possible?
Edit: just a quote from the book to show how amusing this could be:
Bob enters the module.
He scrolls down to the function needing change.
He pauses, considering his options.
Oh, he’s scrolling up to the top of the module to check the initialization of a variable.
Now he scrolls back down and begins to type.
Ooops, he’s erasing what he typed!
He types it again.
He erases it again!
He types half of something else but then erases that!
He scrolls down to another function that calls the function he’s changing to see how it is
called.
He scrolls back up and types the same code he just erased.
He pauses.
He erases that code again!
He pops up another window and looks at a subclass. Is that function overridden?
. . .
You can just run a secret keylogging campaign on yourself.
Most keyloggers allow recording and playback as a video but you can configure it to only snap frames when you hit a key.

In VS2010 is there a way to correct the cursor icon from getting stuck on pointer without restarting the page?

I am working along in VS2010 and moving code around to make more functions and less clutter, so I copy/paste nine times out of ten my mouse cursor "locks up" and it gets stuck on the arrow pointer rather than the | for text, which is only mildly annoying when you are trying to copy/paste a lot of code around. It clears up whenever I close the file and reopen it, but it interrupts my work flow. Has anyone run into this before, if so, did you figure out how to fix it without closing the file?
I submitted this as a report to MS. I am paraphrasing here, "it is in the bug list and we will look into it."
The only solution is to close the file and re-open it. If MS replies with anything else I will post it here.

Resources