How to access browser console in AIDE for error checking - aide-ide

Is there an equivalent of the browser console in AIDE? It took me trial and error to find out that it doesn't seem to support local storage (or at least the library that I'm usings implementation of it)
Should I wrap everything in one big try Catch block? I've googled and searched, I suspect I should be doing better error handling.

Here's what I ended up doing. You can share the published web app from aide when you're running it. Open it in Firefox for Android after downloading the console add-on. It's not as fully featured as a desktop version but it's close
It feels like poor form to answer ones own question, I earnt the tumbleweed badge for this so perhaps I can be forgiven!

Related

Stackdriver Debugger doesn't capture snapshots

I am using AppEngine, NodeJS (Standard), I have accepted the license agreements, and I am initializing the Debug Agent this way:
require('#google-cloud/debug-agent').start({ allowExpressions: true });
I can see all the logs for my application in the Logs Viewer, all the requests are here.
When opening the Stackdriver Debugger, it recognizes what is the current source code running, and displays it. I try adding a few snapshots and logpoints, as basic as this:
if (true) logpoint("Hello World!")
It is waiting for hits, but obviously missing them. There are also no logs related to my logpoints. However, I can see the standard logs outputted by my app. Everything seems to work except the Stackdriver Debugger, even though it doesn't seem to complain either.
I have looked at everything and made sure everything was set up properly but I am not sure how to "debug the debugger" further.
Is it actually even working, and people are using it with NodeJS in Standard mode?
What can I check? Any way I can see errors related to the Debugger itself?
Prior to the „request” statement, how did you set up your project in Stackdriver Debugger for node.js? You may check Setting Up Stackdriver Debugger for Node.js as reference.
To reproduce this issue, one needs confidential information, such as details of your project and sample code. It is much easier to protect your information in the Public Issue Tracker. You are encouraged to open a similar issue there.

Installing Gears in 2012

