tag:blogger.com,1999:blog-64274219746903779542024-03-14T05:48:00.301-04:00Shade Grown CodeDiscoveries and thoughts about code.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-6427421974690377954.post-26856869513782184222012-05-09T15:30:00.000-04:002012-05-09T15:31:51.752-04:00Converting XML Schema to Relax NGNeeded to convert W3 XML Schema for web.xml files to Relax NG so that I can edit those files in emacs with XML element expansion and syntax highlighting provided by <a href="http://www.thaiopensource.com/nxml-mode/">nxml</a> mode. I found a lot of references on the Internet for Sun's XSD to RNG converter. However, most links pointing to Sun website were broken. Finally, I found that RNG converter is a part of the <a href="http://msv.dev.java.net/">Kohsuke Kawaguchi's MS</a><a href="http://msv.dev.java.net/">V</a> project. After installing rngconv.zip, I downloaded web-app_2_4.xsd, j2ee_1_4.xsd, jsp_2_0.xsd from <a href="http://java.sun.com/xml/ns/j2ee/">Sun's XML Schemas for </a><a href="http://java.sun.com/xml/ns/j2ee/">J2EE</a><a href="http://java.sun.com/xml/ns/j2ee/"></a> and converted the first one for use with nxml.<br />
<br />
One little quirk was to add in the RNC schema a definition for xsi:schemaLocation attribute to the definition of element web-app<br />
<blockquote>
</blockquote>
<blockquote style="font-family: courier new;">
namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"<br />
element web-app {<br />
attribute xsi:schemaLocation { "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" },<br />
...</blockquote>
2012 update: Since Oracle bought Sun, the MSV RNG Convertor is even harder to find. I found the download
link at <a href="http://java.net/downloads/msv/nightly/rngconv.20060319.zip">nightly rngconv.20060319.zip</a>.
Also, in j2ee_1_4.xsd, you will need to uncomment the following statement:
<br />
<blockquote style="font-family: courier new;">
xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemalocation="http://www.w3.org/2001/xml.xsd"
</blockquote>
Download the result from Google Docs: <a href="http://n.sushk.in/JgeZuY">web-app_2_4.rnc</a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com1tag:blogger.com,1999:blog-6427421974690377954.post-58032936130427592892012-05-01T13:26:00.002-04:002012-05-01T13:32:30.596-04:00Undo Google Chrome "never translate a page" settingIn Google Chrome Translate Bar, I accidentally configured the browser to never translate a foreign site I was browsing. I wanted to undo the setting, but apparently there is no UI to undo. Neither there is a UI to edit the list of sites blacklisted from translating. I had to find Google Chrome Preferences file, which in Linux is ~/.config/google-chrome/Default/Preferences. The Preferences file is apparently in JSON format. Somewhere near the bottom of the file, I found these two lines:
<blockquote>
"translate_language_blacklist": [ "ru" ],<br/>
"translate_site_blacklist": [ "www.lemonde.fr" ],
</blockquote>
The "translate_language_blacklist" apparently lists all languages you configured never to translate. The "translate_site_blacklist" lists all the sites you never wanted to be translated. Just delete the whole line or just the site you want to be removed from the list.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-27201452343361718922011-02-04T13:50:00.003-05:002011-02-04T14:45:18.816-05:00As a follow up to <a href="http://remcojansen.posterous.com/2009/11/how-to-send-tomcats-access-log-to.html">Remco's How to set up Tomcat logging to Syslog</a>, I am including my own version of a class that enables Tomcat logging to Syslog. This class overrides the standard AccessLogValve and logs messages via Log4J API to category <span style="font-family: courier new;">accesslog</span>, level <span style="font-family: courier new;">INFO</span>.<br /><br />To compile this class, you will need catalina.jar and servlet-api.jar in your CLASSPATH.<br /><br />To configure Tomcat to use this class, edit your conf/server.xml and replace className in the access logging Valve with com.ofc.tomcat.Log4JAccessLogValve. Then, in lib/log4j.properties, configure appenders for category <span style="font-family: courier new;">accesslog</span> (property <span style="font-family: courier new;">log4j.logger.accesslog</span>)<br /><pre class="netbeans"><br /><span class="keyword-directive">package</span> com.ofc.tomcat;<br /><br /><span class="comment">/**</span><br /><span class="comment"> * </span><span class="comment">Redirects</span> <span class="comment">AccessLogValve</span> <span class="comment">logging</span> <span class="comment">to</span> <span class="comment">Log4J</span> <span class="comment">category</span><span class="comment"> "</span><span class="comment">accesslog</span><span class="comment">" </span><span class="comment">level</span> <span class="comment">info</span><br /><span class="comment"> * </span><br /><span class="comment"> * </span><span class="ST0">@author</span> <span class="comment">Nicholas</span> <span class="comment">Sushkin</span><br /><span class="comment"> * </span><span class="ST0">@version</span> <span class="comment">$Revision</span><span class="comment">: 1</span><span class="comment">.</span><span class="comment">2 </span><span class="comment">$</span> <span class="comment">$Date</span><span class="comment">: 2011/02/04 18:45:36 </span><span class="comment">$</span><br /> <span class="comment">*/</span><br /><span class="keyword-directive">public</span> <span class="keyword-directive">class</span> Log4JAccessLogValve <span class="keyword-directive">extends</span> org.apache.catalina.valves.AccessLogValve<br />{<br /> <span class="comment">/**</span><br /><span class="comment"> * </span><span class="comment">The</span> <span class="comment">descriptive</span> <span class="comment">information</span> <span class="comment">about</span> <span class="comment">this</span> <span class="comment">implementation</span><span class="comment">.</span><br /> <span class="comment">*/</span><br /> <span class="keyword-directive">protected</span> <span class="keyword-directive">static</span> <span class="keyword-directive">final</span> String info1 =<br /> <span class="character">"</span><span class="character">com.ofc.tomcat.Log4JAccessLogValve/1.0</span><span class="character">"</span>;<br /><br /> <span class="keyword-directive">private</span> <span class="keyword-directive">static</span> <span class="keyword-directive">final</span> org.apache.log4j.Logger log = <br /> org.apache.log4j.LogManager.getLogger(<span class="character">"</span><span class="character">accesslog</span><span class="character">"</span>);<br /><br /> @Override<br /> <span class="keyword-directive">public</span> <span class="keyword-directive">void</span> log(String message)<br /> {<br /> log.info(message);<br /> }<br /><br /> @Override<br /> <span class="keyword-directive">public</span> String getInfo()<br /> {<br /> <span class="keyword-directive">return</span> info1;<br /> }<br /><br /> @Override<br /> <span class="keyword-directive">protected</span> <span class="keyword-directive">void</span> open()<br /> {<br /> }<br />}<br /></pre>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com1tag:blogger.com,1999:blog-6427421974690377954.post-85819062463268640502010-03-21T22:35:00.009-04:002010-03-21T22:59:57.471-04:00Troubleshooting tftp-proxy in OpenBSD pfFinally figured out OpenBSD firewall configuration in which internal hosts can access TFTP servers on the internet. In OpenBSD pf firewall, you need to configure tftp-proxy. Google search returns a lot of complaints about tftp-proxy not working and not a single success story. I now believe there is a typo in the official manual.<br /><br />The <a href="http://www.openbsd.org/faq/pf/ftp.html#tftp-proxy">OpenBSD FAQ for TFTP proxy</a> specifies the following redirect rule to redirect outgoing tftp connections to the internal tftp-proxy.<br /><blockquote style="font-family:courier new;"><span style="font-size:85%;">rdr pass log on $int_if proto udp from <span style="font-weight: bold;">$int_if</span> to port tftp -> 127.0.0.1 port 6969</span></blockquote>However, according to "<span style="font-size:85%;"><span style="font-family:courier new;">pfctl -g -s nat|grep tftp</span></span>", my pf expands the rule above to the following.<br /><blockquote><span style=";font-family:courier new;font-size:85%;" >rdr pass log on xl0 inet proto udp from <span style="font-weight: bold;">192.168.2.1</span> to any port = tftp -> 127.0.0.1 port 6969</span><br /></blockquote>It's clear that the expanded rule will will not redirect traffic coming from all of the internal hosts. The rule needs to be changed to<br /><blockquote style="font-family:courier new;"><span style="font-size:85%;"><span style="font-family:courier new;">rdr pass log on $int_if proto udp from <span style="font-weight: bold;">$int_net</span> to any port tftp -> 127.0.0.1 port 6969</span><br /></span></blockquote>which expands to<br /><span style="font-size:85%;"><span style="font-family:courier new;"></span></span><blockquote><span style="font-size:85%;"><span style="font-family:courier new;">rdr pass log on xl0 inet proto udp from <span style="font-weight: bold;">192.168.2.0/24</span> to any port = tftp -> 127.0.0.1 port 6969</span></span></blockquote>The latter covers the whole internal network instead of just one host 192.168.2.1.<tt><br /></tt>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-30441169483982237272010-02-25T21:10:00.003-05:002010-02-25T21:24:40.480-05:00Importing S/MIME certificate into JavaAlthough it is now possible to import a certificate in p12 format, into java, just any S/MIME certificate will not work to sign jars.<br /><br />Thawte used to give out free S/MIME certificates and when imported into Java, those certificates could sign java code. I recently tried to import a Comodo S/MIME certificate into a Java keystore and sign a jar. While I managed to export my S/MIME certificate from Firefox in .p12 format and import .p12 keystore into a Java keystore, signing with this certificate generated a warning <span style="font-family: courier new;">"The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."</span> Also, Web Start failed to validate the signed jar, generating an exception in com.sun.deploy.security.CertUtils in the following code<br /><blockquote style="font-family: courier new;"><span style="font-size:85%;"> // Require either all of bits 5,6,7 are false or<br /> // that at least bit 7 be true<br />if ((getNetscapeCertTypeBit(cert, NSCT_SSL_CA) != false ||<br /> getNetscapeCertTypeBit(cert, NSCT_S_MIME_CA) != false ||<br /> getNetscapeCertTypeBit(cert, NSCT_OBJECT_SIGNING_CA) != false) &&<br /> getNetscapeCertTypeBit(cert, NSCT_OBJECT_SIGNING_CA) == false)<br />{<br /> Trace.msgSecurityPrintln("trustdecider.check.basicconstraints.bitvalue");<br /> return false;<br />}</span></blockquote>To get my S/MIME certificate from Java, I used Firefox Certificate backup as p12, then the following command to find the alias of my certificate inside the .p12 keystore:<br /><blockquote style="font-family: courier new;"><span style="font-size:85%;">keytool -list -keystore comodo-nsushkin\@openfinance.com-exp20120930.p12 -storetype PKCS12</span></blockquote>Once I found out the alias "<span style="font-size:85%;"><span style="font-family: courier new;">nicholas sushkin's the usertrust network id #3</span></span>", I imported my S/MIME private key and certificate from p12 file into my JKS keystore under alias "<span style="font-family: courier new;">nsushkin</span>" using the following command:<br /><blockquote></blockquote><blockquote style="font-family: courier new;"><span style="font-size:85%;">keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore java-certs.keystore -srckeystore comodo-nsushkin\@openfinance.com-exp20120930.p12 -srcstoretype PKCS12 -alias "nicholas sushkin's the usertrust network id #3" -destalias nsushkin</span></blockquote>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-45534912520344491852009-11-14T17:19:00.005-05:002009-11-14T18:45:10.566-05:00Fixing broken sound in flash plugin in Slackware 13.0I upgraded my laptop to Slackware 13.0. In general, hardware support has improved. All hardware was detected automatically by HAL and UDEV. That includes formerly problematic Synaptic touchpad, both monitors attached via DVI and VGA, and Logitech Quickcam. I only needed minor adjustments to get dual screen out of the mirroring mode.<br /><br />One of the minor problems was that <span style="font-weight: bold;">flash plugin in Mozilla wouldn't play sound</span>. That was despite that my username being a member of the group "audio". It turned out that if you had more than one sound device, Flash would only output sound to the first configured device (alsa card #0). When I booted the laptop with webcam attached through USB, the snd-usb-audio module loaded before snd-hda-intel, resulting in the first configured audio device (webcam) not supporting any audio output.<br /><br />The workaround would be to always boot with the webcam unplugged. However, a better solution is to hint the device loading system (udev) that the built-in intel sound device needs to be loaded first. Google found me a solution in a Slackware forum at linuxquestions.org. Add a file in /etc/modprobe.d containing the following instruction: "<span style="font-weight: bold;font-family:courier new;" >options snd slots=snd-hda-intel,snd-usb-audio</span>". You can check the mapping of sound card slots to modules using "cat /proc/asound/modules"<br /><br />References: <a href="http://slackware.com/">Slackware</a>, <a href="http://j.mp/se7jh">Where Alsa looks for default sound card</a>, <a href="http://en.gentoo-wiki.com/wiki/Synaptics_Touchpad/Xorg_7.3#Configuration">Synaptics Touchpad with HAL</a>, <a href="http://www.thinkwiki.org/wiki/Xorg_RandR_1.2">Dual-screen with xrandr</a>.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-52493095610517118162009-11-12T16:46:00.003-05:002009-11-12T16:58:20.359-05:00Command line email with attachmentsThis is a perl script which can be used as a replacement for "mail" program, but supporting email attachments.<br /><pre class="htmlize"><br /><span class="comment-delimiter">#</span><span class="comment">!/usr/bin/perl -w<br /></span><br /><span class="comment-delimiter">#</span><span class="comment">****h* common/send_files<br /></span><span class="comment-delimiter"># </span><span class="comment">NAME<br /></span><span class="comment-delimiter"># </span><span class="comment">send_files - sends an email with multiple file attachments<br /></span><span class="comment-delimiter"># </span><span class="comment">FUNCTION<br /></span><span class="comment-delimiter"># </span><span class="comment">Uses sendmail to send an email with attachments. Takes message text<br /></span><span class="comment-delimiter"># </span><span class="comment">from the standard input.<br /></span><span class="comment-delimiter"># </span><span class="comment">PARAMETERS<br /></span><span class="comment-delimiter"># </span><span class="comment">--from - From email address<br /></span><span class="comment-delimiter"># </span><span class="comment">--to - To email address<br /></span><span class="comment-delimiter"># </span><span class="comment">--subject - Email subject<br /></span><span class="comment-delimiter"># </span><span class="comment">--file - Attach a file (use multiple times to attach multiple files)<br /></span><span class="comment-delimiter">#</span><span class="comment"><br /></span><span class="comment-delimiter"># </span><span class="comment">All the unprocessed options are treated as files to be attached<br /></span><span class="comment-delimiter">#</span><span class="comment"><br /></span><span class="comment-delimiter"># </span><span class="comment">EXAMPLE<br /></span><span class="comment-delimiter"># </span><span class="comment">echo "Look here" | send_files --from from@example.com --to to@example.com \<br /></span><span class="comment-delimiter"># </span><span class="comment">--subject "Files" --file /tmp/1.txt --file /tmp/2.txt<br /></span><span class="comment-delimiter">#</span><span class="comment"><br /></span><span class="comment-delimiter"># </span><span class="comment">echo "Specify files last" | send_files --from from@example.com --to to@example.com \<br /></span><span class="comment-delimiter"># </span><span class="comment">--subject "Files" --file /tmp/*.txt<br /></span><span class="comment-delimiter"># </span><span class="comment">HISTORY<br /></span><span class="comment-delimiter"># </span><span class="comment">$Header: send_files.pl,v 1.6 2008/04/08 20:53:13 nsushkin Exp $<br /></span><span class="comment-delimiter"># </span><span class="comment">SOURCE<br /></span><span class="comment-delimiter">#</span><span class="comment"><br /></span><span class="keyword">use</span> <span class="constant">MIME</span>::Lite;<br /><span class="keyword">use</span> <span class="constant">MIME</span>::Types;<br /><span class="keyword">use</span> <span class="constant">Getopt</span>::Long;<br /><br /><span class="type">my</span> ($<span class="variable-name">opt_from</span>, $<span class="variable-name">opt_to</span>, $<span class="variable-name">opt_subject</span>) = (<span class="string">""</span>, <span class="string">""</span>, <span class="string">""</span>);<br /><span class="type">my</span> @<span class="underline"><span class="variable-name">files</span></span> = ();<br /><span class="type">my</span> $<span class="variable-name">VERSION</span> = sprintf(<span class="string">"%d.%03d"</span>, q<span class="string">$Revision: 1.6 $</span> =~ <span class="string">/(\d+)\.(\d+)/</span>);<br /><br />GetOptions(<span class="string">"from=s"</span> => \$<span class="variable-name">opt_from</span>,<br /> <span class="string">"to=s"</span> => \$<span class="variable-name">opt_to</span>,<br /> <span class="string">"subject=s"</span> => \$<span class="variable-name">opt_subject</span>,<br /> <span class="string">"file=s"</span> => \@<span class="underline"><span class="variable-name">files</span></span>);<br /><br />push @<span class="underline"><span class="variable-name">files</span></span>, @<span class="underline"><span class="variable-name">ARGV</span></span>;<br />$<span class="variable-name">oldC</span> = $/;<br />binmode STDIN; undef $/;<br />$<span class="variable-name">message</span>=<<span class="constant">STDIN</span>>;<br />$/ = $<span class="variable-name">oldC</span>;<br /><br />$<span class="variable-name">msg</span> = MIME::Lite->new(<br /> From => $<span class="variable-name">opt_from</span>,<br /> To => $<span class="variable-name">opt_to</span>,<br /> Subject => $<span class="variable-name">opt_subject</span>,<br /> Type => <span class="string">'TEXT'</span>,<br /> Data => $<span class="variable-name">message</span><br /> );<br /><br />$<span class="variable-name">msg</span>->replace(<br /> <span class="string">'X-Mailer'</span> => <span class="string">"send_files.pl $VERSION"</span><br /> );<br /><br /><span class="keyword">for</span> $<span class="variable-name">file</span> (@<span class="underline"><span class="variable-name">files</span></span>)<br />{<br /> <span class="keyword">die</span> <span class="string">"Not readable $file: $!"</span> <span class="keyword">unless</span> -r $<span class="variable-name">file</span>;<br /> chomp (<span class="type">my</span> $<span class="variable-name">mimeTypeS</span>=<span class="string">`file -bi "$file"`</span>);<br /> <span class="type">my</span> MIME::Type $<span class="variable-name">mimeType</span> = MIME::Types->new->type($<span class="variable-name">mimeTypeS</span>);<br /> chomp (<span class="type">my</span> $<span class="variable-name">fileName</span>=<span class="string">`basename "$file"`</span>);<br /><br /> $<span class="variable-name">msg</span>->attach(<br /> Type => $<span class="variable-name">mimeTypeS</span>,<br /> Path => $<span class="variable-name">file</span>,<br /> Filename => $<span class="variable-name">fileName</span>,<br /> Encoding => ($<span class="variable-name">mimeType</span>->mediaType eq <span class="string">'text'</span> ? <span class="string">'quoted-printable'</span> : <span class="string">'base64'</span>)<br /> );<br />}<br /><br />$<span class="variable-name">msg</span>->send;<br /><span class="comment-delimiter">#</span><span class="comment">***<br /></span></pre>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-4963532478684229892009-03-17T11:59:00.004-04:002009-03-17T12:03:54.713-04:00set role plustraceJust spent an hour trying to configure autotrace in Oracle 10.2.0.3.0. It turns out that in addition to granting <span style="font-family: courier new;">plustrace</span> role to a user and creating a <span style="font-family: courier new;">PLAN</span> table, you also need to enable the <span style="font-family: courier new;">plustrace</span> role in the user's session using "<span style="font-family: courier new;">SET ROLE PLUSTRACE;</span>"<br /><br />Read comments at the bottom of <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5671636641855#33004281098282">Tom Kyte's autotrace topic</a>.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-48038372899928334032009-02-27T10:48:00.009-05:002009-02-27T11:34:17.693-05:00What will save the Earth and Wall Street?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/en/b/b9/Xbrl-logo.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 188px; height: 94px;" src="http://upload.wikimedia.org/wikipedia/en/b/b9/Xbrl-logo.png" alt="" border="0" /></a><br />A couple of recent articles in Wired and O'Reilly claim that technology for transparency, specifically XBRL (Extensible Business Reporting Language), is going to be crucial in saving the climate and also Wall Street. Go learn XBRL now!<br /><br />In The Wired article, Daniel Roth suggests that XBRL<br /><blockquote>"...should become the lingua franca of every investment bank, hedge fund, pension fund, insurance company, and endowment fund. ... It is impossible to track any one loan in a CDO [collateralized debt obligation]; when it is combined and divided with other loans, it loses its independent identity... But if those mortgages and loans carried XBRL tags, and everybody who touched them along the way was required to use those tags as well, anyone would have been able to track their circuitous route through the financial industry and judge each CDO based on its actual content."</blockquote>Chicago Climate Exchange (CCX) is a market for trading offsets of carbon and other climate related emissions, implementing the "trade" component of a "cap and trade" climate control scheme. As far as I understand, currently, CCX takes semi-manual submissions of trades via its website. However, it turns out XBRL can be used to automate carbon credit accounting and trading.<br /><br />Kurt Cagle writes<br /><blockquote>"...think of each participant [of smart power grid] as a node in a network. At any given point, the state of that node - how much energy they have available for transmission at that point in time, how much energy they currently need to fulfill demands upon them - can be represented as an XBRL accounting document."</blockquote>For more information, read the following recent articles<br /><ul><li><span style="font-size:85%;"><a href="http://www.wired.com/techbiz/it/magazine/17-03/wp_reboot">Road Map for Financial Recovery: Radical Transparency Now!</a>,<br /></span></li><li><span style="font-size:85%;"><a href="http://broadcast.oreilly.com/2009/02/xbrl-and-carbon-credit-account.html">XBRL: the Solution for Carbon Credit and Smart Grid Accounting</a>,<br /></span></li><li><span style="font-size:85%;"><a href="http://science.howstuffworks.com/chicago-climate-exchange.htm">How Chicago Climate Exchange Works</a>, and<br /></span></li><li><span style="font-size:85%;"><a href="http://en.wikipedia.org/wiki/XBRL">Wikipedia on XBRL</a>.</span></li></ul>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-23677176018864897762009-02-09T14:25:00.002-05:002009-02-09T14:28:23.046-05:00Volkerding praises KDE4 againRecently on Slackware ChangeLog, Volkerding wrote:<blockquote></blockquote><blockquote></blockquote><blockquote></blockquote><blockquote>Tue Jan 27 14:33:35 CST 2009<br /> KDE 4.2.0 is released -- congratulations to the KDE development team for such<br /> an amazing job on this beautiful and highly user-friendly desktop environment!<br /> Thanks also to Eric Hameleers, who did a ton of work getting KDE 4.2.0 ready<br /> for Slackware. Once again (for now), these packages are compatible with<br /> Slackware 12.2. Enjoy! :-)</blockquote>Hopefully Slackware 13 will integrate KDE4 and I will be able to enjoy the new features and eye candy.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-39912810292372210752009-01-23T17:41:00.001-05:002009-01-23T17:43:16.160-05:00Alan Kay on modern programming languages<blockquote>Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.</blockquote>Read the rest in <a href="http://queue.acm.org/detail.cfm?id=1039523">A Conversation with Alan Kay</a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-39231080366700531722008-10-01T09:27:00.002-04:002008-10-01T09:30:10.336-04:00Tuckey RewriteNote to self, Tomcat mailing list recommends a Url rewrite filter for a servlet container called <a href="http://tuckey.org/urlrewrite/">Tuckey UrlRewrite</a>. It functions similarly to the popular apache mod_rewrite. I speculate it may be helpful in a RESTful application to map requests to JSPs.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-79952049528538667002008-09-03T12:37:00.002-04:002008-09-03T12:45:38.883-04:00$5 multifactor authentication for OpenID<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i183.photobucket.com/albums/x294/mike6024/PayPalVerisignSecurityTokens.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px;" src="http://i183.photobucket.com/albums/x294/mike6024/PayPalVerisignSecurityTokens.png" alt="" border="0" /></a><br /><a href="http://www.paypal.com/securitykey">Paypal provides a $5 unique password security key</a> which works with Verisign OpenID provider, according to blog <a href="http://ilikeellipses.com/2007/09/01/more-on-verisign-pip-openid/">"i like ellipses"</a>. Get it while the introduction price makes it a better deal than the $30 Verisign's own security key.<br /><br />Availability of this key is a great news because using a unique password key makes your OpenID identity much more trustworthy.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-38609143699151243422008-07-21T19:05:00.005-04:002008-07-21T19:52:39.339-04:00Changing fan on Thinkpad T41<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_29OWQQflr4o/SIUhQEXZzUI/AAAAAAAAAnU/KnA_Gexe6l8/s1600-h/old_thinkpad_fan_back.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_29OWQQflr4o/SIUhQEXZzUI/AAAAAAAAAnU/KnA_Gexe6l8/s400/old_thinkpad_fan_back.jpg" alt="" id="BLOGGER_PHOTO_ID_5225619502566853954" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_29OWQQflr4o/SIUhIPhZPpI/AAAAAAAAAnM/ZVi7jqY0_sA/s1600-h/old_thinkpad_fan.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_29OWQQflr4o/SIUhIPhZPpI/AAAAAAAAAnM/ZVi7jqY0_sA/s400/old_thinkpad_fan.jpg" alt="" id="BLOGGER_PHOTO_ID_5225619368122597010" border="0" /></a><br />After four years in service, the fan of my Thinkpad T41 started to fail. The computer either wouldn't boot with "fan error" message at boot time if the fan doesn't start or the fan would whine causing video card to overheat, freezing X11. Time to change the fan.<br /><br />I found the fan part number at IBM's website, it was "CPU Fan Long", FRU 13N5341. I searched online shops for the part, finding several listing the fan from anywhere from $30 to $80. At three different cheapest stores, I tried to order the fan and failed, each time the store canceling my order because the fan was out of stock. Then, I found the IBM parts store, 1-800-388-7080. At the IBM store, the fan was $58 and 1-2 day shipping via DHL was $15, an amazing deal. They just changed the part number to 91P9252. I ordered the fan on Friday. On Monday I received a new looking fan, nicely packaged, with thermal gel intact (covered with a removable film) and thermal grease pre-applied in the right place (gel above the video card heat sink and the grease above the CPU).<br /><br />The hardest part was removing the old fan. I had to find just the right screwdriver (Philips #1 from my toolkit having Ph 0..3) and applying drops of WD-40 to the fan screws. Once the fan was out, putting new fan and closing the laptop was a piece of cake. The laptop booted just fine and noise disappeared. Let's hope the thermal gel and grease adhere correctly, but it looks like IBM still got the chops. Let's hope new Chinese owners (Lenovo) won't screw it up.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com4tag:blogger.com,1999:blog-6427421974690377954.post-40247120015618982192008-07-11T22:35:00.004-04:002008-07-11T22:40:22.171-04:00NoClassDefFoundError: oracle/gss/util/NLSLocaleWhen I upgraded my Oracle JDBC driver to 10.2.0.4, Oracle XSQL Utility started giving me the following exception when using "-encoding UTF-8"<br /><br /><blockquote>Exception in thread "main" java.lang.NoClassDefFoundError: oracle/gss/util/NLSLocale<br /> at oracle.xml.sql.XSULocale.getJavaCharset(XSULocale.java:122)<br /> at OracleXML.To_XML(OracleXML.java:1092)<br /> at OracleXML.ExecuteGetXML(OracleXML.java:917)<br /> at OracleXML.main(OracleXML.java:185)</blockquote><br />Ok, it turns out that in Oracle 10.2.0.4, some classes that used to be in<br />orai18n.jar got separated into their own jars, which are shipped with Oracle<br />XDK, not with Oracle JDBC drivers. For example, oracle.gss.util.NLSLocale is now in <xdk>$XDKHOME/jlib/orai18n-mapping.jar.</xdk>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com2tag:blogger.com,1999:blog-6427421974690377954.post-60569410160098772682008-06-11T14:26:00.003-04:002008-06-11T14:29:34.142-04:00LCD text in NetBeansFinally figured out how to enable sub-pixel rendering (also known as LCD text) in NetBeans. Just add <span style="font-weight: bold;">-J-Dawt.useSystemAAFontSettings=lcd</span><span> to netbeans_default_options variable in your ~/.netbeans/6.1/etc/netbeans.conf </span><span style="font-weight: bold;"><br /></span>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-52290150431939262272008-03-18T16:41:00.005-04:002008-03-18T16:56:11.225-04:00Bash Random ShuffleHere is a bash function which returns a random permutation of the input lines of text.<br /><pre class="htmlize"><span class="comment-delimiter">#</span><span class="comment">****f* shadegrowncode/randomShuffle<br /></span><span class="comment-delimiter"># </span><span class="comment">NAME<br /></span><span class="comment-delimiter"># </span><span class="comment">randomShuffle - prints random permutation of lines in standard input<br /></span><span class="comment-delimiter"># </span><span class="comment">FUNCTION<br /></span><span class="comment-delimiter"># </span><span class="comment">Prints all or the first N lines of a random permutation of the<br /></span><span class="comment-delimiter"># </span><span class="comment">lines of standard input. The random permutation is obtained using<br /></span><span class="comment-delimiter"># </span><span class="comment">Durstenfeld shuffle algorithm. Performance is O(N) in memory and<br /></span><span class="comment-delimiter"># </span><span class="comment">CPU. Limit the input to 32768 lines or rewrite using a different<br /></span><span class="comment-delimiter"># </span><span class="comment">random generator.<br /></span><span class="comment-delimiter"># </span><span class="comment">SEE ALSO<br /></span><span class="comment-delimiter"># </span><span class="comment">http://en.wikipedia.org/wiki/Knuth_shuffle<br /></span><span class="comment-delimiter"># </span><span class="comment">PARAMETERS<br /></span><span class="comment-delimiter"># </span><span class="comment">* 1 - (optional) return only the first N of the random lines of input<br /></span><span class="comment-delimiter"># </span><span class="comment">SOURCE<br /></span><span class="keyword">function</span> <span class="function-name">randomShuffle</span><br />{<br /> <span class="builtin">typeset</span> -a elements<br /> <span class="builtin">typeset</span> <span class="variable-name">length</span>=0<br /> <span class="keyword">while </span><span class="builtin">read</span> line<br /> <span class="keyword">do</span><br /> elements[$<span class="variable-name">length</span>]=$<span class="variable-name">line</span><br /> <span class="variable-name">length</span>=$(($<span class="variable-name">length</span> + 1))<br /> <span class="keyword">done</span><br /> <span class="builtin">typeset</span> <span class="variable-name">firstN</span>=${<span class="variable-name">1</span>:-$<span class="variable-name">length</span>}<br /> <span class="keyword">if</span> [ $<span class="variable-name">firstN</span> -gt $<span class="variable-name">length</span> ]<br /> <span class="keyword">then</span><br /> <span class="variable-name">firstN</span>=$<span class="variable-name">length</span><br /> <span class="keyword">fi</span><br /> <span class="keyword">for</span> ((<span class="variable-name">i</span>=0; $<span class="variable-name">i</span> < $<span class="variable-name">firstN</span>; i++))<br /> <span class="keyword">do</span><br /> <span class="variable-name">randPos</span>=$(($<span class="variable-name">RANDOM</span> % ($<span class="variable-name">length</span> - $<span class="variable-name">i</span>) ))<br /> <span class="builtin">printf</span> <span class="string">"%s\n"</span> <span class="string">"${elements[$randPos]}"</span><br /> elements[$<span class="variable-name">randPos</span>]=${<span class="variable-name">elements</span>[$<span class="variable-name">length</span> - $<span class="variable-name">i</span> - 1]}<br /> <span class="keyword">done</span><br />}<br /><span class="comment-delimiter">#</span><span class="comment">***<br /></span></pre><br />Usage examples:<br />Print three random users from the password file:<br /><pre class="htmlize">$ cut -d: -f1 /etc/passwd | randomShuffle 3<br />sync<br />sysadmin<br />vcsa</pre><br />Print a random permutation of digits:<br /><pre class="htmlize">$ echo $(printf "%s\n" 0 1 2 3 4 5 6 7 8 9 | randomShuffle)<br />4 1 0 6 8 7 2 5 3 9</pre>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com1tag:blogger.com,1999:blog-6427421974690377954.post-40411258885166956712008-02-15T20:25:00.002-05:002008-02-15T20:29:28.998-05:00Volkerding says KDE4 better than MacOS<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.slackware.org/%7Emsimons/slackware/grfx/shared/TrySlackLinux.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 220px; height: 120px;" src="http://www.slackware.org/%7Emsimons/slackware/grfx/shared/TrySlackLinux.gif" alt="" border="0" /></a><br />Patrick Volkerding (Slackware Project Lead) gives glowing thumbs up to KDE4 and slates it for inclusion into Slackware 14. Slackware is currently at version 12 and releases once a year. At this rate, KDE4 will be in Slackware in 2009. Among other things, Patrick says the following.<br /><blockquote>The look of the new [KDE] desktop is stunning, and the use of SVG and hardware acceleration gives (IMHO) even something like MacOS a run for its money in terms of appearance and user-friendliness. We look forward with great anticipation to merging KDE4 when it is mature enough (and it's getting there fast), and then watching it just get better and better.</blockquote>The full quote can be found in <a href="http://www.slackware.org/">Slackware</a> <a href="ftp://ftp.slackware.com/pub/slackware/slackware-current/ChangeLog.txt">ChangeLog</a>.Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-58053038001345678382008-01-10T02:15:00.000-05:002008-01-10T03:10:44.088-05:00Reason to switch to Linux #11<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_29OWQQflr4o/R4XH2JI7TFI/AAAAAAAAACw/17l-yueuEaY/s1600-h/windows-clock.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_29OWQQflr4o/R4XH2JI7TFI/AAAAAAAAACw/17l-yueuEaY/s200/windows-clock.png" alt="" id="BLOGGER_PHOTO_ID_5153745081575623762" border="0" /></a><br />Windows taskbar clock cannot display seconds since Windows 95.<br />Why? Because when installed on a 4 Mb machine, Windows 95 was too slow to display seconds. This and other lame excuses are <a href="http://blogs.msdn.com/oldnewthing/archive/2003/10/10/55256.aspx">blogged at MSDN</a>. There is a whole shareware industry around Windows to fix this problem. If you want to measure time, use online <a href="http://proft.50megs.com/stopwatch.html">javascript stop watch</a> or <a href="http://www.time.gov/timezone.cgi?Eastern/d/-5/java">US atomic clock at time.gov</a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-58342668312431994752007-12-11T19:59:00.000-05:002007-12-11T20:04:02.426-05:00Java sighting on a cup of milk<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_29OWQQflr4o/R18zQmKug9I/AAAAAAAAACo/bSIlgHxE2cE/s1600-h/java_on_a_cup_of_soy_milk.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_29OWQQflr4o/R18zQmKug9I/AAAAAAAAACo/bSIlgHxE2cE/s320/java_on_a_cup_of_soy_milk.jpg" alt="" id="BLOGGER_PHOTO_ID_5142885659696858066" border="0" /></a><br />Looking at this cup of soy milk in Taipei, I thought at first that somebody stole Java logo. Then, looking closer, I realized it's a genuine ad for Java training. Something you won't see on a milk container in the US...Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-39522536473054724472007-11-02T21:35:00.000-04:002007-11-02T22:20:40.914-04:00Form based login from a shell scriptThe following code uses only shell scripting and curl to log in to a website protected by a form based authentication and download contents of page "about.jspx". We pay special attention to returning reasonable error messages. These snippets were tested with Tomcat 5.5.<br /><br /><ol><li>Get user name, password, and the application's URL from the command line,<pre class="htmlize"><span class="builtin">eval</span> set -- $(getopt <span class="string">"u:p:b:"</span> <span class="string">"$@"</span>)<br /><span class="keyword">while</span> [ <span class="string">"$1"</span> != <span class="string">"--"</span> ]<br /><span class="keyword">do</span><br /><span class="keyword"> case</span> <span class="string">"$1"</span><span class="keyword"> in</span><br /> -u) <span class="builtin">shift; </span><span class="variable-name">WEB_UID</span>=<span class="string">"$1"; </span><span class="builtin">shift</span>; ;;<br /> -p) <span class="builtin">shift; </span><span class="variable-name">WEB_PWD</span>=<span class="string">"$1"; </span><span class="builtin">shift</span>; ;;<br /> -b) <span class="builtin">shift; </span><span class="variable-name">BASE_URL</span>=<span class="string">"${1%\/}"; </span><span class="builtin">shift; </span>;;<br /><span class="keyword"> esac</span><br /><span class="keyword">done</span><br /></pre></li><li>Store URLs in variables,<br /><pre class="htmlize"><span class="builtin">typeset</span> <span class="variable-name">aboutUrl</span>=<span class="string">"$BASE_URL/about.jspx"</span><br /><span class="builtin">typeset</span> <span class="variable-name">securityAction</span>=<span class="string">"$BASE_URL/j_security_check"</span><br /><span class="builtin">typeset</span> <span class="variable-name">logoffUrl</span>=<span class="string">"$BASE_URL/logoff.jsp"</span><br /></pre></li><li>Access the URL and look for session cookie JSESSIONID,<br /><pre class="htmlize"><span class="variable-name">headers</span>=<span class="string">"$(curl -s -S -f -L -D - -o /dev/null --url "</span>$<span class="variable-name">aboutUrl</span><span class="string">" 2>&1)"</span> <span class="sh-escaped-newline">\</span><br />|| error <span class="string">"Error accessing $aboutUrl: $headers"</span><br /><span class="keyword">if</span> [[ <span class="string">"$headers"</span> =~ <span class="string">'Set-Cookie: JSESSIONID=([^;]*)'</span> ]]<br /><span class="keyword">then</span><br /><span class="variable-name"> sid</span>=<span class="string">"${BASH_REMATCH[1]}"</span><br /><span class="keyword">fi</span><br /></pre></li><li>If JSESSIONID cookie is set, submit user name and password to the login form. On success, the application will redirect us to the original URL. Variable "about" will store the page source or the error message.<br /><pre class="htmlize"><span class="variable-name">about</span>=<span class="string">"$(curl -s -S -L -f -b "</span><span class="variable-name">JSESSIONID</span>=$<span class="variable-name">sid</span><span class="string">" -o - \<br />-d "</span><span class="variable-name">j_username</span>=$<span class="variable-name">WEB_UID</span><span class="string">" \<br />-d "</span><span class="variable-name">j_password</span>=$<span class="variable-name">WEB_PWD</span><span class="string">" \<br />--url "</span>$<span class="variable-name">securityAction</span><span class="string">" 2>&1)"</span> <span class="sh-escaped-newline">\</span><br />|| error <span class="string">"Error submitting credentials to $securityAction: $about"</span><br /></pre></li><li>Parse the page for some useful information (looking for <sysdate date="20071102">)<br /><pre class="htmlize"><span class="keyword">if</span> [[ <span class="string">"$about"</span> =~ <span class="string">'sysdate date=\"([^\"]*)\"'</span> ]]<br /><span class="keyword">then</span><br /><span class="variable-name"> date</span>=<span class="string">"${BASH_REMATCH[1]}"</span><br /><span class="keyword">fi</span></pre></li><li>Finally, hit the logoff URL so that the application may clean up.<br /><pre class="htmlize"><span class="comment-delimiter"></span>curl -s -f -b <span class="string">"JSESSIONID=$sid"</span> --url <span class="string">"$logoffUrl"</span> -o /dev/null</pre></li></ol>For more information, see <a href="http://curl.haxx.se/"><b>cURL</b> and libcurl</a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-25881402644281853272007-09-25T14:48:00.001-04:002007-09-25T15:14:27.186-04:00Sun NetBeans daySeptember 11th was a Sun NetBeans day in Boston. Here's what I learned:<br /><ul><li>NetBeans keeps improving. NetBeans 6 consolidates six independent Java parsers of version 5 into one. Syntax highlighting and refactoring can now use more semantic information; it is now faster and more powerful and accurate.</li><li>Profiler is now improved and built-in into NetBeans. It can be enabled or disabled at runtime using profiling points. More info at <a href="http://profiler.netbeans.org">Netbeans profiler pages</a>.<br /></li><li>The most active site about NetBeans is <a href="http://wiki.netbeans.org/">NetBeans Wiki</a>.<br /></li><li>New England has an active Java User Group, which organizes nice talks. See <a href="http://www.nejug.org/">NEJUG.org</a></li><li>A lot of introductory presentation about Java technology inluding RIA and REST is posted by one of the speakers at <a href="http://www.javapassion.com/handsonlabs">JavaPassion.com.</a> The speaker himself was speaking way too fast with a Korean accent, but his presentations must be filled with information.<br /></li></ul>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-1056085800903609922007-09-21T20:10:00.000-04:002007-09-21T22:10:36.910-04:00Upgraded to Slackware 12Updated my Thinkpad T40 from Slackware 11 to <a href="http://www.slackware.com/">Slackware</a> 12. The 2 hour upgrade went without a hitch. I was pleasantly surprised to find out that Paul compiled KDE <a href="http://www.gnupg.org/aegypten2/index.html">KMail with S/MIME support</a>. Great, I don't need to roll my own packages any more.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_29OWQQflr4o/RvRiAKFnGrI/AAAAAAAAABE/Q1y3bOM_EsM/s1600-h/kmail-smime.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_29OWQQflr4o/RvRiAKFnGrI/AAAAAAAAABE/Q1y3bOM_EsM/s320/kmail-smime.png" alt="" id="BLOGGER_PHOTO_ID_5112819231819766450" border="0" /></a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-37367542852132950602007-05-04T13:42:00.000-04:002007-05-07T16:36:19.960-04:00Fixed S/MIME interoperability between KDE KMail and Mozilla ThunderbirdNelson Bolyard fixed interoperability problem between Thunderbird and KMail (or rather gpgsm). There was a bug in how gpgsm encoded cipher preferences, which Thunderbird could not understand and was falling back to RC2/40 cipher. In gpgsm, RC2/40 was not implemented for <a href="http://www.nabble.com/forum/ViewPost.jtp?post=10012362&framed=y">patently political<br />reasons</a>. Thunderbird crypto library was made more lenient in what it accepted. So, now, TB would correctly responds to KMail using 3DES instead of RC/40. More details are in <a href="https//bugzilla.mozilla.org/show_bug.cgi?id=379625">Bugzilla</a> and <a href="http://groups.google.com/group/mozilla.dev.tech.crypto/browse_frm/thread/44ab6f2b918fb9f7/8c11fa85d64f4155?tvc=1">Usenet</a>.<br /><br />Still causing minor problems are the following bugs. Vote for or fix them!<br /><ul><li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=379753">support of AES by Thunderbird</a></li><li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=84213">Thunderbird should not support weak crypto</a></li><li><a href="http://www.intevation.de/roundup/aegypten/issue754">correct generation of SMimeCapabilities by gpgsm</a></li><li><a href="http://www.intevation.de/roundup/aegypten/issue430">gpgsm does not recognize Verisign certs because of MD2 hash algorithm</a></li></ul>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0tag:blogger.com,1999:blog-6427421974690377954.post-5509032654768677172007-04-26T16:07:00.000-04:002007-04-26T16:24:32.627-04:00Does Google know math?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_29OWQQflr4o/RjEG0fV2hnI/AAAAAAAAAAk/4IKFKyvsTnY/s1600-h/google-0-to-0th-power%3D1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_29OWQQflr4o/RjEG0fV2hnI/AAAAAAAAAAk/4IKFKyvsTnY/s320/google-0-to-0th-power%3D1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5057831355349894770" /></a><br />According to Google Calculator, <a href="http://www.google.com/search?q=0%5E0"/>0^0</a>=1. What else would you expect from a Stanford dropout son of a professor of mathematics... ;) At least Google has no opinion on <a href="http://www.google.com/search?q=0%2F0">0/0</a>Nicholas Sushkinhttp://www.blogger.com/profile/13580158096973753230noreply@blogger.com0