Some legacy JavaScript code broke in Firefox 3.1 recently. An endless loop was formed, causing a "too much recursion" error and browser crashes. Here's a brief summary of how the loop was formed, and how I broke out of it. I grossly simplified the code for the example.
this.htmlBuffer += '<input type="radio" onclick="doStuff();repaintForm();"';
this.htmlBuffer += '/>';
// Some other inputs
someDiv.innerHTML = this.htmlBuffer;
All tested browsers that came before Firefox 3 stopped propagation of the click event. Firefox 3 continued to propagate the click event after the form was repainted, so it effectively added a new event listener with each iteration.
I did some reading on the subject, at whirlpool and eyeOS. I tried various means of stopping the event, including...
e.stopPropagation(); // Mozilla
e.preventDefault(); // Mozilla
e.cancelBubble = true;// IE
e.returnValue = false;// IE
None worked.
The Solution
Adding "return false;" to the XHTML text of the onclick stopped event propagation in Firefox 3. It had no ill effects in Firefox 2, Safari 3, IE7, or IE6.
this.htmlBuffer += '<input type="radio" onclick="doStuff(this);repaintForm();return false;"';
this.htmlBuffer += '/>';
// Some other inputs
someDiv.innerHTML = this.htmlBuffer;
Clearly, a better solution would include use of DOM methods to construct objects, instead of innerHTML. However, this solution fixed the problem in a hurry. If your existing application seems to get caught in an endless loop only in Firefox 3, the "return false" solution may help.
The Eclipse IDE had become unusable. With each Save, the cursor would turn into a beach ball for several seconds. Startup messages pointed to a culprit: Mylyn.
java.lang.IllegalArgumentException: The feature 'application' is not a valid feature
...
Root exception:
org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
...
MESSAGE While loading class "org.eclipse.mylyn.tasks.ui.TasksUiPlugin", thread
"Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[Worker-3,5,main]"
to finish starting bundle "update@plugins/org.eclipse.mylyn.tasks.ui_2.0.0.v20070627-1400.jar [399]".
To avoid deadlock, thread "Thread[main,6,main]" is proceeding but
"org.eclipse.mylyn.tasks.ui.TasksUiPlugin" may not be fully initialized.
After reading numerous posts on the topic, I tried many different fixes. Finally, I read the words of Eugene Kuleshov: "Another option is disable Mylyn's hyperlink detector wich you can do at Window / Preferences / General / Editors / Text Editors / Hyperlinking."
What worked
Open Eclipse Preferences (Apple-,).
Type filter text "hyperlink", or navigate to General : Editors : Text Editors : Hyperlinking.
Deselect checkboxes "Mylyn Tasks" and "Mylyn URLs".
Click Apply, then OK.
Restart Eclipse.
Results
Eclipse has faster startup, scrolling, and search, takes up less memory, saves without beachball delays, and supports my favorite plugins nicely. Turning off Mylyn hyperlinking makes my days more productive.
Other Fixes Tried
Removing or disabling Mylyn did not work. It seems there are circular dependencies.
Removed or disabled plugins, including Aptana and JSEclipse.
Upgraded to 4GB of RAM. Already had 2.6GHz MacBook Pro with 180Gb HD, and Mac OS X Leopard (10.5.2).
Freed up 80GB of hard disk space.
Increased Eclipse memory settings, and found out along the way that Eclipse has a Mac OSX bug that prevents Java VM detection. In the thread "--launcher.XXMaxPermSize: Can't identify Sun VM" you'll find no fewer than 34 posts, and no resolution, as of 2008-04-21. "java.lang.OutOfMemoryError: PermGen space" was the original complaint.
Turned off Eclipse spell-checking. General : Editors : Text Editors : Spelling. This eliminated the yellow squiggly highlights under variable names and reserved words such as "var", and sped up editing. Typically 100 such warnings in a 600-line JavaScript file. With six files open, memory footprint included Real Memory: 347MB, Vmem: 2.08GB. Without spellchecking, 214MB and 1.95GB.
Ran JBoss at the command line, instead of in Eclipse.
Turned Aptana code completion (contextual help) delay up to 9999 milliseconds.
Glad to find this post! I had a similar issue where I'd get a beach ball when twisting open java project source directories in the Package Explorer. It typically only happened when I first did this after a launch, but would often have to wait 30 seconds or more. It would also occur at other strange times.
I'm using Ganymede (3.4) and the checkboxes are named slightly differently. I disabled "Tasks" and "Task URLs" and the delays have gone away (so far, anyway). I've got Java 1.4, 1.5 and 1.6 and am running 10.5.4.
Thanks again, . John posted by duetjohn : July 23, 2008 2:14 PM
permalink
John, I'm glad that it helped! --Monte posted by Monte Hayward : July 30, 2008 8:11 AM
permalink
I think this finally solved the abysmal performance of Eclipse on OS X. I had already tried other suggestions too such as disabling spell checking, increase memory allocation, etc.
Google Notebook needs integration with other Google offerings to make an effective way to get things done. Why? I want project management tools in lightweight, browse-anywhere form. Google seems well-positioned to provide a comprehensive TODO system. Tasks and Projects may arrive in the form of emails, phone calls, random thoughts, or ideas while reading a Web Page. Google Project would become a data model for loosely binding other Google item types, and tracking state.
Others Lack
In the years I used it, Microsoft Outlook never added the ability to make one task dependent on another. Perhaps to do so might have threatened Microsoft Project.
Many other services that attempt to provide project tracking are cumbersome. Web 1.0 whole-page forms that only work on an Intranet, and are cumulative (record running commentary) instead of offering a way to refine projects and tasks.
Similarly-focused products have barriers to adoption, such as costing money, platform-dependence, installation of software or plugin, and software updates. Corporate buy-in is required.
Google Project would offer the following features:
Add GMail item access to notebooks.
Give Google Notebook items organizational states, such as TODO, DELEGATED, DONE, BLOCKED.
Task dependencies would be the obvious follow-on feature.
Ability to bind a Google Calendar event to a project.
Works for anyone, anywhere. Thrives through intellectual contagion.
User Story
I need to choose the most appropriate JavaScript framework for a new product in development. An email reminds me of this task. I search Google and Note 12 pages that compare frameworks and offer tutorials. The resulting Google combines these items to represent what needs to be done:
The email, with some annotation, becomes the Project
The bookmarks, with annotation, become tasks. E.g.: Compare jQuery and Dojo at URLs "A" and "B".
I schedule a meeting with another developer in Google Calendar.
I am reminded of the project and subtasks from multiple places: Google.com/ig Notebook widget, GMail labels, Google Bookmarks, Google Calendar, and Google Notebook.
Google may benefit by expansion of its advertising base, and by upselling to an Enterprise version.
The development team at Kimbia.com, myself included, put together this portable donation widget. It allows supporters of a cause, in this case public television, to post a "donation box" on their own Web site. The concept is to push fundraising out to the edges of the network of advocates for a cause. You can now get the snippet of code to put on your own site, from klru.org/widget.
Synopsis: I can use my SanDisk Cruzer on Mac OS X, with a simple settings change. From Windows XP, I disabled U3 security in the U3 Launchpad menu. No removal tool or hacks were necessary. I can now launch Windows applications from the USB key, and use it as file storage on Mac and Windows.
Many forum and blog posts complain about lack of Mac OS X support on the flash drives made by SanDisk, which come with U3.exe Launchpad. They describe U3 Software removal tools and reformatting the flash drive in order to "use all of it". These steps allowed me to make a simple settings change, and retain the ability to launch programs on Windows XP using "U3 Smart Programs."
Prepare SanDisk USB for Mac OS X
Insert Sandisk Cruzer into Windows XP USB port. Autoplay causes the U3 prompt to come up.
Enter password. System tray icon "U3" appears.
Click on U3 System Tray icon
Select "Disable Security"
Re-enter password if prompted.
Security button changes to "enable:.
That's it. To verify that it worked, I performed the following steps.
Verify U3 USB Key Working on Mac OS X
Click U3 System tray icon, and select "Eject".
Remove flash drive from Windows USB port. (In my case, the SanDisk Cruzer micro 4GB)
Stick flash drive into Mac OS X USB port
In Finder, click on the drive. (It appeared as "No Name", next to Macintosh HD.)
Select any subfolder. e.g. Documents
Perform read/writes to the USB key from Mac OS X.
e.g.:Create new folder, edit a text file, save a new file, copy files to and from the flash drive
I often get a Web page mockup from a graphic designer, and the task of implementing the design in CSS. I use this trick to achieve precise alignment and coloring, without spending much time measuring:
Save the mockup as a PNG.
On Chris Pederick's Web Developer Toolbar, Click CSS: Edit CSS.
Edit the CSS in the toolbar to make the PNG your body background. The real document elements now render over the background, which highlights alignment and color mismatches.
Continue editing CSS until the colors match.
Then edit the CSS until page elements align, overlapping the background image exactly.
Test by removing the mockup background image statement in the CSS. The page should look no different as you toggle the mockup on and off.
Click the Save button in the toolbar's Edit CSS view.
Save the CSS changes locally, and then promote the finished CSS to the server.
This little notice came up in Windows XP Media Center Edition:
Not even close, Windows MCE. The only things I have plugged in lately are a camera memory chip, an mp3 player, and a USB key.
I also got a message over the weekend that my Sansa mp3 firmware updater had an update. It turned out to be false. The updater updater was nowhere to be found. Maybe I need the updater updater updater...