tag:blogger.com,1999:blog-304411142008-09-19T01:21:22.000-05:00Going On A Safari...A few years ago I started this blog to try and document some issues I encountered with Apple's Safari browser, but since then, the three major browsers (Safari, FireFox, and IE7) have done a better job of converging upon common standards.
Now this has become a little more diverse.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-30441114.post-47279803036731496412008-08-30T15:17:00.003-05:002008-08-30T15:28:53.097-05:00PhotosynthLast Thursday I happened to stumble upon an interesting site that allows you to take multiple photos and combine them into a 3-D model. That happened to be the day they rolled it out to the general public. I was able to put together a synth that was 100% synthy on the first try which was beginner's luck and perhaps a little spoiling too.<br /><br />Since then I have put together about 4 major synths, and I have tried to revisit each of them a few different times to try and get them to be 100% synthy. <br /><br />NOTE: I will be expanding upon this in the next few weeks, please check back. This is not nearly complete yet, sorry...<br /><br />There have been some challenges with Photosynth that I have come across and I have been able to address some of them too.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-52569760787274263502008-05-28T13:39:00.004-05:002008-05-28T14:23:43.611-05:00I'm just saying...The phrase "I'm just saying..." is an interesting example of how we can get by with expressing almost anything that happens to be on your mind, without reaping the consequences. Or at least that is how it has been explained to me, usually with the addition of "I'm just saying..." of which I find to be a bit circular.<br /><br />Every once in a while I have a few things pop in to my mind, of which if I happen to share of others, then tend to think the thoughts are rather deep in nature. Now, I am not tooting my own horn or trying to imply that that I have any delusions of grandeur, but I am just saying...<br /><br />Please enjoy, where you can. ;-)<br /><br /><br /><span style="font-weight: bold;">Little Minds mind little.<br />Big minds mine big.</span><br /><br />This was an interesting creation that I enjoyed about six months ago. I do like the fact that it is a palindrome (when using words as a unit), but the meaning and enjoyment does go a bit deeper than just that. What I have noticed when I have shared this with others, is that initially they tend to overlook on the second line, the word "mine" instead of a repeat of "mind" as the pattern was setup in the first line. This still keeps it a valid palindrome, but to me, it makes it far more humorous in the nature that the individual to whom is speaking this is, in the first line, scolding folks with little minds, but then marvels about how large their mind is, which to me, confirms that that individual last the smallest mind of all. I personally read the first line's "minds" as a noun referring to the mental faculties and or opinion or views that someone has. The adjective of little both refers to the diminutive state of someones mental faculties, if you will, due to their warped perspective on humanity (see below), and their lack of caring. Of which the "mind" in line one is focused on the verb to be concerned about.<br /><br />Now what got me thinking about this juxtaposition was that I have been a frequent observer (and dare I say complainer) about how little minded individuals tend to care (mind) that much for other or even that which is around them. They tend to be out for themselves at any cost. This could be reflected through racism, hatred, deception, criminal activities such as preying upon the elderly or under privileged, etc. I'll let you use your own imagination to fill in the examples on who might fit this build. <br /><br /><br />Another interesting palindrome that I just thought of a few weeks ago is...<br /><br /><br /><span style="font-weight: bold;">Humanity is inhumane.</span><br /><br />I think the likes of individuals such as Hitler, Chairman Mao, Stalin, and ect..., or events in modern history such as The Spanish Inquisitions, Salem Witch Hunts, or even events such as the Trail of Tears sums this up succinctly.<br /><br />Interesting note, I just Googled this phrase and it appears to be fairly popular with 194 hits, but some are duplicates and circular too.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-48576982624187739122008-02-11T22:23:00.001-05:002008-02-11T22:35:22.144-05:00Microsoft's attempt to drive customers to buy macsI must admit, if there is one feature that makes you scratch your head and wonder what the heck the folks at microsoft were smoking on the day they dreamed up that wonderful set of tools called Accessibility Options within XP. <br /><br />It may be a great set of tools that for those who need them because of unfortunate handicaps, but the boneheaded folks at microsoft sure did goof on common sense interfaces.<br /><br />It behaves like a virus for it can hose your computer without your knowledge and there is no way to permanently disable it. I am sure many of users have been burned by it.<br /><br />I saw that I am not alone in this common snake pit, for the following person summed it up quite nicly:<br />http://www.classicdosgames.com/blog/?p=3<br /><br />I think this one feature alone could cause many folks to seriously consider the Mac platform, if not for any reason other than a good grasp of the concept behind a common human interface design.<br /><br />Or perhaps it could also be one of the greatest marketing ploys ever devised, MS to harward manufacturers: "Bundle our OS with your hardware and we will include a software feature that would be sure to increase sales due to physical abuse by users to their hardware."Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-10890858330546235162008-01-10T11:59:00.001-05:002008-01-10T12:22:53.830-05:00Eclipse v3.3.x PermGen Memory ErrorsOut-of-the-box Eclipse v3.3.x was giving me on average 12 to 16 crashes per day! I was even seriously considering dropping Eclipse altogether and finding something more stable.<br /><br />I was using Eclipse v3.3.1 with the WST extension and tigris.org's subclipse v1.2.0 (since the v2.x has serious bugs that prevents it from installing) on a Windows XP Pro platform. <br /><br />The short of the problems came down to a mistake in the eclipse.ini file that had the <pre>--launcher.XXMaxPermSize</pre> statement come before the <pre>-vmargs</pre> statement. It is a little more involved that that, one issue was that the duel-level launch configuration that Eclipse uses does not always do a great job of detecting Sun VMs, of which the <pre>--launcher.XXMaxPermSize</pre> only works with a Sun VM, which defaults the PermGen space to a size of 64MB. <br /><br />The suggested fix is to remove <pre>--launcher.XXMaxPermSize</pre> and replace it with <pre>-XX:MaxPermSize=256m</pre> after <pre>-vmargs</pre> it should now pickup the change.<br /><br />This change and usage of <pre>-XX:MaxPermSize</pre> is said to be universal (to some degree) to other VM's such as the mac.<br /><br />An example of my config which works, which is "fairly" close to the original eclipse.ini:<br /><pre style="width: 350px; background-color: #ffffcc; border: 3px inset blue; padding: 6px;">-showsplash org.eclipse.platform<br />-vmargs<br />-Xms512M<br />-Xmx1028M<br />-XX:MaxPermSize=256M<br /></pre><br />One area of great disappointment with all of this, is that it appears like they were spending a fair amount of time arguing how and when to apply this fix or even announce this potential problem instead of just getting it done. I really do enjoy the Eclipse experience, but because of this problem, I was about to drop it and probably never give it another chance. Good thing I went snooping through their Bugzilla!<br /><br /><b>References</b><br /><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=203325">Eclipse's Bugzilla Entry on this bug</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-18330432538229178952008-01-01T17:15:00.000-05:002008-01-01T17:26:56.559-05:00FireFox Add-On worth trying - FireBugFor the last few months I have been wishing that the PC version of Safari had the same full robust HTML and CSS debugging tools as the mac counterpart. Well, I have just found in the last week a tool that should make any Mac Safari user quite envious.<br /><br />The tool's name is FireBug. <br /><br />What is great about it? Here is a very short list:<br /><ul><br /> <li>JavaScript Error Console</li><br /> <li>JavaScript profiler</li><br /> <li>View source code for HTML, CSS, JavaScript, Images, etc...</li><br /> <li>HTML Source hover-highlighting</li><br /> <li>Select an DOM element, and it can show the CSS styles that contribute to it, the Box model layout, and DOM hooks</li><br /> <li>Dynamically modify CSS elements without modifying any source code or reloading the page to see the results</li><br /> <li>Set JavaScript breakpoints for debugging</li><br /> <li>See Network performance stats on object/page loads</li><br /> <li>Review dynamic AJax calls: parms, headers, and response</li><br /></ul><br /><br />This is a really useful tool. If you spend any time in HTML, JavaScript, CSS, this tool is well worth looking in to. I don't think many would be disappointed. <br /><br /><b>References</b><br /><a href="http://www.getfirebug.com/">FireBug's Website</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-68719889522917468652008-01-01T16:44:00.000-05:002008-01-02T22:27:53.421-05:00Prototype v1.6 Ajax.Updater and textarea in FireFox v2.xThere is a slight issue with how Prototype v1.6 (and prior) deals with textarea form elements when used in combination with Ajax.Updater. This appears to only be an issue with FireFox v2.0.0.x and not IE7 or Safari v3 for Windows. I have not tested to confirm if this is an issue on non-windows versions of FireFox or other browsers or platforms.<br /><br />The problem enters when Updater is successful in putting the results content in to the textarea innerHTML, but the contents are not displayed. Most of the solutions that I have been able to find on the web suggests to use a onSuccess: callback then within there, pull the responseText from the response object and shove it in to the value of the textarea. <br /><br />Example of a BAD use of Ajax.Updater with the textarea:<br /><pre style="background-color: #fbf6ee;"><br /> <form id="formid"><br /> <textarea id="textareaid" /><br /> </form><br /> Ajax Status: <div id="ajaxStatus"></div><br />...<br /> new Ajax.Updater( 'textareaid', 'anSOAapp.jsp', {<br /> parameters: { id: anId, afield : avar },<br /> onFailure: function(){<br /> $('ajaxStatus').update('<b>An error occurred.</b>'); <br /> }, <br /> onSuccess: function(response) {<br /> $('textareaid').value = response.responseText;<br /> $('ajaxStatus').update( response.status ); <br /> }});<br /></pre><br />How wasteful! Not only in redundant processing (the contents of the textarea is being updated twice!), but also in memory that JavaScript is now having to allocate and use. What is the point of using the Ajax.Updater function if you are just going to overwrite its output?! For small tidbits of data, it may not be noticeable, but for larger data sets, then you can not only risk the out of memory exceptions, but also a non-functional page.<br /><br />The whole point of utilizing the Ajax.Updater function is to help streamline the whole data flow and to offset the needs to keeping the data in a variable or as a String in JavaScript, which is what occurs when using the responseText field. <br /><br />There is an easy solution that helps to avoid these problems of redundancy and excessive memory utilization. It is actually quite simple.<br /><br />Example of the correct use of Ajax.Updater with the textarea:<br /><pre style="background-color: #fbf6ee;"><br /> <form id="formid"><br /> <textarea id="textareaid" /><br /> </form><br /> Ajax Status: <div id="ajaxStatus"></div><br />...<br /> new Ajax.Updater( 'textareaid', 'anSOAapp.jsp', {<br /> parameters: { id: anId, afield : avar },<br /> onFailure: function(){<br /> $('ajaxStatus').update('<b>An error occurred.</b>'); <br /> }, <br /> onSuccess: function(response) {<br /> if ( Prototype.Browser.Gecko ) {<br /> <b>$('formid').reset();</b><br /> }<br /> $('ajaxStatus').update( response.status ); <br /> }});<br /></pre><br /><br />Notice that the key element was <b><pre>$('formid').reset();</pre></b> inside a conditional to ensure it only is performed for FireFox browsers.<br /><br />Give it a try.<br /><br /><b>Resources</b><br /><a href="http://www.prototypejs.org/api">Prototype API Docs</a><br /><a href="http://www.prototypejs.org/api/form#method-reset">Prototype's Form.reset() function API Docs</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-30299861269350533232007-12-11T02:45:00.000-05:002007-12-11T02:54:42.745-05:00Lead in Children's Toys and BooksSad. It is really sad the extend to which manufacturers are willing to put our children's health and lives in jeopardy to just make a profit. <br /><br />The current batch of recalls tend to be related to paint that has high amounts of lead, which brings me to wonder what about the children's books and ink? How much lead are in those? Is anyone even testing children's books?<br /><br />Here is a site that is trying to list toys that have been independently tested to be free from surface lead and embedded lead. Unfortunately they do warn that even though these toys tested OK, that does not necessarily mean other batches of the same product (future or past) will not contain lead.<br />http://www.toyportfolio.com/Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-10237756904521321562007-12-11T02:40:00.000-05:002007-12-11T02:45:12.482-05:00Get the Lead Out - ReplyI came across the following post:<br />http://atatude.wordpress.com/2007/12/10/get-the-lead-out/<br /><br />It had a reference to the following CNN article on Lead in Christmas Lights:<br />http://www.cnn.com/2007/HEALTH/12/10/christmas.lights/<br /><br />My reply:<br /><br />Nice find on the CNN article!<br /><br />Who do they think we are? A bunch of mindless idiots who will blindly buy their products irrespective to the toxins they are willing to dump in to them so they can make a bigger buck? Sure sounds like it from some of the responses given by Wal-mart and other companies that were interviewed.<br /><br />I think the only way these arrogant companies will learn is through the bottom line. When parents stop spending "their" money on these tainted products and even return the products that have been recalled, their profits will suffer. Please do not just throw away recalled products, but try to return them. There is no better way to make the irresponsible retailers and manufacturers realize what the true impact of their "mistakes" will cost them.<br /><br />If surface lead can come off with a wipe test, just imagine how much lead comes off upon contact with the tree or other decorations? How much of that lead is microscopic to the point it is easily airborne too? How much lead are they putting in the artificial trees? How safe are the non-electrical ornaments? Since lipstick and children's toys has been found to have high levels of lead, what can we trust? <br /><br />One point that should be made about blood tests for lead, is that the body completely absorbs all lead within about 30 days of exposure so blood lead tests can only check for recent exposures and is no good at prior exposures. Once the lead is absorbed in to the tissue, I don't think even detoxification treatments can remove it.<br /><br />Last year I found some extension cords that were rated for indoor and outdoor use that had a label that specified that they were lead-free. Lead-free products can be made if the manufacturers want to. Personally, I'd be more than happy to pay a 20% or even 40% premium if the product can be guaranteed to be lead-free.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-45864740838722858482007-09-05T11:33:00.000-05:002007-09-05T11:34:58.184-05:00PermGen ExceptionHere are a few good links that discuss this in more detail. <br /><br /><br /><a href="http://xlml.com/aehso/2007/04/05/the-dreaded-javalangoutofmemoryerror-permgen-space-exception/">The dreaded “java.lang.OutOfMemoryError: PermGen space” exception.</a><br /><br /><a href="http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java">Classloader leaks: the dreaded "java.lang.OutOfMemoryError: PermGen space" exception</a><br /><br /><a href="http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded">How to fix the dreaded "java.lang.OutOfMemoryError: PermGen space" exception (classloader leaks)</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-54170358648926122962007-08-30T21:49:00.000-05:002007-08-30T21:59:11.533-05:00Go for the Bitter CoffeeJust wanted to share something interesting about how healthly a bitter cup of coffee may actually be. It turns out the higher the bitter content, the greater the amount of anti-oxidants. It appears that the bitterness is caused by the roast, so the darker the roast, the more anti-oxidants it may contain.<br /><br />Check out the original story at <a href="http://www.highlighthealth.com/food-and-nutrition/bitter-coffee-better-health/trackback/">Bitter Coffee Better Health</a> with references back to the original studies (just in case this sounds too good to be true and you want to read it yourself ;-) ).<br /><br />Also, as a note, there are many other interesting articles of note, all with a good dose of references too.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-9450851138429940592007-07-19T11:19:00.000-05:002007-07-19T11:53:45.256-05:00Status of Safari and some comments about JavaScript and AJaxSorry to say, but I have not been working with Safari for a while now. I did get a few comments pointing out some flaws in what I have done in the past. I am not too surprised, but luckily that is one of the best ways to learn and grow. I'll be activating those comments shortly.<br /><br />As some background, I have tended to keep away from JavaScript in the past. The same holds true today, but at a lesser degree. The primary reason was cross browser compatibility and the fact that sometimes the JavaScript can get quite complex when you start to include all of the variations for past browsers and future ones.<br /><br />One thing that has been winning me over is the JavaScript tools that are focused on prototype.js and the use of AJax. It also helps that the advanced features in CSS 2.0 and what will be coming with CSS 3.0 specifications will help reduce the need for scripting.<br /><br />I have continuously been on the hunt for a good JavaScript based code set that allows table scrolling. I found a bunch of bad stuff out there. I found a few good ones too. One of which actually does work with AJax. I am wanting to post reviews and links to these tools for they are hard to find, and I think the information will be beneficial. The tool that works with AJax utilizes prototype.js which is great, but I have some enhancements that I am working on that will be increasing the performance by about a factor of 10 or greater (I think. Need to benchmark.) when dealing with rowsets greater than 1000 when the will be needing to deal with 40,000+, probably up to 100,000 rows... I know... I don't write the specs, just follow them :-(<br /><br />For now I'll provide some links...<br /><br /><span style="font-size:130%;">References:</span><br /><hr /><br /><span style="font-weight: bold;font-size:100%;" > http://www.sergiopereira.com/articles/prototype.js.html</span><span style="font-size:100%;"><br /></span><ul><li>Excellent independent documentation on prototype.js!</li><li>Using version 1.5.1<br /></li></ul><br /><span style="font-weight: bold;"> http://www.tetlaw.id.au/view/blog/table-sorting-with-prototype/</span><br /><ul><li> Excellent! Uses prototype.js and the code is very clean and readable.</li><li>Works with AJax</li><li>Sluggish with 1000+ rows. I have some fixes in the pipeline that once I get them tested I'll see about getting the code changes adopted.</li><li>Using version 1.0 with Prototype version 1.5.1 instead of 1.5.0_r<br /></li></ul><span style="font-weight: bold;">http://www.litotes.demon.co.uk/example_scripts/tableScroll.html</span><br /><ul><li>Works great with IE5, IE6, IE7, FireFox v2 (Windows and Mac OSx), and Safari</li><li>Low impact. Just call the function with passing the ID for your table and it does the rest.</li><li>Problem? It does not work with AJax. Works great with static HTML tables. Honestly, the code is a bit cluttered since it does not utilize prototype.js so it has to handle so much more internally.</li><li>Another problem appears to be that it was last updated in 2004. </li><li>Sad, it has strong potential if it was not for the lack of AJax support.</li></ul>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-38897697820929229692007-03-01T12:35:00.000-05:002007-03-01T12:49:43.238-05:00Pet Peeve with Technical Help on the Internet<p class="MsoNormal">I guess I am just in a complaining mood, but one pet peeve I have with technical help on the internet is the lack of documenting some the basics.</p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">These basics include:<br /></p> <ul><li><span style=""> </span>timestamp of posting</li><li><span style=""> </span>technologies involved</li><li><span style=""> </span>versions of all technologies</li><li><span style=""> </span>clear descriptions on how to repeat the problem or the solution</li><li><o:p> </o:p><span style=""> </span>posting the solution if it is found</li><li><span style=""> </span>citing references for solutions or other concepts</li></ul> <p class="MsoNormal">It is amazing how many websites have obsolete and dated information on them.<span style=""> </span>At least blogs and message threads do timestamp their content, but when someone creates a website with general information, it is difficult to judge how old the content is.</p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">I guess I could also complain about titles of documents and messages in that many people like to use very generic descriptions such “I have a problem” or “I need a solution fast”.<span style=""> </span>I feel titles should contain the most basic essence of the content of the document.<span style=""> </span>In light of technical help, when you are presented with a list of thousands of titles, it does make it easier to search through them if they were more logically created.<span style=""> </span>Yes, and I feel the same way about email in general.<span style=""> </span></p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">To summarize: Please give careful consideration to what you choose for titles and the content of postings.<span style=""> </span>It may make for better searches.</p>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-7040323430003285382007-02-27T14:15:00.000-05:002007-02-27T15:43:34.201-05:00Java Web Start – JNLP Tuning<span style=""><o:p></o:p></span><span style="">My relevant environment background is as follows:<br /></span><ul><li><span style=""><span style=""> </span>Eclipse v3.2.1</span></li><li><span style=""><span style=""> </span>JDK 1.5.0_10<o:p></o:p></span></li></ul> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;font-size:130%;" ><span style="font-family:courier new;">JNLP Tuning:</span><br /><span style="font-family:courier new;">------------</span></span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">It is possible to tune the JNLP files to improve performance in the loading of the jar files.<span style=""> </span>For example, you can specify which jars are needed and which ones are optional.<span style=""> </span>The point being that the application may not need to download all of the jars to get up and running.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">There are two major components that I will list here.<span style=""> </span>One is to specify which jar files need to be aggressively loaded versus ones that can be lazily loaded. The other technique is to list all of the contained packages in the related jar files so Java Web Start does not have to download all Jars just to find a class file or resource.<span style=""> </span>The later will make for larger JNLP files and of course make them more complex, but could improve the initial download time for users to get up and running.<o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">Both of these techniques should actually be combined to provide the greatest performance gains.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">Regardless as to what techniques are used to improve the initial loading time of the jar files, once they are in the Java Web Start cache, the load time will be measured in seconds instead of minutes for subsequent launches of the application.<o:p><br /></o:p></span></p> <p class="MsoNormal" style="font-weight: bold;font-family:courier new;"><span style="font-size:130%;"><span style="font-size:10;">Example of lazy and eager loading<br />---------------------------------<o:p></o:p></span></span></p> <p class="MsoNormal" style=""><span style="">A download hint of lazy or eager can be specified.<span style=""> </span>Java Web Start will try to honor these hints, but if it cannot find a needed resource it may download all jars anyway until it finds what it is looking for.</span></p><p class="MsoNormal" style=""> </p> <p class="MsoNormal" style=""><span style="font-size:100%;"><span style=""><span style=""></span></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span><resources><br /><span style=""> </span> <jar href="plugins/mysql_connector_j_3.1.12.jar" download="eager" /><br /><span style=""> </span></span></span><span style="font-size:85%;"><span style="font-size:10;"><span style=""></span> </span></span><span style="font-size:85%;"><span style="font-size:10;"><jar href="plugins/org.apache.log4j_1.2.14.jar" download="lazy" /><br /><span style=""> </span></resources><o:p></o:p></span></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;font-family:courier new;font-size:130%;" >Example of Package and Part:<br />----------------------------</span><o:p><br /></o:p></span></p> <p class="MsoNormal" style=""><span style="">You can provide a hint to JWS as to what is contained within a jar by the use of the Package and Part within the JNLP.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">Building upon the example under lazy and eager loading:<o:p><br /></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span><resources><o:p></o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span></span><span style="font-size:10;"> </span><span style="font-size:10;"> <jar href="plugins/mysql_connector_j_3.1.12.jar" download="eager" part="mysqlcj" /><o:p></o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span></span><span style="font-size:10;"> </span><span style="font-size:10;"> <jar href="plugins/org.apache.log4j_1.2.14.jar" download="lazy" part="log4j" /><o:p></o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><o:p> </o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span></span><span style="font-size:10;"> </span><span style="font-size:10;"> <package part="mysqlcj" name="com.mysqlj.*" recursive="true" /><o:p></o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span></span><span style="font-size:10;"> </span><span style="font-size:10;"> <package part="log4j" name="org.apache.log4j.*" recursive="true" /><o:p></o:p></span></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:85%;"><span style="font-size:10;"><span style=""> </span></resources><o:p></o:p></span></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-size:85%;"><span style="font-family:courier new;"></span></span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;">Part</span> ties the <span style="font-weight: bold;">package</span> tags back to the jar tags.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">The use of the recursive="true" attribute really can save a great deal of typing. Take for example the mySQL connector j example right above.<span style=""> </span>It used a value of true on the recursive attribute, but if it were to use false, you would have to list out all of the possible packages contained in the jar even though they all began with com.mysql.<span style=""> </span><o:p></o:p></span></p> <p class="MsoNormal" style=""> </p><p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.configs.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.integration.c3p0.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.integration.jboss.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.jdbc2.optional.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.log.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.profiler.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:courier new;"><span style="font-size:10;"><span style=""> </span><package part="mysqlcj" name="com.mysqlj.jdbc.util.*" recursive="false" /><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;font-size:130%;" ><span style="font-family:courier new;">References:</span><br /><span style="font-family:courier new;">-----------</span></span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">http://lopica.sourceforge.net/ref.html#package<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">http://lopica.sourceforge.net/ref.html#jar<o:p></o:p></span></p>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-87227875123241188742007-02-27T13:16:00.000-05:002007-02-27T16:56:11.538-05:00Java Web Start and Eclipse – Feature Export and an Eclipse Bug<span style=";font-family:";font-size:10;" >My relevant environment background is as follows:<br /></span><ul><li><span style=";font-family:";font-size:10;" ><span style=""> </span>Eclipse v3.2.1</span></li><li><span style=";font-family:";font-size:10;" ><span style=""> </span>JDK 1.5.0_10<o:p></o:p></span></li></ul> <p class="MsoNormal" style="font-weight: bold;"><span style="font-size:130%;"><span style=";font-family:";font-size:10;" >Eclipse 3.2 Bug with Exporting a Feature to Java Web Start<br />----------------------------------------------------------<o:p></o:p></span></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >There is a known bug in Eclipse version 3 that generates the wrong name for an Eclipse plugin when exporting a Deployable Feature.<o:p><br /></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >The bug is marked as fixed and has also been marked as being incorporated in the main stream releases of various versions of Eclipse, such as v3.2.1.<span style=""> </span>But the bug still remains.<o:p><br /></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >The symptoms of this bug is the following stack dump when attempted to run under Java Web Start:<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="font-size:85%;"><span style=";font-family:";font-size:10;" ><span style=""> </span>!SESSION Tue Feb 06 10:48:01 EST 2007 ------------------------------------------<br /><span style=""> </span>!ENTRY org.eclipse.core.launcher 4 0 2007-02-06 10:48:01.112<br /><span style=""> </span>!MESSAGE Exception launching the Eclipse Platform:<br /><span style=""> </span>!STACK<br /><span style=""> </span>java.lang.NullPointerException<br /><span style=""> </span>at java.util.Hashtable.put(Unknown Source)<br /><span style=""> </span>at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain.java:58)<br /><span style=""> </span>at org.eclipse.core.launcher.Main.run(Main.java:977)<br /><span style=""> </span>at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.java:40)<br /><span style=""> </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /><span style=""> </span>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br /><span style=""> </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br /><span style=""> </span>at java.lang.reflect.Method.invoke(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.executeApplication(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.executeMainClass(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.continueLaunch(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)<br /><span style=""> </span>at com.sun.javaws.Launcher.run(Unknown Source)<br /><span style=""> </span>at java.lang.Thread.run(Unknown Source)<br /><o:p> </o:p></span></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >The cause is that Eclipse is generating the plugin with a name of <span style="font-weight: bold;">org.eclipse.osgi_3.2.2.R32x_v20061101.jar</span> when it really should be <span style="font-weight: bold;">org.eclipse.osgi_3.2.2-v20061101.jar</span>.<span style=""> </span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >Depending upon your version of Eclipse, you may have different versions of this jar file.<span style=""> </span>All that is needed to be done is to remove the .R32x_ and replace it with -. <o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >You must also modify the generated JNLP file to reflect the new name.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >This will occur each time you perform an export of a Deployable Feature.<o:p><br /></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >The reason why this is an issue, is that internally to the plugin, (or other plugins that are trying to find this one), it is using a different name/signature that does not match the use of .R32X_ . <o:p></o:p></span></p> <p class="MsoNormal" style="font-weight: bold;font-family:courier new;"><span style="font-size:130%;"><span style="font-size:10;">References:<br />-----------<o:p></o:p></span></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >https://bugs.eclipse.org/bugs/show_bug.cgi?id=125867<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=";font-family:";font-size:10;" >http://eclipsezone.com/eclipse/forums/t64274.html<o:p></o:p></span></p>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-90412488933481766302007-02-27T12:54:00.000-05:002007-02-27T13:04:04.135-05:00Java Web Start and Eclipse - Signing Jars and Hibernate<span style=""><o:p></o:p></span><span style="">As a quick note:<o:p></o:p></span> <p class="MsoNormal" style=""><span style="">If you are deploying an Eclipse Plugin as a Java Web Start, there are some changes that must be made to your application to ensure it plays well with everything. <o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">This is the first of a few quick notes on the subject.<span style=""> </span>I am starting with this issue, since it was the most difficult to find a resolution for.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">My environment background is as follows:<br /></span></p><ul><li><span style=""> Eclipse v3.2.1</span></li><li><span style=""> hibernate plugin : com.hibernate.eclipse_3.2.0.beta9a</span></li><li><span style=""> JDK 1.5.0_10<o:p></o:p></span></li></ul> <p class="MsoNormal" style=""><span style="">Java Web Start is basically a tool that Sun provides that allows users to run Java applications that have been bundled in Jars on their computers.<span style=""> </span>It has limitations similar to those imposed upon Java Applets, but if the jars are signed, then the Java Security Manager can grant full access to all resources on the local computer.<span style=""> </span>It may take a while to download numerous signed jars and verify their signatures, but once they are downloaded, rerunning the application the start time can be measured in a matter of seconds instead of minutes.<span style=""> </span>JWS also provides nice features for updates and utilization of different JDK versions.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="font-weight: bold;"><span style=""><span style="font-weight: bold;">Jar Files MUST be Signed</span><br /><span style="font-size:130%;"><span style="font-family:courier new;">------------------------</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-weight: bold;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">All jar files that are being deployed must be signed if your application must access resources outside of the sandbox.<span style=""> </span>If a jar file is to be expanded on the client's computer, all nested jars must also be signed.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">Java, at least 1.5 and lower, cannot deal with nested jar files.<span style=""> </span>When such a situation occurs, as with the Hibernate plugin for Eclipse, Xerces, or even the Eclipse core plugin for example, the jar file must be expanded before the resources can be accessed.<span style=""> </span>When the contents of a jar file is expanded, the resources it contains is no longer digitally signed (if it was decompressed, it will not match the digital signature).<span style=""> </span>This is an issue for the nested jars, since they generally must be signed.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">The only exception to this rule is with the Eclipse Hibernate plugin.<span style=""> </span>The two jar files that cannot be signed are: hibernate3.jar and cglib-2.1.3.jar.<span style=""> </span>If these two jars are signed, the following exception will result:<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">java.lang.SecurityException: class "com.mypackage.MyClass$$EnhancerByCGLIB$$a1a0f853"'s <o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style=""> </span>signer information does not match signer information of other classes in the same package<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">The key part of the above error message being "signer information does not match signer information of other classes in the same package".<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;">A side note:</span><br /><span style="font-size:130%;"><span style="font-family:courier new;">------------</span></span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">I am unable to find the reference that states all nested jars must be signed (it is also a low priority to find it).<span style=""> </span>Signing nested jars files works with the exception above.<span style=""> </span>Upon searching for the problem as listed with the ‘signer information does not match’ exception, I have found that many other people have also signed the nested jars before exporting the plugins out of Eclipse.<span style=""> </span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">To me this just sounds wrong on a few levels.<span style=""> </span>I have not had the chance to really test this theory by unsigning these plugins, but it will solve that question.<span style=""> </span>If it does work without signing the nested jars, then it does make sense that when JWS initially expands the jars, it keeps track of the original signature and that all expanded resources has having passed the verification.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">If you have references that point to the fact that nested jars do not need to be signed, please let me know.<span style=""> </span>I will probably run some tests in the next week or two to verify this.<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style=""><span style="font-weight: bold;">References:</span><br /><span style="font-size:130%;"><span style="font-family:courier new;">-----------</span></span><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">http://groups.google.co.za/group/CTJUG-Forum/tree/browse_frm/month/2006-05?_done=%2Fgroup%2FCTJUG-Forum%2Fbrowse_frm%2Fmonth%2F2006-05%3F&<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style="">States that "Never sign hibernate???.jar and cglib???.jar. They seem to work just fine as they are."<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style=""><span style="">http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/development.html#security<o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><a href="http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/contents.html">http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/contents.html</a><o:p></o:p></span></p> <p class="MsoNormal" style=""><span style=""><o:p> </o:p></span></p>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-63107034821711367052006-12-07T15:04:00.000-05:002006-12-07T15:09:06.794-05:00Lead and Christmas LightsLead is a highly toxic poison. There are no safe levels of exposure for children for it causes irreversible brain damage.<br /><br />Lead should be outlawed in consumer products. Period.<br /><br />Let technology find an alternative substitute.<br /><br />Some Links:<br />http://jfaughnan.blogspot.com/2006/11/lead-poisoning-from-christmas-lights.html<br /><pre><a href="http://checnet.greenhome.com/products/kids/art_supplies/107864/" target="_blank">http://checnet.greenhome.com/products/kids/art_supplies/107864/</a><br /><a href="http://answers.google.com/answers/threadview?id=435871" target="_blank">http://answers.google.com/answers/threadview?id=435871</a><br /><a href="http://www.babycenter.com/comments/toddler/toddlersafety/10453" target="_blank">http://www.babycenter.com/comments/toddler/toddlersafety/10453</a><br /><a href="http://news.thomasnet.com/fullstory/469079/3839" target="_blank">http://news.thomasnet.com/fullstory/469079/3839</a><br /></pre>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1160086309774847902006-10-05T17:04:00.000-05:002006-10-05T17:29:34.246-05:00Useful Links for Web Development on SafariBelow are some useful links for doing web development for Safari.<br /><br /><b>Links for Limited Safari Technical Documentation</b><br /><a href="http://developer.apple.com/internet/safari/safari_css.html">http://developer.apple.com/internet/safari/safari_css.html - This is a good quick reference. Do not assume this list is the complete listing, for it is not. It dates back to around 2004 and has not been updated. To get the full supported list try the following link.</a><br /><br /><a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/doc/uid/TP30001266-SW1">http://developer.apple.com/documentation/AppleApplications/ Reference/SafariCSSRef/Articles/StandardCSSProperties.html# //apple_ref/doc/uid/TP30001266-SW1 - This is the full supported listing of all CSS properties. Not sure when this was published, but it is more recent than the above link. There is also the CSS Extensions that are included in Safari: see the next link.</a><br /><br /><a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Articles/CSSExtensions.html#//apple_ref/doc/uid/TP30001265-SW1">http://developer.apple.com/documentation/AppleApplications/ Reference/SafariCSSRef/Articles/CSSExtensions.html# //apple_ref/doc/uid/TP30001265-SW1 - These are the CSS Extensions. All two of them! ;-) Try clicking on the link “show TOC” for more information from Apple.</a><br /><br /><b>Miscellaneous Links</b><br /><a href="http://builder.com.com/5100-6371-1050180.html#Listing%20F">http://builder.com.com/5100-6371-1050180.html#Listing%20F - An alternative solution to dealing with different media types. Using the @media in your style sheets.</a><br /><br /><a href="http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps">http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps - Gaps around images</a><br /><br /><br /><b>Links from Apple</b><br /><a href="http://developer.apple.com/internet/safari/index.html">http://developer.apple.com/internet/safari/index.html - Apple’s Developer Domain’s Safari support page</a><br /><br /><a href="http://developer.apple.com/internet/safari/safari_css.html">http://developer.apple.com/internet/safari/safari_css.html - CCS reference for Safari. Out of date, but useful for those elements that are on the list.</a><br /><br /><a href="http://developer.apple.com/internet/safari/uamatrix.html">http://developer.apple.com/internet/safari/uamatrix.html - Mac OS, Safari, and WebKit version matrix.</a><br /><br />NOTE: WebKit is also the engine that drives not only Safari, but also the Mac’s Dashboard, Mail, and many other applications. This website may contain all of the updated documentation that I have been looking for. Actually not, it is mostly driven to developmental focus of the WebKit itself.<br /><br /><a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">http://www.ecma-international.org/publications/standards/Ecma-262.htm - The JavaScript standard that Safari (WebKit) is based upon.</a><br /><br /><b>CSS Related Links</b><br /><a href="http://meyerweb.com/eric/css/edge/">http://meyerweb.com/eric/css/edge/ - CSS Edge</a><br /><br /><a href="http://www.quirksmode.org/viewport/compatibility.html">http://www.quirksmode.org/viewport/compatibility.html - Screen dimensions</a><br /><br /><a href="http://www.quirksmode.org/dom/innerhtml.html">http://www.quirksmode.org/dom/innerhtml.html - Benchmark - w3c DOM vs. innerHTML</a><br /><br /><br /><b>JavaScript Related Links</b><br /><a href="http://webkit.opendarwin.org/blog/">http://webkit.opendarwin.org/blog/ - Has some information on JavaScript.</a><br /><br /><a href="http://www.alexking.org/blog/2004/03/01/mac-browser-javascript-performance/">http://www.alexking.org/blog/2004/03/01/mac-browser-javascript-performance/ - Has comments about browser performance. John Strung comments that turning off all languages other than English (or One) "can significantly speed up Safari". He is ASKING if anyone has tried this, so mark this down as RUMOR.</a><br /><br /><a href="http://www.codehouse.com/javascript/tips/random_letter/">http://www.codehouse.com/javascript/tips/random_letter/ - Creating random characters</a><br /><br /><a href="http://www.quirksmode.org/css/overflow.html">http://www.quirksmode.org/css/overflow.html</a> <br /> Quirksmode CCS - Contains some interesting aspects to CSS<br /> Quirksmode CCS - Not For N4 CCS <br /> Quirksmode CCS - Tables CCS <br /> Quirksmode CCS - JavaScript<br /><br /><a href="http://www.javascriptkit.com/jsref/regexp.shtml">http://www.javascriptkit.com/jsref/regexp.shtml - JavaScript Reference</a><br /><br /><b>Table Related Links</b><br /><a href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#edef-TD">http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#edef-TD - Information on how percents are only a hint</a><br /><br /><a href="http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.5">http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.5 - Table information</a><br /><br /><a href="http://www.quirksmode.org/viewport/compatibility.html">http://www.quirksmode.org/viewport/compatibility.html - Idea for adjusting width was found here.</a><br /><br /><a href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting">http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting - Table sorting </a><br /><a href="http://sourceforge.net/project/showfiles.php?group_id=162528">http://sourceforge.net/project/showfiles.php?group_id=162528 - Download for STS</a><br /><br /><br /><b>HTML Links</b><br /><a href="http://www.w3.org/TR/1999/REC-html401-19991224/cover.html#minitoc">http://www.w3.org/TR/1999/REC-html401-19991224/cover.html#minitoc - HTML v4.1 DOM specs</a><br /><br /><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/WebKit_DOM/index.html#//apple_ref/doc/uid/TP40001242">http://developer.apple.com/documentation/Cocoa/Conceptual/WebKit_DOM/index.html# //apple_ref/doc/uid/TP40001242 - DOM level 2 Specs</a><br /><br /><b>DOCTYPE Links</b><br /><a href="http://alistapart.com/stories/doctype/">http://alistapart.com/stories/doctype/ - Good and informative, but note that it was written in 2002! Double check the current standards before using.</a><br /><br /><a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">http://www.w3.org/QA/2002/04/valid-dtd-list.html - A detailed listing, but does not explain each usage.</a><br /><br /><a href="http://www.w3.org/TR/html401/struct/global.html">http://www.w3.org/TR/html401/struct/global.html - Global Structure on an HTML document. Covers the DOCTYPE. Good information and a few more links.</a><br /><br /><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/doctype.asp">http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/doctype.asp - MS’s perspective on DOCTYPE and IE v6.x.</a><br /><br /><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp">http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnie60/html/cssenhancements.asp - CSS Enhancements for IE v6.x.<br /> - This is also an excellent document that identifies what some (or all) of the differences are between compatibility mode and standard-compliant mode. It should be noted that standards-compliant mode is not measured against the current W3C standards, but the preliminary suggestions.</a><br /><br /><a href="http://www.htmlhelp.com/reference/html40/html/doctype.html">http://www.htmlhelp.com/reference/html40/html/doctype.html - Has a fairly good description as to the differences between Strict, Transitional, and Frameset. The comment about Quirk mode for IE v6.x is incorrect see the table above for the correct usages of the quirks mode with IE v6.x.</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1160085579932262442006-10-05T16:48:00.000-05:002006-10-05T17:14:34.566-05:00Performance Related Issues with Safari 2.0.xThere are some obvious performance issues with Safari. <br /><br /><b>TEXTAREA used in TABLEs</b><br /><br />This is very common problem within some corporate application when trying to deal with any aspect of a table that has many TEXTAREA tags. The symptoms are a page that is very slow to load, close, update, and refresh. Assuming there is one TEXTAREA tag per table cell. Depending upon the processor power of the Mac this may occur with as few as 35 columns with 10 rows to about 30 rows before the response time starts to become unacceptable.<br /><br />These performance issues do not exist if the TEXTAREA is replaced by DIV elements and performance can be increased by a factor of about 1500% by using DIV elements instead!<br /><br />My guess as to the cause of this that TEXTAREA elements are defined in terms of “rows” and “cols”. These values do NOT directly map back to the W3C standard units of measurements and I suspect that there is a problem in the translation of rows and cols.<br /><br />It is an incorrect usage of the TEXTAREA element to used for formatting of a table cells or other parts of the HTML document. CSS should be used instead. I suspect it was just easier for some programmers to specify container size in terms of rows and columns.<br /><br /><b>Large Select Statements</b><br /><br />Safari tends to have performance issues when a single select statement may have well over a few thousand entries. An example would be the pick lists for issues such as routing comments.<br /><br />There is basically nothing that can be done for these situations except for perhaps reducing the number of entries in the list, which may not be appropriate. Businesses should be more aware of the nature of the user interface than to expect the user to literally scroll through thousands of entries in a list.<br /><br /><br /><b>Some Links</b><br /><br /><a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.7">http://www.w3.org/TR/html4/interact/forms.html#h-17.7 - TEXTAREA as defined by the HTML v4.1 standards</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1160084648428926272006-10-05T16:43:00.000-05:002006-10-05T16:44:08.440-05:00What Browser Platform Should be Used For Development?The question as to what browser platform should be used for developing a web application is a good question to ask. In the past the answer has been: What is the most popular? What will support the features? What will be around in the next 3 years? What are our developers already familiar with? <br /><br />In the past, if the development was to be kept simple only one browser would be chosen for the target audience. That has been IE in most circumstances. <br /><br />With today’s emphasis on standards, the answer may not be a specific browser, but more so a given standard. With the current market shares being held by IE at 84.7%, Firefox at 10.05%, and Safari at 3.19% is a total of 97.94%. Assume that most IE users will upgrade to v7.x within the first year of release, and you have a profound percent of the population using a W3C standard compliant browser! So the answer is not what browser you should develop for, but instead what standard.<br /><br />The second question is, to what browser’s implementation of the standard should you develop for? Why? Because not all browsers will be able to implement 100% of the standard at the same time. Once again, the answer should not be a specific browser as the target, but instead, what features of the standards are supported by the most browsers should be the question. <br /><br />The goal is to make your application more compliant with what the masses are using. The best way to achieve that is though generalization of what browsers have currently implemented. I am sure that when IE v7.x starts to hit the market you will be able to find more resources comparing the low level components of the standards to all browsers. It should be easier to find out what has been well implemented and what may be best to avoid.<br /><br />This philosophy may make the most sense with new development. It may be difficult to provide an incremental set of changes to an existing application to comply with the new standard, especially if the support of these new standards are being turned on through the DOCTYPE, which is an all or nothing situation in the use of the new standards.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1158342064685794592006-09-15T12:40:00.000-05:002006-09-15T12:54:47.813-05:00Macs Cursor KeysOne thing that can cause some issues when using Safari is that the Mac keyboard (OS) generates different key values for the cursor keys. Most applications that monitor key strokes will tend to discard any key value that is above 128, so for the Mac, the cursor related keys get ignored or worse yet, generates error messages indicating an invalid key was entered.<br /><br />The following are Mac Key Codes values for Cursor related keys:<br /><table> <tr><td align=center><b>Key</b></td> <td><b>Code</b></td> </tr> <tr> <td>Up Arrow</td> <td>63232</td> </tr> <tr> <td>Down Arrow</td> <td>63233</td> </tr> <tr> <td>Left Arrow</td> <td>63234</td> </tr> <tr> <td>Right Arrow</td> <td>63235</td> </tr> <tr> <td>DEL (fn-delete)</td> <td>63272</td> </tr> <tr> <td>Home (fn-LeftArrow)</td> <td>63273</td> </tr> <tr> <td>End of Line (fn-RightArrow)</td> <td>63275</td> </tr> <tr> <td>Page Up (fn-UpArrow)</td> <td>63276</td> </tr><br /> <tr> <td>Page Down (fn-DownArrow)</td> <td>63277</td> </tr></table><br /><br />Please note that when these same keys are tested on IE v6.0.2900 for XP Pro, they did not generate any events within the JavaScript's window.event! They must be treated like silent modifiers. I would have thought that at least the DEL key or the BACKSPACE key would have a key code value being trapped. <br /><p><br />One odd key is the ESC on the PC. It produces a code value of 27 and clears the text area. I don't know if that is expected or always a desired behavior.Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1154093806711788392006-07-28T08:36:00.000-05:002006-07-28T08:42:28.716-05:00JavaScript Random Character GeneratorThis is about the generation of random characters. This is just a quick little generator that I put together so I could populate a dynamic table with specific kinds of data for different columns.<br /><br />This generator is included in another blog post, see the references below for more information on how I dynamically created that table.<br /><br /><b>Purpose</b><br /><br />The purpose for this generator is to create different types of test data of different lengths. It could be modified or enhanced to fit almost any need.<br /><br /><b>The Character Types</b><br /><br />I have kept the character types simple. There are numeric, upper and lower cased characters, and a couple mixes of these three types. No punctuation or spaces are generated. I was only need single word entities and as such, the need for spaces was not important. <br /><br />If spaces are important, then new character types could be added that would generate sentence or paragraph styled blocks of random characters with spaces randomly places such that the average word size would be about 5 or 6 characters in length. Matter of fact, the punctuation that could be used could also be integrated such that different statistical benchmarking could influence which punctuation is used and where.<br /><br /><b>The Arrays</b><br /><br />I want to discuss the purpose of the Arrays so they make a little more sense. The code is documented but if one is not going to use this as I did, then the Arrays may not mean much.<br /><br />First off, where this was used was within a dynamically created table. The size could be as large as the user wants, or as small as one cell. <br /><br />The issue I had, was with how to identify a consistency among the columns as far as what character types they would be and a little more consistency on their length too. The reason for this, was that I was wanting to have a table that would mimic more or less, a spreadsheet worth of data. This means that a column that has numbers, should not have any characters in it, same with a column that may represent a name, it should not have numbers interspersed on some rows. <br /><br />Enter the <b>colCharType</b> and <b>colMaxSize</b> Arrays. Using these two Arrays, I can now ensure a character type uniformity that I would not be able to achieve otherwise. I will also be able to prevent wild ranges of sizes from occurring by specifying a maximum size for the number of characters. So the columns will be a bit more uniform in their appearance.<br /><br />One enhancement would be to add a third Array call <b>colMinSize</b> which will set the minimum bounds. The reason why this would be helpful is that if you have a maximum size of 18 on a column you will still get a few rows that will contain nothing or just a few characters. So for our maximum size of 18, we may want to set a minimum size of 12. That will really help keep the columns a bit more uniformed looking and would be a great improvement.<br /><br />If you have noticed, I have only defined 12 elements in both Arrays. Didn't I say that the user could enter as many columns as they like? Of course I did. I am able to get around this limitation by the use of the modulus operator in JavaScript. It is extremely useful for conditions such as these. It is used within the functions <b>getColCharType()</b> and <b>getColMaxSize()</b> where the parameter is the column number. Column 12 uses the 12th element of the Arrays and column 13 uses the first! So there will be a consistent pattern that will repeat every 12 columns.<br /><br /><b>The Source Code</b><br /><br />I have documented the source code so it should answer most of your questions and explain what is going on. If you have any questions, please let me know.<br /><br /><font size="-2"><br /><div style="border: 2px solid #00ff00;width:500px;height:400px;overflow: scroll;"><br /><pre><code><br /><script type='text/javascript'><br /><br />/* Random Character Generator - Copyright 2006 by Scott Tabar - tabarATfuseDOTnet<br /> *<br /> * All of these functions were created from scratch, except where noted. <br /> * I grant you the right to do what ever you wish with these. <br /> * All I ask is that you give me credit for what I have created. If these scripts<br /> * will be used in a product that will make you or an entity money in any shape or<br /> * form, I just want to let you know that I don't expect a single penny of it. I<br /> * would be honored if you will drop me a line to let me know what product it was <br /> * used in with a reference to company name, URL, ISBN, etc. <br /> *<br /> * The initial purpose for the random character generators was<br /> * to allow random text to be generated within table cells to test sorting <br /> * performance on an arbitrary table size that could be dynamically changed without<br /> * reloading the page. Functions and arrays have been created to be able <br /> * to provide a reproducible data type for a given column so there will be consistency<br /> * when a column is sorted.<br /> */<br /><br />/* These character types are used to define what kind of random data should<br /> * be generated for a given cell. <br /> */<br />var CHAR_TYPE_NUMERIC = 1;<br />var CHAR_TYPE_CHAR = 2;<br />var CHAR_TYPE_CHAR_UPPER = 3;<br />var CHAR_TYPE_CHAR_LOWER = 4;<br />var CHAR_TYPE_MIXED = 5;<br /><br />/* This array defines what data type should be generated for the given column <br /> */<br />var colCharType = new Array(<br /> CHAR_TYPE_MIXED, CHAR_TYPE_MIXED, CHAR_TYPE_MIXED, <br /> CHAR_TYPE_CHAR_LOWER, CHAR_TYPE_CHAR_UPPER, CHAR_TYPE_CHAR, <br /> CHAR_TYPE_CHAR, CHAR_TYPE_CHAR, CHAR_TYPE_NUMERIC, <br /> CHAR_TYPE_NUMERIC, CHAR_TYPE_NUMERIC, CHAR_TYPE_NUMERIC);<br /><br />/* This array defines the max number of characters that should be generated for<br /> * the given column. With a value of 10, the column will then have from none<br /> * to 10 characters generated.<br /> */<br />var colMaxSize = new Array( 10, 4, 4, 10, 1, 2, 18, 8, 4, 10, 10, 2 );<br /><br /><br />/* This function takes any integer number as a parameter and maps <br /> * it to the set in the colCharType array by returning the appropriate<br /> * value from that array as if the array repeats infinitely.<br /> *<br /> * This function uses the modulus function to remap the integer parameter<br /> * to a usable value.<br /> */<br />function getColCharType( x )<br />{<br /> return colCharType[ x % colCharType.length ];<br />}<br /><br /><br />/* This function takes any integer number as a parameter and maps <br /> * it to the set in the colMaxSize array by returning the appropriate<br /> * value from that array as if the array repeats infinitely.<br /> *<br /> * This function uses the modulus function to remap the integer parameter<br /> * to a usable value.<br /> */<br />function getColMaxSize( x )<br />{<br /> return colMaxSize[ x % colMaxSize.length ];<br />}<br /><br />/* This function actually performs all of the generation of random data based upon<br /> * the two parameters charType and length. Length defines the maximum length, not<br /> * a fixed length such that if the value is 10, then result could have a length of<br /> * zero or anything up to a length of 10 characters.<br /> *<br /> * Currently, no character type generates punctuation or white spaces. It is<br /> * intended to generate simple single "word" entities. <br /> */<br />function rndText( charType, length )<br />{<br /> var result = "";<br /><br /> for( var x = 0; x < length; x++ )<br /> {<br /> var cType = charType;<br /><br /> if ( cType == CHAR_TYPE_MIXED ) {<br /> cType = (Math.round(Math.random() * 3) + 1);<br /> } <br /> if ( cType == CHAR_TYPE_CHAR ) {<br /> cType = (Math.round(Math.random() * 1) + 3);<br /> } <br /><br /> if ( cType == CHAR_TYPE_NUMERIC ) {<br /> result += createRandomNumbers();<br /> } else<br /> if ( cType == CHAR_TYPE_CHAR_UPPER ) {<br /> result += createRandomUpperCaseLetter();<br /> } else<br /> if ( cType == CHAR_TYPE_CHAR_LOWER ) {<br /> result += createRandomLowerCaseLetter();<br /> } <br /> }<br /> return result;<br />}<br /><br />/* Returns a random number between zero and the numeric value of the parameter.<br /> */<br />function rndNumMax( maxNum )<br />{<br /> return Math.round(Math.random() * maxNum);<br />}<br /><br />/* Returns one character that is randomly selected between 0 and 9.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomNumbers()<br />{<br /> return String.fromCharCode(48 + Math.round(Math.random() * 9));<br />}<br /><br />/* Returns one character that is randomly selected between a and z.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomLowerCaseLetter()<br />{<br /> return String.fromCharCode(97 + Math.round(Math.random() * 25));<br />}<br /><br />/* Returns one character that is randomly selected between a and Z.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomUpperCaseLetter()<br />{<br /> return String.fromCharCode(65 + Math.round(Math.random() * 25));<br />}<br /><br /></script><br /><br /></code></pre><br /></div></font><br /><br /><b>References</b><br /><br /><a href="http://scott-tabar-safari.blogspot.com/2006/07/safari-table-sorting-performance-issue.html">Dynamic Table Generation - Where this rnd char generation is at work!</a><br /><br /><a href="http://www.codehouse.com/javascript/tips/random_letter/">Creating random characters</a>Scott Tabarhttp://www.blogger.com/profile/11656955965154510224noreply@blogger.comtag:blogger.com,1999:blog-30441114.post-1154023073550289082006-07-27T12:44:00.000-05:002006-07-27T14:30:14.860-05:00Safari Table Sorting Performance IssueThis document will provide simple steps to have a dynamic table generator run in your browser. You can use this to generate large tables of various sizes to see how different browsers perform when sorting tables.<br /><br />Unfortunately, this blog does not allow the use of scripts, so enclosed in the following text box is all the code for one web page. A few steps to take now for hours of enjoyment. <b>Yes, I know, I need to get a server to post these simple test pages to! </b><br /><br /> 1. Select everything in the box and then copy it to the clipboard. May be tricky... sorry... Try selecting a few rows at the top, then scroll to the bottom, then with the SHIFT key being held down, click the mouse below the final line which contains <&/html>><br /> 2. Open a text editor and paste it in a new document. <br /> 3. Save that document with any name, such as SafariDynamicTable.html. <br /> 4. Next follow the link below to download the Standardista Table Sort code and save the enclosed folder in the same directory.<br /> 5. Open the saved HTML document, such as SafariDynamicTable.html in the browser of your choice.<br /><br /><font size="-2"><br /><div style="border: 2px solid #00ff00;width:500px;height:400px;overflow: scroll;"><br /><pre><code><br /><html><br /> <head><br /><br /><title>Safari Table Sorting - Performance Issues</title><br /><br /><script type='text/javascript'><br /><br />/* Random Character Generator - Copyright 2006 by Scott Tabar - tabarATfuseDOTnet<br /> *<br /> * All of these functions were created from scratch, except where noted. <br /> * I grant you the right to do what ever you wish with these. <br /> * All I ask is that you give me credit for what I have created. If these scripts<br /> * will be used in a product that will make you or an entity money in any shape or<br /> * form, I just want to let you know that I don't expect a single penny of it. I<br /> * would be honored if you will drop me a line to let me know what product it was <br /> * used in with a reference to company name, URL, ISBN, etc. <br /> *<br /> * The initial purpose for the random character generators was<br /> * to allow random text to be generated within table cells to test sorting <br /> * performance on an arbitrary table size that could be dynamically changed without<br /> * reloading the page. Functions and arrays have been created to be able <br /> * to provide a reproducible data type for a given column so there will be consistency<br /> * when a column is sorted.<br /> */<br /><br />/* These character types are used to define what kind of random data should<br /> * be generated for a given cell. <br /> */<br />var CHAR_TYPE_NUMERIC = 1;<br />var CHAR_TYPE_CHAR = 2;<br />var CHAR_TYPE_CHAR_UPPER = 3;<br />var CHAR_TYPE_CHAR_LOWER = 4;<br />var CHAR_TYPE_MIXED = 5;<br /><br />/* This array defines what data type should be generated for the given column <br /> */<br />var colCharType = new Array(<br /> CHAR_TYPE_MIXED, CHAR_TYPE_MIXED, CHAR_TYPE_MIXED, CHAR_TYPE_CHAR_LOWER, CHAR_TYPE_CHAR_UPPER, CHAR_TYPE_CHAR, <br /> CHAR_TYPE_CHAR, CHAR_TYPE_CHAR, CHAR_TYPE_NUMERIC, CHAR_TYPE_NUMERIC, CHAR_TYPE_NUMERIC, CHAR_TYPE_NUMERIC);<br /><br />/* This array defines the max number of characters that should be generated for<br /> * the given column. With a value of 10, the column will then have from none<br /> * to 10 characters generated.<br /> */<br />var colMaxSize = new Array( 10, 4, 4, 10, 1, 2, 18, 8, 4, 10, 10, 2 );<br /><br /><br />/* This function takes any integer number as a parameter and maps <br /> * it to the set in the colCharType array by returning the appropriate<br /> * value from that array as if the array repeats infinitely.<br /> *<br /> * This function uses the modulus function to remap the integer parameter<br /> * to a usable value.<br /> */<br />function getColCharType( x )<br />{<br /> return colCharType[ x % colCharType.length ];<br />}<br /><br /><br />/* This function takes any integer number as a parameter and maps <br /> * it to the set in the colMaxSize array by returning the appropriate<br /> * value from that array as if the array repeats infinitely.<br /> *<br /> * This function uses the modulus function to remap the integer parameter<br /> * to a usable value.<br /> */<br />function getColMaxSize( x )<br />{<br /> return colMaxSize[ x % colMaxSize.length ];<br />}<br /><br />/* This function actually performs all of the generation of random data based upon<br /> * the two parameters charType and length. Length defines the maximum length, not<br /> * a fixed length such that if the value is 10, then result could have a length of<br /> * zero or anything up to a length of 10 characters.<br /> *<br /> * Currently, no character type generates punctuation or white spaces. It is<br /> * intended to generate simple single "word" entities. <br /> */<br />function rndText( charType, length )<br />{<br /> var result = "";<br /><br /> for( var x = 0; x < length; x++ )<br /> {<br /> var cType = charType;<br /><br /> if ( cType == CHAR_TYPE_MIXED ) {<br /> cType = (Math.round(Math.random() * 3) + 1);<br /> } <br /> if ( cType == CHAR_TYPE_CHAR ) {<br /> cType = (Math.round(Math.random() * 1) + 3);<br /> } <br /><br /> if ( cType == CHAR_TYPE_NUMERIC ) {<br /> result += createRandomNumbers();<br /> } else<br /> if ( cType == CHAR_TYPE_CHAR_UPPER ) {<br /> result += createRandomUpperCaseLetter();<br /> } else<br /> if ( cType == CHAR_TYPE_CHAR_LOWER ) {<br /> result += createRandomLowerCaseLetter();<br /> } <br /> }<br /> return result;<br />}<br /><br />/* Returns a random number between zero and the numeric value of the parameter.<br /> */<br />function rndNumMax( maxNum )<br />{<br /> return Math.round(Math.random() * maxNum);<br />}<br /><br />/* Returns one character that is randomly selected between 0 and 9.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomNumbers()<br />{<br /> return String.fromCharCode(48 + Math.round(Math.random() * 9));<br />}<br /><br />/* Returns one character that is randomly selected between a and z.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomLowerCaseLetter()<br />{<br /> return String.fromCharCode(97 + Math.round(Math.random() * 25));<br />}<br /><br />/* Returns one character that is randomly selected between a and Z.<br /> * <br /> * Thanks to wwww.CodeHouse.com for the following inspiration:<br /> * http://www.codehouse.com/javascript/tips/random_letter/<br /> */<br />function createRandomUpperCaseLetter()<br />{<br /> return String.fromCharCode(65 + Math.round(Math.random() * 25));<br />}<br /><br /></script><br /><br /><br /><br /><script type='text/javascript'><br /><br />/* Dynamic Table Generator - Copyright 2006 by Scott Tabar - tabarATfuseDOTnet<br /> *<br /> * All of these functions were created from scratch, except where noted. <br /> * I grant you the right to do what ever you wish with these. <br /> * All I ask is that you give me credit for what I have created. If these scripts<br /> * will be used in a product that will make you or an entity money in any shape or<br /> * form, I just want to let you know that I don't expect a single penny of it. I<br /> * would be honored if you will drop me a line to let me know what product it was <br /> * used in with a reference to company name, URL, ISBN, etc. <br /> *<br /> * The initial purpose for the random character generators was<br /> * to allow random text to be generated within table cells to test sorting <br /> * performance on an arbitrary table size that could be dynamically changed without<br /> * reloading the page. Functions and arrays have been created to be able <br /> * to provide a reproducible data type for a given column so there will be consistency<br /> * when a column is sorted.<br /> */<br /><br /><br />function buildTable()<br />{<br /> var rows = document.getElementById( "rows" ).value;<br /> var cols = document.getElementById( "cols" ).value;<br /> var useTextareas = document.getElementById( "useTextarea" ).checked;<br /><br /> buildTable2( rows, cols, useTextareas );<br />} <br /><br />/* This function will build a table based upon the given parameters for the number<br /> * of columns and rows. It will fill in each cell with randomly generated data <br /> * based which the data type and max length of the data will be defined by the <br /> * column position. <br /> *<br /> * There is a third parameter useTextareas which will enclose the random data <br /> * if it is desired to be used. The purpose of the use of the TEXTAREA tag is <br /> * to get a feel for sorting performance when the table cell contains more than <br /> * just plain text. Matter of fact, try generating a table with the dimensions<br /> * of 50 x 100 first without TEXTAREA and then with. Observe how much slower<br /> * the sorting can be.<br /> *<br /> */<br />function buildTable2( maxRows, maxCols, useTextareas )<br />{<br /><br /> // Build Header<br /> var thr = document.getElementById( "tableHeaderRow" );<br /> for( var x = 0; x < maxCols; x++ )<br /> {<br /> var cell = document.createElement("th");<br /> cell.innerHTML = "Col " + (x + 1);<br /> thr.appendChild(cell);<br /> }<br /><br /><br /> // Build body<br /> var tb = document.getElementById( "tableBody" );<br /><br /> for( var y = 0; y < maxRows; y++ )<br /> {<br /> var row = document.createElement("tr");<br /><br /><br /> for( var x = 0; x < maxCols; x++ )<br /> {<br /> var cell = document.createElement("td");<br /><br /> if ( useTextareas ) <br /> {<br /> var textArea = document.createElement("textarea");<br /> <br /> textArea.rows = 2;<br /> textArea.cols = 6;<br /> textArea.innerHTML = rndText( getColCharType(x), rndNumMax( getColMaxSize(x) ) );<br /><br /> cell.appendChild( textArea );<br /> } else {<br /> cell.innerHTML = rndText( getColCharType(x), rndNumMax( getColMaxSize(x) ) );<br /> }<br /><br /> row.appendChild(cell);<br /> }<br /><br /> tb.appendChild(row);<br /> }<br /><br /><br />}<br /><br />/* This function removes the headers from the table and also the body. It prepares the<br /> * table to be regenerated.<br /> */ <br />function clearTable()<br />{<br /> // clear Header<br /> var thr = document.getElementById( "tableHeaderRow" );<br /> while ( thr.hasChildNodes() ) {<br /> thr.removeChild( thr.lastChild );<br /> }<br /><br /> // Clear body<br /> var tb = document.getElementById( "tableBody" );<br /> while ( tb.hasChildNodes() ) {<br /> tb.removeChild( tb.lastChild );<br /> }<br />}<br /><br />/* This function rebuilds the actual table. It assembles all of the parameters and<br /> * calls all functions in the proper order.<br /> * <br /> * This function logs performance status to the screen so the user will know how long<br /> * it takes to clear a table or to build a table. It also logs the characteristics of<br /> * each table when it regenerates it.<br /> *<br /> * Finally at the end, it makes a call to the Standardist Table Sorting init funtion<br /> * to have the regenerated table re-enabled for the auto sorting. It should be noted <br /> * that the STS function named headingClicked has been slightly modified to record <br /> * performance information to the on-screen log. The first line of the function has<br /> * the following added:<br /> * var date1 = new Date();<br /> * and the very last few lines have the following added right before the "return false;":<br /> * var date2 = new Date();<br /> * var debug = document.getElementById( "debug" ).innerHTML;<br /> * debug += "Time to sort table " + (date2 - date1) + " ms.<br>";<br /> * document.getElementById( "debug" ).innerHTML = debug;<br /> *<br /> */<br />function rebuildTable()<br />{<br /><br /> var date1 = new Date();<br /> clearTable();<br /> var date2 = new Date();<br /> <br /> var date3 = new Date();<br /> buildTable();<br /> var date4 = new Date();<br /><br /> var rows = document.getElementById( "rows" ).value;<br /> var cols = document.getElementById( "cols" ).value;<br /> var useTextareas = document.getElementById( "useTextarea" ).checked;<br /><br /> var debug = document.getElementById( "debug" ).innerHTML;<br /><br /> debug += "Time to clear old table " + (date2 - date1) + " ms. ";<br /> debug += "Time to build new table " + (date4 - date3) + " ms: " + <br /> rows + " rows x " + cols + " cols with" + <br /> (useTextareas ? "" : "out") + " TEXTAREAs. <br>";<br /><br /> document.getElementById( "debug" ).innerHTML = debug;<br /> <br /> // Calls the Stanardista Table Sorting init function to re-enable the regenerated table.<br /> standardistaTableSortingInit();<br /><br /> return false;<br />}<br /><br /><br />/* Calls buildTable() function on page load.<br /> */<br />window.onload = function() { buildTable(); };<br /></script><br /><br /><br /> </head><br /> <body><br /><br /><H1>Safari Table Sorting - Performance Issues</H1><br /><br /><p><br />This test dynamically builds a table and allows you to dynamically alter the table size at any time. It uses randomly generated data to fill the table cells, of which all cells contain a TEXTAREA element to add to the complexity level of the sorting. <br /><br /><p><br />This table uses a non-intrusive table sorting JavaScript function. It is called Standardista Table Sorting by Neil Crosby. See the link under references. What makes this so nice, is that it goes out on it's own and finds all the tables that are in need of being setup for sorting and then it puts the hooks in to each column heading. It is very easy to setup and it runs very quickly on small trivial tables. I used this source code to reconfirm that the sorting is being performed correctly and that nothing odd is going on. I did find out that a replaceChild() would remove a node before it adds it to the end if that node already exists in the parent. This means that more code can be eliminated due to not having to track and manually remove any obsolete or duplicated nodes. ie... performance gain!<br /><br /><p><br />Sadly though, performance does suck when the quantity of data approaches what is typical for UGS. That is 37 columns and about 100+ rows. Of which it takes about 209 seconds! 100 rows with 50 columns takes AlMOST 500 seconds to sort when using TEXTAREA!<br /><br /><p><br />To use this, when it initially loads, it will build a 8 rows x 37 columns table and you can dynamically change the table size at any time. It includes wrapping all generated text with a TEXTAREA tag initially. Transaction information will be logged to the screen and will not be lost during resizing of the table. If the table parameters are changed and the Rebuild Table button is CLICKED, it will regenerate the whole table dynamically without performing a page reload.<br /><br /><br><br><br /><b>Runtime Log:</b><br /><div id="debug">Initial table is 8 rows x 37 cols.<br> </div><br /><br /><br /><br /><br /><br /><table><br /> <tr><br /> <td>Rows:</td><td><input type=text size="10" id="rows" value="8" /></td><br /> <td>Cols:</td><td><input type=text size="10" id="cols" value="37" /></td><br /> <td>Use TEXTAREAs?:</td><td><input type=checkbox id="useTextarea" value="TEXTAREA" checked /></td><br /> <td><input type=button value="Rebuild Table" onClick="rebuildTable();" /></td><br /> </tr><br /></table><br /><br /><br /><script type='text/javascript' src='standardista_table_sorting/common.js'></script><br /><script type='text/javascript' src='standardista_table_sorting/css.js'></script><br /><script type='text/javascript' src='standardista_table_sorting/standardista-table-sorting.js'></script><br /><br /><br /><table class="sortable" cellspacing=0 cellpadding=1 border=1><br /> <col width="200px"></col><br /> <colgroup width="200px"></colgroup><br /><thead><br /> <tr id="tableHeaderRow"><br /> </tr><br /></thead><br /><tfoot><br /> <tr><br /> <td colspan="8" align="right"><b>Dummy Totals:</b></td><br /> <td><b>2388</b></td><br /> <td><b>482 Days</b></td><br /> <td><b>293,398,283.93</b></td><br /> </tr><br /></tfoot><br /><tbody id="tableBody"></tbody><br /></table><br /><br /><br /><br /><b>References</b><br /><br /><br /><a href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting">Table Sorting with Safari support - Standardista Table Sorting</a> <br /><br /><a href="http://sourceforge.net/project/showfiles.php?group_id=162528">Download Standardista Table Sorting from SourceForge.net</a><br /><br /><br /><a href="http://www.codehouse.com/javascript/tips/random_letter/">Creating random characters</a> <br /><br /><br /> </body><br /></html><br /><br /></code></pre><br /></div><br /></font><br /><br /><br /><b>What Is So Dynamic About This Table?</b><br /><br />The table that is generated can be regenerated on the fly without having to reload the page. It logs all transactions: clearing the table, building the table, and sorting the table. It is good to see what happens under different conditions such as table size (large number of rows vs columns or vice-a-versa) and plain text versus text enclosed in an HTML tag (TEXTAREA is used in this test, but it can be any tag like Anchor or DIV).<br /><br />You have control of the table size. Change the value and regenerate the table. Go ahead, it is fun to see how large you can make it and what your browser does with it. If you make it too large and you do perform a sort, it may lockup your browser for quite a while until the JavaScript is done. WARNING: There is no way to terminate it except for killing the browser! So be fore warned!<br /><br />The table sort algorithm is all dynamic. Which means as you regenerate the table, the table will automatically be prepared for being sortable on any number of columns. The only catch is that the TABLE has the class="sortable" and the table must contain a TBODY element. See the link below for additional information on the Standardista Table Sort code by Neil Crosby.<br /><br /><br /><b> Adding Performance Logging in STS!</b><br /><br />Why would you want to? Good question! Because it will record how long it took to perform each sort. So when you resize the table, you will still be able to see the prior results.<br /><br />How? Follow these simple directions...<br />1) Modify the file named standardista_table_sorting/standardista-table-sorting.js. Change the function named headingClicked with the two following modifications:<br /> a) To the first line of the function add:<br /> <pre><code> var date1 = new Date(); </code></pre><br /> b) To the very last few lines right before the "return false;":<br /> <pre><code> var date2 = new Date();<br /> var debug = document.getElementById( "debug" ).innerHTML;<br /> debug += "Time to sort table " + (date2 - date1) + " ms.<br>";<br /> document.getElementById( "debug" ).innerHTML = debug;<br /></code></pre><br />2) Save the changes and reload the test page.<br /><br />Now every time a sort is performed, it will be logged on the screen.<br /><br /><br /><b>How to Use</b><br /><br />First try to sort any column. Notice how an arrow indicates what column it is sorted by and in what direction. Try a few other columns. Note the log entries that are being added at the top of the page.<br /><br />Go ahead and change the number of rows and columns and click on the Rebuild Table button, but for this time make the table smaller than it defaults to. You can have all the auto generated text be placed inside TEXTAREA tags, which will illustrate how bogged down JavaScript can become when table cells contain more than just simple plain text. <br /><br />Now make the table 100 rows and 50 columns without the TEXTAREA. Rebuild the table. Try a few sorts. Then click the check box to enable the TEXTAREA tags and then rebuild the table. Click on one column and wait. Be prepared to wait for awhile. It is running and it will end, but give it about 500 seconds! Of course it depends upon your CPU and system platform, but you will notice that when TEXTAREA tags are used, it grinds to a halt!<br /><br /><br /><b>One Bug in STS!</b><br /><br />Please note that I have found both a bug and a fix for the same bug. I have submitted a bug report on SourceForge.net and I am sure Neil or one of his friends will apply the bug fix as soon as they are able.<br /><br />The nature of this bug is due to the unusual way I am using STS. Unusual in the fact that the STS init function is actually called more than once. As such, there is a slight glitch that occurs.<br /><br />This glitch is that the number of rows in the table will be doubled.<br /><br />How to reproduce this? Easy, click on any column, say column 5. Regenerate the table. No you don't have to change any settings. Then click on the same column to sort the newly generated table. The results, the rows are doubled.<br /><br />As an exercise you can figure out what is causing it. Hint: Has to do with the behavior of appendChild(), but not directly.<br /><br /><br />