For one of the customers of my company, I have to get Gears working. To explain briefly, they have a site using the Gears local database and now want to really use localStorage (at least for browsers supporting it and still use Gears for the old ones).
To refactor the code and ensure that the HTML5 version works as the Gears version used to work (and that I do not break the existing system is also a plus). And here comes the problem: Gears is not supported anymore and seems unable to install.
My dev' machine is using OSX Snow leopard. I tried the Gears custom installer made by the authors of MailPlane (http://mailplaneapp.com/download/google_gears/) to enable gears on Safari. The installer runs without any issue and I have a "Google Gears settings" entry in Safari's menu. But the code does not work, here's the console output for the database creation code:
> google.gears.factory.create('beta.desktop')
Error
line: 2
message: "'undefined' is not a function (evaluating 'google.gears.factory.create('beta.desktop')')"
sourceId: 419639712
__proto__: Error
(this is the code I got from the customer).
In the console, when I try accessing the Gears factory, I just get a simple html object:
> google.gears.factory
<object style=​"display:​ none;​ " width=​"0" height=​"0" type=​"application/​x-googlegears"></object>​
In Gears preferencies, there's a site of sites for which I can allow Gears to run, but I can't add localhost there (I can't add anything in fact).
As I can't get Safari/Gears working, I decided to setup a WinXP virtual machine, maybe it would work here.
I was able to download the Gears installer. But this one needs file that have been removed from Google servers (at least I guess, but I don't have any firewall installed so I don't see what could block the installer when getting the files ...).
I also tried old Chrome installers (apparently Gears was shipped in Chrome 12-) but none of the installers work (they just, well, do nothing. I even tried to start them from the command line to expect a bit of output but I got nothing).
Another option would be to get a Firefox gears add-on, but they all seem to have disappeared :/
So, the question (finally): does anyone here still have to use Gears and how do you get it running on new machines ?
Cheers,
Vincent
I think The Google Gears API is no longer available.
Please see https://developers.google.com/gears/ page.
Thanks,
Jigar

How do you debug Share Picker extensions?

I have registered my Phone 7 app as a Share Picker Extension. It works—my app is in the list of Share options and it gets launched and I can load the chosen image. Okay, great.
But then things go wrong in my code. I would like to be able to debug the issues, but I can't seem to keep the debugger attached.
I cannot debug this in the simulator, since the Pictures app (and thus the Share Picker functionality) is not present in the simulator.
I cannot debug this on the phone because as soon as I pick my app from the Share list, the debugger detaches... right as my app is "launching" again.
Is it possible to attach the debugger to a running WP7 app? Is it possible to keep the debugger attached? Am I doing it wrong? Any suggestions, advice or guesses are welcome because I'm tearing my hair out.
When doing M+V hub integration (sorry, haven't done any pictures hub integration yet) I initially used a crude debug technique (Messagebox.Show, etc. - like Justin mentioned) to verify what was being passed to the NavigationEventArgs of OnNavigatedTo and wrapped the whole method in a try..catch block to learn what was going on. I then refactored the code when I knew what could be expected. (Remember OnNavigatedTo will be called when your app is launched normally too and so e won't be populated in the same way.)
When the app is launched from a/the hub it creates a new instance of the app and there is currently no way to connect to this for debugging while the main page is being navigated to.
Great question. I'm unsure if that's possible. As far as I know, there's no way to attach the debugger to when the WP7 O/S starts an app (which wasn't triggered by the debugger).
Photo Share picker extensibility, music+Video hub extensibility and other O/S extensibility points seem to not play nicely with the VS debugger. Normally I resort to MessageBox.Show to debug any problems with WP7 O/S integration.
1) Connect the Device
2) Turn off Zune
3) Start C:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\WPConnect\x86\WPConnect.exe
To properly debug your application that uses the Media Library, you'll need to use the Windows Phone Connect Tool (WPConnect.exe) as described on MSDN. Jaime has some additional tips on his blog.
Once you are connected, you should be able to debug your application. Fingers crossed anyway. If that doesn't help, I'll dig a bit further.
It's not so much about the WPConnect tool. The nature of your application means that you have to have it closed and the user should pick a photo. Only after that the data is returned to the application.
You should read about the application execution model on Windows Phone 7. Also a good explanation is available here.
Initially, I would say that you should look at tombstoning (a good explanation here) but then again, the image returned will re-start the app and won't allow you to directly attach the debugger.
Yeah, looks like this is impossible...
All the answers above seem to be missing the point: I presume you're able to debug your app in the "standalone" mode (when it's launched normally), but not when it's launched via the Share Picker Extension. Am I write? This is the wall I'm hitting... :-(
I thought the proper way would be to attach to the process once it's launched.
I tried to use Debug > Attach to Process, then select Smart Device as the Transport and Windows Phone Device as the Qualifier... But in return I get the ugly "Unable to connect to 'Windows Phone Device'. Not implemented" message.
Bummer :-(

"Debugging" ExtJS script

Are there any particular tools available for "Debugging" ExtJS script ? Especially, I findi it difficult to debug when the screen goes blank.!
Aptana Studio is optimised for Javascript development, including debug support for Firefox and IE, it even supports type-ahead on the Ext JS library (you might have to download some eclipse plugins separately).
Ext JS comes included with a debugging console (you need to add debug.js and call Ext.log("blah") to bring it up), this will provide functionality that is similar to Firebug on Firefox but not as extensive, still its useful for supplementing the poor development tools that come pre-installed with IE 8. Firebug (as Ergo mentioned here) is the most powerful of the browser-based development tools (it allows step-by-step debugging) however the latest versions of Chrome and Safari also come installed with develoment tools that are useful (but not as much as Firebug).
I find that running a debug trace throughout your application speeds up the process of finding bugs (see example below).
// Setup simple debugging tool
DebugManager = function {};
DebugManager.isEnabled = true;
DebugManager.log = function() {
if (DebugManager.isEnabled && arguments.length && console && console.log) {
try {
// Single parameter? pass it to console
if (arguments.length == 1) console.log(arguments[0])
// Multiple parameters? output raw arguments array to the console
else console.log(arguments);
} catch (e) {}
}
};
// Your function
function doSomething(myString) {
DebugManager.log("doSomething(myString)", myString);
// code for doSomething
}
You can then look up the console trace (Firebug is the best since it outputs full object information) and note the last function that executed before your code broke.
After many months of Ext JS development I have to say that Firebug + Aptana Studio combo wins hands down on other tools for development.
The Firebug Extension for Firefox is one of the best, to debug and test any web based framework. It wont necessary hand hold you, and you will need some familiarity with standard debug procedures, but is an excellent start. JSLint is another, online tool, for more advanced users.
I have found by changing my coding style, I've actually written more bug-free code. Usually when I see blank screens in IE, it has to do with trailing commas. I've started writing my ExtJS/JSON like this:
{
id: 'foo'
,name: 'bar'
,width: .60
,text : 'I am Jack\'s formatted code'
}
What this allows me to do is to move/comment/uncomment code around without having to worry about leftover commas. This coding convention has helped me greatly when it comes to refactoring other people's code as well as my own. Visually, it also becomes easier to ensure that the code is formatted properly.
I use chrome.
We can easily debug using "F12" to get the console, where it point out the line where the loading crashed, on clicking this line it goes to the cource to show the exact line of code.
Chrome's Development tool is that best so far when it comes to debugging ExtJs scripts. I've also used -
FireFox Developer Edition - This is pretty good and has lot's of tools available but for some reason I find it a little sluggish when debuggin ExtJs apps (CMD built in a single js).
IE Developer Tool - I know almost everyone hates it but sometimes we just have to live it with. (I find it not really bad). One problem is again - Very slow and hangs a lot of time while loading a big script. The whole script file is not even loaded at times - I forgot the exact figure but it's source viewer has a size/buffer/memory limit and cannot load the whole script and truncates whatever it cannot load - so you can get to your lines if the line exceeds that. This also happened in Firebug. But I've never faced such loading issues in Chrome.
Then again there are issues that happen only in certain browsers and you're stuck with debugging in that browser.

Debugging Silverlight applications with IE9 beta

I spent some time debugging a SL3 application with VS 2010 in IE9 beta today and noticed a few quirks. Sometimes when launching the Silverlight app in VS it fails to load in the browser, but refreshing with F5 tends to fix the problem. Also, there are sporadic scripting errors that pop up a debug dialog - these also seem to be fixed by refreshing the page. Has anyone run into these problems and found a fix?
EDIT: My most prevalent error is:
Error: ASP.NET Ajax client-side framework failed to load.
I don't understand why, but someone without a name at the Silverlight forums has found a solution that worked for me:
Just add or uncomment this entry to your hosts file (%SystemRoot%\system32\drivers\etc\hosts):
127.0.0.1 localhost
I noticed this as well with Silverlight 4, but also when I start a simple web project.
IE9 has a shorter startup time that IE8. Debugging a Silverlight application starts the development web server to host the http:// site. The time that it took to start up the web server was less than the time to start up IE8 and greater than the time it takes to start up IE9.
#Michael S. Scherotter - It can't be because of the shorter startup time because making the host file change which fixed it for me would have zero impact on app startup time. Something else must be causing the browser and Cassini to not talk to each other correctly.
One other fix, related to the others is to change the StartURL to launch to the loop back address directly, rather than editing the hosts file. So, in one app, I've got this as the start URL:
http://127.0.0.1.:60525/
Of course, to make this work consistently, I've selected a "specific port" in configuration, as 60525 in this case.
(the trailing . after the loop back address is to allow Fiddler to do its magic).

Resources