<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-33560925</id><updated>2009-11-05T10:37:14.859-07:00</updated><title type='text'>My Tech Blogs!!!</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default?start-index=26&amp;max-results=25'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-33560925.post-7347074692386353881</id><published>2009-11-04T15:55:00.003-07:00</published><updated>2009-11-04T16:21:07.517-07:00</updated><title type='text'>Hibernate flush only specific object types</title><content type='html'>So we have this issue where in certain cases we would only like to flush a certain class of objects and discard the rest. This is sort of a common use case if you are following the one session per request paradigm wherein if a job/request fails and the job status logging is also done via the database/hibernate then you would still want to persist the job log status however the application job data changes can be discarded. Found an excellent post here:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://forum.hibernate.org/viewtopic.php?f=1&amp;t=983747&amp;sid=4988e082644059b66220836ef4c53806&amp;start=15"&gt;https://forum.hibernate.org/viewtopic.php?f=1&amp;t=983747&amp;sid=4988e082644059b66220836ef4c53806&amp;start=15&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So as it turns out there is no way to selectively flush objects. You can use the "evict non flushable objects" methodology (basically bu evicting the objects their changes are discarded) but often times you don't know what all objects were involved in the request. &lt;br /&gt;&lt;br /&gt;A better design is to probably open two sessions with each request/job. One for meta data and the other for application business data. That allows better handling of request failures.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-7347074692386353881?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/7347074692386353881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/11/hibernate-flush-only-specific-object.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7347074692386353881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7347074692386353881'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/11/hibernate-flush-only-specific-object.html' title='Hibernate flush only specific object types'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-3536289856754071773</id><published>2009-10-04T15:42:00.002-07:00</published><updated>2009-10-04T15:47:07.477-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Enable Mysql general query log in Mac OSX'/><title type='text'>Enable Mysql general query log in Mac OSX</title><content type='html'>To enable this for the current user follow the below steps&lt;br /&gt;&lt;br /&gt;-- create or edit the existing cnf file&lt;br /&gt;vim ~/.my.cnf &lt;br /&gt;&lt;br /&gt;-- add the below variable to the file&lt;br /&gt;[server]&lt;br /&gt;log=/tmp/mysql_query.log&lt;br /&gt;&lt;br /&gt;-- restart mysql&lt;br /&gt;sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop&lt;br /&gt;sudo /Library/StartupItems/MySQLCOM/MySQLCOM start&lt;br /&gt;&lt;br /&gt;To enable the general query log for all users add the "variable" to /etc/my.cnf instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-3536289856754071773?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/3536289856754071773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/10/enable-mysql-general-query-log-in-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3536289856754071773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3536289856754071773'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/10/enable-mysql-general-query-log-in-mac.html' title='Enable Mysql general query log in Mac OSX'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-5167606774563219075</id><published>2009-08-30T14:08:00.005-07:00</published><updated>2009-08-30T18:17:33.266-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flash full screen freeze'/><category scheme='http://www.blogger.com/atom/ns#' term='megavideo full screen freeze'/><category scheme='http://www.blogger.com/atom/ns#' term='veoh full screen freeze'/><title type='text'>Adobe Flash freezes on full screen</title><content type='html'>Have been having this problem recently wherein doing a full screen on a flash video freezes the screen. My wife watches movies online occasionally on MegaVideo/Veoh and the problem persists in both as both use flash internally. &lt;br /&gt;&lt;br /&gt;While the Flash player is in normal mode, right click on the player and choose "Settings" from the context menu.  Remove the checkmark in the box next to "Enable Hardware Acceleration".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Wx-8OjwLTqs/Spskmoi1dLI/AAAAAAAAAFE/uDbbiEHs3uw/s1600-h/fpSettings1.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 213px; height: 135px;" src="http://1.bp.blogspot.com/_Wx-8OjwLTqs/Spskmoi1dLI/AAAAAAAAAFE/uDbbiEHs3uw/s320/fpSettings1.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5375930826333975730" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference links&lt;br /&gt;http://support.mozilla.com/si/kb/Cannot+view+full+screen+Flash+videos&lt;br /&gt;http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-5167606774563219075?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/5167606774563219075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/adobe-flash-screen-freezes-on-full.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5167606774563219075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5167606774563219075'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/adobe-flash-screen-freezes-on-full.html' title='Adobe Flash freezes on full screen'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Wx-8OjwLTqs/Spskmoi1dLI/AAAAAAAAAFE/uDbbiEHs3uw/s72-c/fpSettings1.PNG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-7087811130971990908</id><published>2009-08-14T17:07:00.001-07:00</published><updated>2009-08-14T17:08:55.409-07:00</updated><title type='text'>Adcenter keyword: Setting match type</title><content type='html'>Adcenter is different from other networks as it does not have a special attribute called “match type” on a keyword. Instead each keyword has three bid fields “exact bid (EB)”, “phrase bid (PB)” and “broad bid (BB)”. The keyword match types are determined on whether a bid is specified for that match type. For instance if a keyword has EB=1.5,PB=0.75,BB=0.0 then this keyword is used in exact and phrase matches. This is different in other networks where a keyword has a single “bid” attribute and an attribute to specify match type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-7087811130971990908?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/7087811130971990908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/adcenter-keyword-setting-match-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7087811130971990908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7087811130971990908'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/adcenter-keyword-setting-match-type.html' title='Adcenter keyword: Setting match type'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-3520259369135933644</id><published>2009-08-07T16:37:00.005-07:00</published><updated>2009-08-14T17:05:41.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='monitoring gearman'/><category scheme='http://www.blogger.com/atom/ns#' term='gearman monitoring'/><title type='text'>Monitoring Gearman over telnet port 4730</title><content type='html'>So the only way to monitor Gearman is via doing a telnet to port 4730. The current monitoring supported commands are fairly basic. I could not locate any documentation on the support commands so had to literally look at the code to figure out the supported commands (the below command documentation is copied from the comments in code). There are plans to include more set of commands in the next release.&lt;br /&gt;&lt;br /&gt;Command: STATUS&lt;br /&gt;&lt;br /&gt;The output format of this function is tab separated columns as follows, followed by a line consisting of a full stop and a newline (".\n") to indicate the end of output. below are the columns shown&lt;br /&gt;&lt;br /&gt;- Function name : A string denoting the name of the function of the job&lt;br /&gt;- Number in queue : A positive integer indicating the total number of jobs for this function in the queue. This includes currently running ones as well (next column)&lt;br /&gt;- Number of jobs running : A positive integer showing how many jobs of this function are currently running&lt;br /&gt;- Number of capable workers : A positive integer denoting the maximum possible count of workers that could be doing this job. Though they may not all be working on it due to other tasks holding them busy.&lt;br /&gt;&lt;br /&gt;Command : Workers&lt;br /&gt;&lt;br /&gt;This command show the details of various clients registered with the gearmand server. For each worker it shows the following info:&lt;br /&gt;&lt;br /&gt;- Peer IP: Client remote host&lt;br /&gt;- Client ID: Unique ID assigned to client&lt;br /&gt;- Functions: List of functions this client has registered for.&lt;br /&gt;&lt;br /&gt;Any other command text throws a error "ERR unknown_command Unknown+server+command"&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 650px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;sudhirv@sudhirv:~$ telnet localhost 4730&lt;br /&gt;Trying ::1...&lt;br /&gt;Trying 127.0.0.1...&lt;br /&gt;Connected to localhost.&lt;br /&gt;Escape character is '^]'.&lt;br /&gt;&lt;br /&gt;STATUS&lt;br /&gt;.&lt;br /&gt;WORKERS&lt;br /&gt;11 127.0.0.1 - :&lt;br /&gt;.&lt;br /&gt;status&lt;br /&gt;.&lt;br /&gt;workers&lt;br /&gt;11 127.0.0.1 - :&lt;br /&gt;.&lt;br /&gt;some crap&lt;br /&gt;ERR unknown_command Unknown+server+command&lt;br /&gt;&lt;br /&gt;#### will add more samples in action when I have this thing up and running ####&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-3520259369135933644?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/3520259369135933644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/monitoring-gearman-over-telnet-port.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3520259369135933644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3520259369135933644'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/monitoring-gearman-over-telnet-port.html' title='Monitoring Gearman over telnet port 4730'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-3230158913888828405</id><published>2009-08-07T16:01:00.002-07:00</published><updated>2009-08-07T16:37:12.363-07:00</updated><title type='text'>Installing Gearman on Ubuntu</title><content type='html'>Gearman is a open source job forking system. We have been evaluating its use in our project to share jobs across components. More info on the Gearman project can be found here: http://gearman.org/.&lt;br /&gt;&lt;br /&gt;Here are the instructions on installing Gearman on Ubuntu&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 650px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;wget http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz&lt;br /&gt;tar -xvzf gearmand-0.9.tar.gz&lt;br /&gt;&lt;br /&gt;# two missing libraries that found at configure time&lt;br /&gt;sudo apt-get install libevent-dev&lt;br /&gt;sudo apt-get install uuid-dev&lt;br /&gt;&lt;br /&gt;cd gearmand-0.9&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;br /&gt;sudo ldconfig&lt;br /&gt;&lt;br /&gt;# start gearman&lt;br /&gt;gearmand &amp;&lt;br /&gt;&lt;br /&gt;# check gearmand running &lt;br /&gt;ps auxw | grep [g]earmand&lt;br /&gt;&lt;br /&gt;# check germand listening for jobs on tcp port 4730&lt;br /&gt;sudo lsof -i tcp:4730&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# errors when starting gearman&lt;br /&gt;Error: gearman: error while loading shared libraries: libgearman.so.1&lt;br /&gt;&lt;br /&gt;Solution: `make install` may install libraries into `/usr/local/lib`.  It's possible&lt;br /&gt; that this directory isn't on your library search path, which will result in an error &lt;br /&gt;like: "gearman: error while loading shared libraries: libgearman.so.1."  To fix this, &lt;br /&gt;either add `/usr/local/lib` to `LD_LIBRARY_PATH`, or modify `/etc/ld.so.conf` or &lt;br /&gt;`/etc/ld.so.conf.d` to add `/usr/local/lib`, then run: sudo ldconfig&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-3230158913888828405?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/3230158913888828405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/installing-gearman-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3230158913888828405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3230158913888828405'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/installing-gearman-on-ubuntu.html' title='Installing Gearman on Ubuntu'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-9084657117156142129</id><published>2009-08-07T13:27:00.003-07:00</published><updated>2009-08-07T13:33:30.657-07:00</updated><title type='text'>Extract process attributes</title><content type='html'>Handy one liner scripts to extract various process attributes. You can add additional attributes to the 'ps' command to get other attributes. Below are some samples&lt;br /&gt;&lt;br /&gt;-- Process start hour&lt;br /&gt;ps -eo pgid,lstart,cmd | grep "[p]name" | awk '{print $5}' | cut -d\. -f1&lt;br /&gt;&lt;br /&gt;-- Process start minute&lt;br /&gt;ps -eo pgid,lstart,cmd | grep "[p]name" | awk '{print $5}' | cut -d\. -f2&lt;br /&gt;&lt;br /&gt;--process start day&lt;br /&gt;ps -eo pgid,lstart,cmd | grep "[p]name" | awk '{print $4}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-9084657117156142129?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/9084657117156142129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/extract-process-attributes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/9084657117156142129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/9084657117156142129'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/extract-process-attributes.html' title='Extract process attributes'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-3076911022594715058</id><published>2009-08-07T12:48:00.001-07:00</published><updated>2009-08-07T12:49:07.819-07:00</updated><title type='text'>command to kill a process group</title><content type='html'>If pid is negative but not -1, the signal is sent to all processes whose process group ID is equal to the absolute value of pid. The negative pid is specified in this way:&lt;br /&gt;&lt;br /&gt;   kill -s KILL -- -nn&lt;br /&gt;&lt;br /&gt;where nn is the process group ID and may have a range of 2 to 7 digits (nn to nnnnnnn).&lt;br /&gt;&lt;br /&gt;   kill -s KILL -- -9812753&lt;br /&gt;&lt;br /&gt;The format must include the – – – before the nn in order to specify the process group ID&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-3076911022594715058?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/3076911022594715058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/command-to-kill-process-group.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3076911022594715058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3076911022594715058'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/08/command-to-kill-process-group.html' title='command to kill a process group'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-980374835827460893</id><published>2009-06-06T18:10:00.004-07:00</published><updated>2009-06-06T18:55:30.696-07:00</updated><title type='text'>Ubuntu 9.04 resets resolution @ restart</title><content type='html'>Spent quite some time today trying to make this work. Installed Ubuntu 9.04 this AM and as expected it was not able to correctly detect the monitor resolution. Installed the latest NVidia drivers (180.44) from Synaptic package and was able to set the right resolution using "nvidia-settings" app. Before saving the configuration made sure that preview of "/etc/X11/xorg.conf" was showing as to what I had set. Restarted the system and the resolution was getting set back to "800x600". Applying a resolution using 'nvidia-settings" was still working in the session however @ logout/restart it would revert back to "800x600". Here's what all I tried and the final step that worked for me:&lt;br /&gt;&lt;br /&gt;1) The first question I had was whether nvidia drivers were being loaded at restart or not. One of the Ubuntu knowledge base suggested adding "nvidia" to "/etc/modules" such that it gets loaded at boot time but that didn't work.&lt;br /&gt;&lt;br /&gt;.... After many failed google searches I shifted my focus to looking at system logs for any clues......&lt;br /&gt;&lt;br /&gt;2) checked this log file after system startup "/var/log/gdm/:0.log" and it was complaining about error loading "type2" and "freetype" modules. I wasn't sure if this was causing the "xorg.comf" to fail so I manually disabled the load of these modules in the "xorg.conf" file under the section module like below. Did a restart but still the same situation however the log "/var/log/gdm/:0.log" was not showing the error this time.&lt;br /&gt;&lt;br /&gt;Section "Module"&lt;br /&gt;    Load           "dbe"&lt;br /&gt;    Load           "extmod"&lt;br /&gt;#    Load           "type1"&lt;br /&gt;#    Load           "freetype"&lt;br /&gt;    Load           "glx"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;2) Check log file "/var/log/Xorg.0.log". This log contains details on "xorg.conf" loading. Watchout for any errors in this log. In my case this log looked fine except the last line in the log file that said "[nvidia]: setting resolution 800x600". This baffled me. While the earlier lines in the log file correctly stated loading the correct resolution from 'xorg.conf', this last log line almost seemed like some another process was invoking at startup that was turning the resolution back to '800x600'. Googled around but no clue.&lt;br /&gt;&lt;br /&gt;... Took a walk at a park nearby as my brains was about to explode. &lt;br /&gt;&lt;br /&gt;3) Lot of sites/forums had samples of "xorg.conf" files from users whose system was working fine. Tried various of those but still no luck.&lt;br /&gt;&lt;br /&gt;4) &lt;span style="font-style:italic;"&gt;One of the forums post suggested this method. "System --&gt; Preferences --&gt; Display". Choosing that option prompts a question "It appears that your graphics driver does not support the necessary extensions to use this tool. Do you want to use your graphics driver vendor's tool instead?". if you click "yes" it takes you to the "nvidia-settings" tool. If you choose the "No" option, it allows choosing a resolution via the "Display Preferences" window. I select "No" and choose the desired resolution of "1280x1024" from the list and hit "Apply". As usual it worked in the session and voila!!!! it also worked after a restart. The resolution stayed @ "1280x1024".&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;Obviously there were a lot of other steps that I tried in vain but these seemed worth a note as they provide some clue as to what the issue might be. Hope this post helps.  &lt;br /&gt;&lt;br /&gt;my google searched keywords: Xorg.log nvidia 800x600, Ubuntu 9.04 resets resolution restart, ubuntu 9.04 stuck at 800x600, ubuntu 9.04 low graphics mode, ubuntu 9.04 loose settings on restart, ubuntu 9.04 lost screen resolution after restart&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-980374835827460893?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/980374835827460893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/06/ubuntu-904-resets-resolution-restart.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/980374835827460893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/980374835827460893'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/06/ubuntu-904-resets-resolution-restart.html' title='Ubuntu 9.04 resets resolution @ restart'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-2558767731590516750</id><published>2009-06-06T12:35:00.003-07:00</published><updated>2009-06-06T12:54:38.613-07:00</updated><title type='text'>Mac OSX Burn ISO Image</title><content type='html'>Here are the steps. &lt;br /&gt;&lt;br /&gt;1) Open Finder&lt;br /&gt;2) Browse "Application/Utilities"&lt;br /&gt;3) Open/double click Disk utility&lt;br /&gt;4) Click "Burn" icon on top. This will ask you to choose a ISO image&lt;br /&gt;5) Once selected it will ask to insert a CD and voila.&lt;br /&gt;&lt;br /&gt;Off course its easy but when you've been using Linux and Windows utilities for years, these steps can be a little perplexing and hard to remember. &lt;br /&gt;&lt;br /&gt;******************* screenshots **********************&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Wx-8OjwLTqs/SirJJjdD4MI/AAAAAAAAAEs/KXKSR_2ApQ0/s1600-h/burn_iso_123.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 295px;" src="http://2.bp.blogspot.com/_Wx-8OjwLTqs/SirJJjdD4MI/AAAAAAAAAEs/KXKSR_2ApQ0/s320/burn_iso_123.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5344305073801650370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Wx-8OjwLTqs/SirJJ77jjsI/AAAAAAAAAE0/1gKNO2tLJUk/s1600-h/burn_iso_4.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 198px;" src="http://3.bp.blogspot.com/_Wx-8OjwLTqs/SirJJ77jjsI/AAAAAAAAAE0/1gKNO2tLJUk/s320/burn_iso_4.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5344305080372006594" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Wx-8OjwLTqs/SirJKNCeTEI/AAAAAAAAAE8/mgUytVQQrUQ/s1600-h/burn_iso_5.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 198px;" src="http://3.bp.blogspot.com/_Wx-8OjwLTqs/SirJKNCeTEI/AAAAAAAAAE8/mgUytVQQrUQ/s320/burn_iso_5.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5344305084964424770" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-2558767731590516750?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/2558767731590516750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/06/mac-osx-burn-iso-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2558767731590516750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2558767731590516750'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/06/mac-osx-burn-iso-image.html' title='Mac OSX Burn ISO Image'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Wx-8OjwLTqs/SirJJjdD4MI/AAAAAAAAAEs/KXKSR_2ApQ0/s72-c/burn_iso_123.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-9129600553233628789</id><published>2009-01-28T10:52:00.007-07:00</published><updated>2009-01-28T11:05:30.434-07:00</updated><title type='text'>Perl Mysql DBI get deleted row count</title><content type='html'>Trying to capture the number of deleted rows when executing a delete statement was returning a "0E0". See below for the script details. What I found was that it was DBI's way of saying zero rows were deleted. The thing to know about DBI is that do() needs to return distinct values to distinguish the occurrence of an error from the case that no rows were affected, so it uses “undef” and “0E0”. The value “undef” indicates an error; it evaluates to false in a Boolean context. The string “0E0” indicates that no rows were affected; it evaluates to true in Boolean contexts but is treated as zero in numeric contexts. If do() returned 0 to indicate no rows were affected, that evaluates to false in a Booelan context and would be difficult from an error. You can do the following to display the row count correctly&lt;br /&gt;&lt;br /&gt;Error:&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 650px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;my $deleted = $conn-&gt;do("delete from employee where year between 1901 and 1910");&lt;br&gt;print "deleted $deleted rows.\n"; &lt;br&gt;&lt;br /&gt;The above would print "deleted 0E0 rows"&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 650px;"&gt;&lt;pre style="margin: 0;"&gt; &lt;br /&gt;my $deleted = $conn-&gt;do("delete from employee where year between 1901 and 1910");&lt;br&gt; printf "deleted %d rows.\n", $deleted; &lt;br /&gt;&lt;br /&gt;(OR)&lt;br /&gt;&lt;br /&gt;my $deleted += $conn-&gt;do("delete from employee where year between 1901 and 1910");&lt;br&gt;print "deleted $deleted rows.\n"; &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-9129600553233628789?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/9129600553233628789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/perl-mysql-dbi-get-deleted-row-count.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/9129600553233628789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/9129600553233628789'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/perl-mysql-dbi-get-deleted-row-count.html' title='Perl Mysql DBI get deleted row count'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-7233867550636536988</id><published>2009-01-26T11:33:00.006-07:00</published><updated>2009-01-26T12:20:42.933-07:00</updated><title type='text'>Adcenter Error Code 1514 : The Negative keywords requires partial match bid</title><content type='html'>Got this error when dealing with a keyword update through the Adcenter API. Its a shame that Microsoft has no documentation on this error and none the less anywhere on the internet, hence the drive to blog this. Here's a brief background on Adcenter Negative Keywords: &lt;br /&gt;&lt;br /&gt;http://msdn.microsoft.com/en-us/library/bb545038.aspx&lt;br /&gt;&lt;br /&gt;So what the error basically means is that "Negative keywords are only allowed on keywords that have a broad or phrase match bid specified". If you try to add/update a keyword with "Not Keywords" and only exact bid specified then you would get this error. In my case this was being caused by a different scenario. We use Apache Axis for our webservice calls and Axis treats a blank string as a valid content string when compared to a null string. So even if the "Not Keywords" was set to blank it was generating the "Negative Keyword" soap element. See below for SOAP source. In the soap below the broad and phrase bid is specified as 0's and the "NegativeKeywords" element is constructed making MSN think that there are negative keywords associated with this keyword and hence the error. I resolved this error by setting the string to NULL instead of a blank ("''").&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv=&amp;quot;http://schemas.xmlsoap.org/soap/envelope/&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Header&amp;gt;&amp;lt;ns1:ApplicationToken soapenv:actor=&amp;quot;http://schemas.xmlsoap.org/soap/actor/next&amp;quot; soapenv:mustUnderstand=&amp;quot;0&amp;quot; xmlns:ns1=&amp;quot;https://adcenter.microsoft.com/api/advertiser/v5&amp;quot;/&amp;gt;&amp;lt;ns2:DeveloperToken soapenv:actor=&amp;quot;http://schemas.xmlsoap.org/soap/actor/next&amp;quot; soapenv:mustUnderstand=&amp;quot;0&amp;quot; xmlns:ns2=&amp;quot;https://adcenter.microsoft.com/api/advertiser/v5&amp;quot;&amp;gt;&amp;lt;ns2:Value&amp;gt;xxxx&amp;lt;/ns2:Value&amp;gt;&amp;lt;/ns2:DeveloperToken&amp;gt;&amp;lt;ns3:UserCredentials soapenv:actor=&amp;quot;http://schemas.xmlsoap.org/soap/actor/next&amp;quot; soapenv:mustUnderstand=&amp;quot;0&amp;quot; xmlns:ns3=&amp;quot;https://adcenter.microsoft.com/api/advertiser/v5&amp;quot;&amp;gt;&amp;lt;ns3:Password&amp;gt;xxxxxx&amp;lt;/ns3:Password&amp;gt;&amp;lt;ns3:Username&amp;gt;xxxxx&amp;lt;/ns3:Username&amp;gt;&amp;lt;/ns3:UserCredentials&amp;gt;&amp;lt;/soapenv:Header&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Body&amp;gt;&lt;br /&gt;&amp;lt;UpdateKeywordsRequest xmlns=&amp;quot;https://adcenter.microsoft.com/api/advertiser/v5&amp;quot;&amp;gt;&amp;lt;AdGroupId&amp;gt;xxxxx&amp;lt;/AdGroupId&amp;gt;&amp;lt;Keywords&amp;gt;&lt;br /&gt;&amp;lt;Keyword&amp;gt;&amp;lt;BroadMatchBid&amp;gt;0.0&amp;lt;/BroadMatchBid&amp;gt;&amp;lt;ExactMatchBid&amp;gt;0.5&amp;lt;/ExactMatchBid&amp;gt;&amp;lt;Id&amp;gt;xxxxx&amp;lt;/Id&amp;gt;&amp;lt;NegativeKeywords&amp;gt;&amp;lt;ns4:string xmlns:ns4=&amp;quot;http://schemas.microsoft.com/2003/10/Serialization/Arrays&amp;quot;&amp;gt;&amp;lt;/ns4:string&amp;gt;&amp;lt;/NegativeKeywords&amp;gt;&amp;lt;Param1&amp;gt;xxxx&amp;lt;/Param1&amp;gt;&amp;lt;Param2&amp;gt;&amp;lt;/Param2&amp;gt;&amp;lt;Param3&amp;gt;&amp;lt;/Param3&amp;gt;&amp;lt;PhraseMatchBid&amp;gt;0.0&amp;lt;/PhraseMatchBid&amp;gt;&amp;lt;/Keyword&amp;gt;&lt;br /&gt;&amp;lt;Keyword&amp;gt;&amp;lt;BroadMatchBid&amp;gt;0.0&amp;lt;/BroadMatchBid&amp;gt;&amp;lt;ExactMatchBid&amp;gt;0.5&amp;lt;/ExactMatchBid&amp;gt;&amp;lt;Id&amp;gt;xxxxxx&amp;lt;/Id&amp;gt;&amp;lt;NegativeKeywords&amp;gt;&amp;lt;ns5:string xmlns:ns5=&amp;quot;http://schemas.microsoft.com/2003/10/Serialization/Arrays&amp;quot;&amp;gt;&amp;lt;/ns5:string&amp;gt;&amp;lt;/NegativeKeywords&amp;gt;&amp;lt;Param1&amp;gt;xxxxxxx&amp;lt;/Param1&amp;gt;&amp;lt;Param2&amp;gt;&amp;lt;/Param2&amp;gt;&amp;lt;Param3&amp;gt;&amp;lt;/Param3&amp;gt;&amp;lt;PhraseMatchBid&amp;gt;0.0&amp;lt;/PhraseMatchBid&amp;gt;&amp;lt;/Keyword&amp;gt;&lt;br /&gt;&amp;lt;/Keywords&amp;gt;&lt;br /&gt;&amp;lt;/UpdateKeywordsRequest&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Body&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&amp;gt; &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;s:Envelope xmlns:s=&amp;quot;http://schemas.xmlsoap.org/soap/envelope/&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;s:Body&amp;gt;&amp;lt;s:Fault&amp;gt;&amp;lt;faultcode&amp;gt;s:Client&amp;lt;/faultcode&amp;gt;&amp;lt;faultstring xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;Invalid client data. Check the SOAP fault details for more information&amp;lt;/faultstring&amp;gt;&lt;br /&gt;&amp;lt;detail&amp;gt;&lt;br /&gt;&amp;lt;EditorialApiFaultDetail xmlns=&amp;quot;https://adcenter.microsoft.com/api/advertiser/v5&amp;quot; xmlns:i=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;BatchErrors&amp;gt;&lt;br /&gt;&amp;lt;BatchError&amp;gt;&amp;lt;Code&amp;gt;1514&amp;lt;/Code&amp;gt;&amp;lt;Details i:nil=&amp;quot;true&amp;quot;/&amp;gt;&amp;lt;Index&amp;gt;0&amp;lt;/Index&amp;gt;&amp;lt;Message&amp;gt;The Negative keywords requires partial match bid.&amp;lt;/Message&amp;gt;&amp;lt;/BatchError&amp;gt;&lt;br /&gt;&amp;lt;BatchError&amp;gt;&amp;lt;Code&amp;gt;1514&amp;lt;/Code&amp;gt;&amp;lt;Details i:nil=&amp;quot;true&amp;quot;/&amp;gt;&amp;lt;Index&amp;gt;1&amp;lt;/Index&amp;gt;&amp;lt;Message&amp;gt;The Negative keywords requires partial match bid.&amp;lt;/Message&amp;gt;&amp;lt;/BatchError&amp;gt;&lt;br /&gt;&amp;lt;/BatchErrors&amp;gt;&lt;br /&gt;&amp;lt;OperationErrors/&amp;gt;&lt;br /&gt;&amp;lt;TrackingId&amp;gt;xxxxxxx&amp;lt;/TrackingId&amp;gt;&lt;br /&gt;&amp;lt;EditorialErrors/&amp;gt;&amp;lt;/EditorialApiFaultDetail&amp;gt;&lt;br /&gt;&amp;lt;/detail&amp;gt;&lt;br /&gt;&amp;lt;/s:Fault&amp;gt;&amp;lt;/s:Body&amp;gt;&lt;br /&gt;&amp;lt;/s:Envelope&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-7233867550636536988?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/7233867550636536988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/adcenter-error-code-1514-negative.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7233867550636536988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7233867550636536988'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/adcenter-error-code-1514-negative.html' title='Adcenter Error Code 1514 : The Negative keywords requires partial match bid'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-2174695316064575813</id><published>2009-01-20T14:44:00.004-07:00</published><updated>2009-01-20T14:52:27.193-07:00</updated><title type='text'>Mysql (errno: 13) can't find file frm</title><content type='html'>Recently got this error when I was trying to copy a database on to another server. I basically copied the mysql data directory for the corresponding database on to the new server and logged into mysql client.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 400px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;mysql&gt; select count(*) from placement; &lt;br /&gt;Can't find file: './main/placement.frm (errno: 13)&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Checked the mysql log and this was being reported for the all frm files for all tables in the db. Looks like this is a permission issue on the data directory. Changed to the following permissions and it seemed to work.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 300px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;server&gt; sudo chmod -R 660 main&lt;br /&gt;server&gt; sudo chmod 775 main&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-2174695316064575813?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/2174695316064575813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/mysql-errno-13-cant-find-file-frm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2174695316064575813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2174695316064575813'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/mysql-errno-13-cant-find-file-frm.html' title='Mysql (errno: 13) can&apos;t find file frm'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-6365793073106507173</id><published>2009-01-15T10:22:00.011-07:00</published><updated>2009-01-15T10:58:27.318-07:00</updated><title type='text'>DBD::mysql::db do failed: The used command is not allowed with this MySQL version</title><content type='html'>Our nightly etl process loads a whole lot of data from local files. The recent upgrade of mysql from 5.0.45 --&gt; 5.0.67 was throwing this error &lt;br /&gt;&lt;br /&gt;"DBD::mysql::db do failed: The used command is not allowed with this MySQL version" &lt;br /&gt;&lt;br /&gt;when using the mysql 'LOAD LOCAL FILE' command. We are not entirely sure if this is an issue caused by the mysql upgrade or an outdated perl DBD:Mysql module. MySQL server has the local_infile set to ON via a show variables command (see below) and user has the FILE permission to the local file. A reinstall of the DBD:Mysql module also did not resolve the issue.&lt;br&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 300px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;mysql&gt; show variables like 'local%';&lt;br /&gt;+---------------+-------+&lt;br /&gt;| Variable_name | Value |&lt;br /&gt;+---------------+-------+&lt;br /&gt;| local_infile  | ON    | &lt;br /&gt;+---------------+-------+&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Looking online we came through various links that suggested we needed to specify a option "mysql_local_infile" while connecting to mysql via the DBD:Mysql module. This seemed to resolve our issue.&lt;br&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;width: 500px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;use strict;&lt;br /&gt;use DBI;&lt;br /&gt;my $dsn = "DBI:mysql:mydb;mysql_local_infile=1"; &lt;br /&gt;my $user = "me";&lt;br /&gt;my $password = "secret";&lt;br /&gt;my $dbh = DBI-&gt;connect($dsn,$user,$password);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html&lt;br /&gt;http://www.perlmonks.org/?node_id=728472&lt;br /&gt;http://www.bigresource.com/MYSQL-LOAD-DATA-INFILE-command-to-import-a-text-f&lt;br /&gt;ile-rODHiNex.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-6365793073106507173?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/6365793073106507173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/dbdmysqldb-do-failed-used-command-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/6365793073106507173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/6365793073106507173'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/dbdmysqldb-do-failed-used-command-is.html' title='DBD::mysql::db do failed: The used command is not allowed with this MySQL version'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-7049011917592323629</id><published>2009-01-15T09:25:00.002-07:00</published><updated>2009-01-15T09:31:34.652-07:00</updated><title type='text'>DBD:Mysql warning statements "Use of uninitialized value in concatenation (.) or string"</title><content type='html'>We recently upgraded to the latest and greatest version of the DBD:Mysql perl module and have been seeing these warning statements in our logs a lot (believe me a whole lot to the point of annoyance for developers skimming through logs for debug help).&lt;br /&gt;&lt;br /&gt;Use of uninitialized value in concatenation (.) or string at /usr/local/perl/lib/site_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 929.&lt;br /&gt;&lt;br /&gt;For now we went ahead and commented the line no. 929 in the /usr/local/perl/lib/site_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm file and have seen no side effects of that. A fairly weak solution but works for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-7049011917592323629?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/7049011917592323629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/dbdmysql-warning-statements-use-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7049011917592323629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/7049011917592323629'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/dbdmysql-warning-statements-use-of.html' title='DBD:Mysql warning statements &quot;Use of uninitialized value in concatenation (.) or string&quot;'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-8695062529412355080</id><published>2009-01-07T17:09:00.005-07:00</published><updated>2009-01-07T17:38:54.169-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='home server ping won&apos;t respond'/><category scheme='http://www.blogger.com/atom/ns#' term='home server'/><title type='text'>setting up a home server</title><content type='html'>I am a software guy by profession and have been lately delving into some system ops at work. Been playing around with a home server for the last month or so mostly for learning purposes. Lots of questions and searching on the internet. Came across this book that is quite useful to understand some of the basics around setting up a home network. "Home Wireless Networking in a Snap (Sams Teach Yourself) (Paperback)" (http://www.amazon.com/gp/product/0672327023). I am a linux guy and although this book is based on setting a windows server, still the router related stuff applies everywhere. Came across this book when I was trying to resolve as to why my home server won't respond to ping although ssh and ftp works. DUH!!! the router is the public interface for the home network and the settings on the router was configured to not respond to ping requests. The WAN setup page on my netgear router has a setting "Allow Pinging of Router Internet Interface" that needs to be enabled. There are some other cool stuff that can be set on the WAN setup page. See description and picture below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Enable/Disable Firewall&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Select the appropriate check box or option button to turn on your router's firewall. Some routers (such as my Netgear router) have the firewall enabled by default, and the configuration page does not provide an enable option; it only allows you to disable the firewall by selecting Disable SPI Firewall. Disabling the firewall opens up your network to the possibility of outside attack. There is actually no good reason to disable the firewall, even if access to gaming or other services is a problem, because all connectivity issues can be resolved with port triggering and port forwarding settings&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Specify DMZ Server IP Address&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want to operate a computer or a server (such as a computer that is acting as a web server or a gaming server) outside the firewall, you can have the router place that computer in the DMZ. This means that the network is still protected from attack but that the DMZ computer could potentially be attacked. To place a computer on your network in the DMZ using a Netgear router, select the Default DMZ Server check box and then enter the IP address of the computer that will be placed in the DMZ. The DMZ isn't really a place; it is a virtual location configured by your WiFi router's firewall. The DMZ is a virtual place that resides between your protected internal network and the public Internet. Placing a computer in the DMZ allows it to communicate with the Internet without the router's firewall inspecting the data flowing to and from the computer. It is not uncommon for computers offering certain services to be placed in the DMZ. Even large corporations sometimes place communication servers in the DMZ so that they do not have to open ports on the firewall to allow access to the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Allow Pinging of Router Internet Interface&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By default, most WiFi routers are configured so that the router's interface or connection to the Internet cannot be pinged. The Internet interface for you router is actually assigned its IP address by your Internet service provider. So the Internet interface on the router is really its public interface. Allowing the public interface to be pinged can open the router up to attack since it can be "pinged to death." A malicious individual on the Internet could send a barrage of ping packets or oversized ping packets that would actually bring down the router's public interface. This kind of attack is called the "Ping of Death." Enable the router's Internet interface for pinging only if your Internet service provider (or you) needs to ping that interface to determine whether there is a connectivity problem. For my Netgear router, I select the Respond to Ping on Internet Port option to turn on this feature. When you have determined that the interface can be reached by a ping (from you or the ISP technician), I suggest that you disable the feature.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Set MTU Size&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Maximum Transmit Unit (MTU) value for Ethernet networks such as your WiFi network is 1500 bytes. Leave the MTU setting at the default unless your Internet service provider requires that a different setting be used. If you're unsure about the MTU value, contact your ISP. To change the MTU on my Netgear router, I click in the MTU text box and type a different value. Each router provides a slightly different configuration screen for setting the MTU. Your Internet service provider determines the optimal MTU for the network it services by trial and error. The only way you might perceive that you don't have the correct MTU setting for your ISP connection would be a slight slowing of the connection to the Internet—and this would only be in situations where your MTU is set higher than the ISP's and your data packets have to be broken into smaller chunks for transmission. So, bottom line, call your ISP and see whether it uses a special MTU setting.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Wx-8OjwLTqs/SWVJ_c7LuTI/AAAAAAAAABc/ryO6Yifjrlw/s1600-h/netger_router_wan_page.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 295px;" src="http://4.bp.blogspot.com/_Wx-8OjwLTqs/SWVJ_c7LuTI/AAAAAAAAABc/ryO6Yifjrlw/s400/netger_router_wan_page.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5288714691861526834"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-8695062529412355080?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/8695062529412355080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/setting-up-home-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8695062529412355080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8695062529412355080'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2009/01/setting-up-home-server.html' title='setting up a home server'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Wx-8OjwLTqs/SWVJ_c7LuTI/AAAAAAAAABc/ryO6Yifjrlw/s72-c/netger_router_wan_page.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-3151029828304124250</id><published>2008-12-29T08:58:00.003-07:00</published><updated>2008-12-29T09:08:26.132-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MI_MAX_POSSIBLE_KEY_BUFF'/><category scheme='http://www.blogger.com/atom/ns#' term='MI_MAX_KEY_LENGTH'/><category scheme='http://www.blogger.com/atom/ns#' term='latin utf-8 conversion'/><title type='text'>Mysql increase key length</title><content type='html'>We have recently been converting most of our databases from latin to UTF-8 and have encountered issues with smaller Mysql default keylength. Mysql by default allows a max key length of 1024 size. While it was quite a bit of work to change the current data to confirm to the key length, the easier way was to recompile the Mysql source with a custom key length. Here I will detail the steps to do that:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;wget http://www.percona.com/mysql/5.0.67-b7/source/mysql-5.0.67-percona-b7-src.tar.gz&lt;br /&gt;tar zxf mysql-5.0.67-percona-b7-src.tar.gz&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now you'll want to make the edits to the myisam.h file to use our longer key length instead of the default 1000 byte keylength. Below is a compare of the file before and after change:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;--- /tmp/myisam.h       2008-05-28 13:36:22.000000000 -0700&lt;br /&gt;+++ include/myisam.h    2007-03-15 14:15:41.000000000 -0700&lt;br /&gt;@@ -48,12 +49,12 @@&lt;br /&gt; #define MI_MAX_KEY                  MAX_INDEXES         /* Max allowed keys */&lt;br /&gt; #endif&lt;br /&gt; &lt;br /&gt;-#define MI_MAX_POSSIBLE_KEY_BUFF    (1024+6+6)      /* For myisam_chk */&lt;br /&gt;+#define MI_MAX_POSSIBLE_KEY_BUFF    (4096+6+6)      /* For myisam_chk */&lt;br /&gt; /*&lt;br /&gt;   The following defines can be increased if necessary.&lt;br /&gt;   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.&lt;br /&gt; */&lt;br /&gt;-#define MI_MAX_KEY_LENGTH           1000            /* Max length in bytes */&lt;br /&gt;+#define MI_MAX_KEY_LENGTH           4000            /* Max length in bytes */&lt;br /&gt; #define MI_MAX_KEY_SEG              16              /* Max segments for key */&lt;br /&gt; &lt;br /&gt; #define MI_MAX_KEY_BUFF  (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Next you'll need to run configure / make install&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;./configure --prefix={choose a name here like /tmp/mysql_mod}&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-3151029828304124250?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/3151029828304124250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/12/mysql-increase-key-length.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3151029828304124250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/3151029828304124250'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/12/mysql-increase-key-length.html' title='Mysql increase key length'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-2669980545408688254</id><published>2008-12-24T14:30:00.002-07:00</published><updated>2008-12-24T14:35:48.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='database timeout'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql stale connection issue'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql timeout'/><title type='text'>mysql timeout issue</title><content type='html'>The sys admins had recently changed the timeout on the firewalls to a fairly low value to deal with the excessive connections issue. This was causing an issue with the mysql servers as the nightly etl and scripts were failing with stale connection issue. Googled around to find a way to set the connection timeout in mysql settings but couldn't find any lead. One of our sys admins suggested we change the tcp timeout on the mysql boxes and that seems to have resolved the issue. here's the command:&lt;br /&gt;&lt;br /&gt;sudo /sbin/sysctl net.ipv4.tcp_keepalive_time=90&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-2669980545408688254?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/2669980545408688254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/12/mysql-timeout-issue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2669980545408688254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2669980545408688254'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/12/mysql-timeout-issue.html' title='mysql timeout issue'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-5195348507209167513</id><published>2008-11-26T14:32:00.003-07:00</published><updated>2008-11-26T15:17:51.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun beginner programming problems'/><title type='text'>Fairly Beginner Programming Excercises</title><content type='html'>I have been trying to teach programming to one of my friend and occasionally I search online for fun projects which I can give it to him as programming exercises. I will try to document the ones I gave him  with notes on what I intended him to learn from the exercise:&lt;br /&gt;&lt;br /&gt;******* Loops and Constructs ********&lt;br /&gt;&lt;br /&gt;1) Project 1: Print a pyramid. Read (in a loop of course) a number, n, and print a pyramid that has that size. The example below shows what would be printed for n=4.&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;            *&lt;br /&gt;           * *&lt;br /&gt;          * * *&lt;br /&gt;         * * * *&lt;br /&gt;&lt;br /&gt;2) Project 2: Printing prime numbers: This is more sort of a classic programming problem and involves knowledge of basic programming constructs such as conditions, looping etc.&lt;br /&gt;&lt;br /&gt;3) Project 3: Printing the first n fibonacci numbers. This is again a classic programming problem and involves knowledge of basic programming constructs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;******* Arrays ***********&lt;br /&gt;&lt;br /&gt;1) Project 1: Finding missing elements in a array. So basically a array is provided that has certain missing elements like numbers between 1 - 99. The task here is to find those missing numbers from the array. This project basically requires knowledge of arrays and array traversal.&lt;br /&gt;&lt;br /&gt;2) Project 3: Sorting a number array: This is again a classic programming problem and can be done in various ways. Knowledge gained here is again arrays.&lt;br /&gt;&lt;br /&gt;******* Hash *********&lt;br /&gt;&lt;br /&gt;1) Project 1: Parse a file and display words that occur more than n times. Not a requirement that you use a hash here but ideally you would.&lt;br /&gt;&lt;br /&gt;2) Project 2:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-5195348507209167513?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/5195348507209167513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/11/programming-excercises.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5195348507209167513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5195348507209167513'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/11/programming-excercises.html' title='Fairly Beginner Programming Excercises'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-8632112568727275914</id><published>2008-10-06T18:56:00.005-07:00</published><updated>2008-10-06T19:31:21.286-07:00</updated><title type='text'>C# Web Request Using Client Certificate</title><content type='html'>Recently worked on this project where a service was accessible over http via client certificate. This is no biggie however took me 4-5 hrs to figure it out as the issue was not with code associated with importing client certificate but with another portion of the code that I overlooked. You know how it goes, stupid mistakes here and there and boom there goes your day. Thinking that the error was with the client certificate code I searched through the anals of Google pages to figure it out and various attempts/learnings made a worth to blog out. BTW kudos to the Fiddler (http://www.fiddlertool.com/fiddler/) tool which allowed me to sniff the http outgoing traffic helping me debug the issue.&lt;br /&gt;&lt;br /&gt;So the http service I was trying to access is a secure one and my org was issued a client certificate. There are three ways that I tried to attach a client certificate with the request.&lt;br /&gt;&lt;br /&gt;1) Providing direct links to cert files: You can do this via this sample code. Pretty self explanatory. The additional cert you see below is the intermediate certificate agency cert that I had to additionally download.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;X509Certificate2Collection certCollect = new X509Certificate2Collection();&lt;br /&gt;&lt;br /&gt;X509Certificate2 cert = new X509Certificate2(@"C:\Users\...\x509_verisign-certificate.cer");&lt;br /&gt;&lt;br /&gt;X509Certificate2 cert1 = new X509Certificate2(@"C:\Users&lt;br /&gt;\..\Certificate_From_SErvice.cer.pfx", "{client certificate password}");&lt;br /&gt;&lt;br /&gt;certCollect.Add(cert);&lt;br /&gt;&lt;br /&gt;certCollect.Add(cert1);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2) Exported combined cert file (.cer.p7b format): If you have imported the client/intermediate certificate onto your computer then you can export combined certificate (with all intermediariy certificate) + private key into a .cer.p7b file format. You can use this one file instead of the two used above. Here the code to make it work:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;X509Certificate2Collection certCollect = new X509Certificate2Collection();&lt;br /&gt;&lt;br /&gt;FileInfo file = new FileInfo(@"C:\Users\...\exported_certificate.cer.p7b");&lt;br /&gt;&lt;br /&gt;BinaryReader br = new BinaryReader(File.OpenRead(file.FullName));&lt;br /&gt;&lt;br /&gt;byte[] raw = br.ReadBytes((int)file.Length);&lt;br /&gt;&lt;br /&gt;SignedCms cms = new SignedCms();&lt;br /&gt;&lt;br /&gt;cms.Decode(raw);&lt;br /&gt;&lt;br /&gt;certCollect.AddRange(cms.Certificates);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;   &lt;br /&gt;&lt;br /&gt;3) Referencing a imported certificate on the workstation: You can reference a imported certificate using the below code. There a various ways to uniquely identify a certificate using 'subject name' or 'serial id' etc. I have accessed it via the subject name. &lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;X509Store store = new X509Store("MY", StoreLocation.CurrentUser);&lt;br /&gt;&lt;br /&gt;store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);&lt;br /&gt;&lt;br /&gt;X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;&lt;br /&gt;&lt;br /&gt;X509Certificate2Collection fcollection = &lt;br /&gt;(X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "{certificate name}", false);&lt;br /&gt;&lt;br /&gt;X509Certificate2Collection icollection = &lt;br /&gt;(X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "VeriSign&lt;br /&gt;Class 1 Individual Subscriber CA - G2", false);&lt;br /&gt;&lt;br /&gt;X509Certificate2Enumerator certEnum = fcollection.GetEnumerator();&lt;br /&gt;&lt;br /&gt;certEnum.MoveNext();&lt;br /&gt;&lt;br /&gt;X509Certificate2 primCertFromStore = certEnum.Current;&lt;br /&gt;&lt;br /&gt;certEnum = icollection.GetEnumerator();&lt;br /&gt;&lt;br /&gt;certEnum.MoveNext();&lt;br /&gt;&lt;br /&gt;X509Certificate2 issuerCertFromStore = certEnum.Current;&lt;br /&gt;&lt;br /&gt;certCollect.Add(primCertFromStore);&lt;br /&gt;&lt;br /&gt;certCollect.Add(issuerCertFromStore);&lt;br /&gt;            &lt;br /&gt;// use the below code to test if the retrieved certificate is the one you intend to.&lt;br /&gt;//X509Certificate2UI.DisplayCertificate(primCertFromStore);&lt;br /&gt;//X509Certificate2UI.DisplayCertificate(issuerCertFromStore);&lt;br /&gt;store.Close();&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You can add the certificate to the request using the below code sample:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;.......&lt;br /&gt;// Handle any certificate errors on the certificate from the server.&lt;br /&gt;string uri = "request uri";&lt;br /&gt;&lt;br /&gt;HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);&lt;br /&gt;&lt;br /&gt;request.ProtocolVersion = HttpVersion.Version11;&lt;br /&gt;&lt;br /&gt;request.KeepAlive = true;    &lt;br /&gt;                              &lt;br /&gt;request.Method = "POST";&lt;br /&gt;            &lt;br /&gt;request.Accept = "*/*";      &lt;br /&gt;     &lt;br /&gt;request.ClientCertificates.AddRange(certCollect); &lt;br /&gt;                       &lt;br /&gt;string str = "POST DATA";&lt;br /&gt;&lt;br /&gt;byte[] postBytes = Encoding.UTF8.GetBytes(str);&lt;br /&gt;&lt;br /&gt;request.ContentType = "TEXT/XML";&lt;br /&gt;&lt;br /&gt;request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR &lt;br /&gt;2.0.50727; .NET CLR 1.1.4322; InfoPath.1)";&lt;br /&gt;            &lt;br /&gt;request.ContentLength = postBytes.Length;&lt;br /&gt;&lt;br /&gt;Stream requestStream = request.GetRequestStream();&lt;br /&gt;&lt;br /&gt;requestStream.Write(postBytes, 0, postBytes.Length);&lt;br /&gt;&lt;br /&gt;requestStream.Close();&lt;br /&gt;&lt;br /&gt;HttpWebResponse response = (HttpWebResponse)request.GetResponse();&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-8632112568727275914?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/8632112568727275914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/10/c-web-request-using-client-certificate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8632112568727275914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8632112568727275914'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/10/c-web-request-using-client-certificate.html' title='C# Web Request Using Client Certificate'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-2729864690936953898</id><published>2008-09-25T15:25:00.002-07:00</published><updated>2008-09-25T15:30:51.396-07:00</updated><title type='text'>MYSQL duplicate entry error with a non-unique index/key</title><content type='html'>This was a strange one. A insert was erroring out  due to duplicate entry error on a key that is non -unique. The error was: ERROR 1062 (23000): Duplicate entry '445982' for key 2. Did a check table to check if everything was alright and there it was: an error with the table. Repair quick did not work so had to do a full repair. See below log for query statements:&lt;br /&gt;&lt;br /&gt;Here's the log:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;mysql&gt; show create table tableA;&lt;br /&gt;&lt;br /&gt;......&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt; PRIMARY KEY  ("category_id"),&lt;br /&gt;  KEY "ix_campaign_category_unpacked_root" ("root_campaign_id"),&lt;br /&gt;  KEY "ix_campaign_category_client" ("client_id","site_id"),&lt;br /&gt;  KEY "ix_campaign_category_site" ("site_id","client_id")&lt;br /&gt;) ENGINE=MyISAM DEFAULT CHARSET=utf8 &lt;br /&gt;&lt;br /&gt;-- Error from insert&lt;br /&gt;&lt;br /&gt;mysql&gt; ERROR 1062 (23000): Duplicate entry '445982' for key 2&lt;br /&gt;&lt;br /&gt;-- check table result&lt;br /&gt;&lt;br /&gt;mysql&gt; check table tableA;&lt;br /&gt;+----------------------------------+-------+----------+--------------------------------------------------------------+&lt;br /&gt;| Table                            | Op    | Msg_type | Msg_text                                                     |&lt;br /&gt;+----------------------------------+-------+----------+--------------------------------------------------------------+&lt;br /&gt;| tableA | check | warning  | Table is marked as crashed                                   |&lt;br /&gt;| tableA | check | warning  | 2 clients are using or haven't closed the table properly     |&lt;br /&gt;| tableA | check | warning  | Size of datafile is: 34234576       Should be: 34234400      |&lt;br /&gt;| tableA | check | warning  | Found 0 deleted space in delete link chain. Should be 361132 |&lt;br /&gt;| tableA | check | error    | Found 0 deleted rows in delete link chain. Should be 2385    |&lt;br /&gt;| tableA | check | error    | record delete-link-chain corrupted                           |&lt;br /&gt;| tableA | check | error    | Corrupt                                                      |&lt;br /&gt;+----------------------------------+-------+----------+--------------------------------------------------------------+&lt;br /&gt;7 rows in set (0.00 sec)&lt;br /&gt; &lt;br /&gt;-- Repair table attempts&lt;br /&gt;&lt;br /&gt;mysql&gt; repair local table tableA quick;&lt;br /&gt;+----------------------------------+--------+----------+-------------------------------------------------------------------------------+&lt;br /&gt;| Table                            | Op     | Msg_type | Msg_text                                                                      |&lt;br /&gt;+----------------------------------+--------+----------+-------------------------------------------------------------------------------+&lt;br /&gt;| tableA | repair | error    | Couldn't fix table with quick recovery: Found wrong number of deleted records |&lt;br /&gt;| tableA | repair | error    | Run recovery again without -q                                                 |&lt;br /&gt;| tableA | repair | status   | OK                                                                            |&lt;br /&gt;+----------------------------------+--------+----------+-------------------------------------------------------------------------------+&lt;br /&gt;3 rows in set (9.64 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; repair local table tableA;&lt;br /&gt;+----------------------------------+--------+----------+----------+&lt;br /&gt;| Table                            | Op     | Msg_type | Msg_text |&lt;br /&gt;+----------------------------------+--------+----------+----------+&lt;br /&gt;| tableA | repair | status   | OK       |&lt;br /&gt;+----------------------------------+--------+----------+----------+&lt;br /&gt;1 row in set (2.43 sec)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-2729864690936953898?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/2729864690936953898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-entry-error-with-non.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2729864690936953898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/2729864690936953898'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-entry-error-with-non.html' title='MYSQL duplicate entry error with a non-unique index/key'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-5484078181756208085</id><published>2008-09-16T11:45:00.003-07:00</published><updated>2008-09-16T12:05:41.292-07:00</updated><title type='text'>Mysql duplicate entry error with auto-increment column</title><content type='html'>I have been looking at this issue with one of our tables where we were getting a duplicate entry error on key 1 which is basically the primary key on the table. The primary key field is set to auto-increment and was puzzling me as to why it was causing the duplicate entry. Ran the checks to ensure the values were right (see checks below):&lt;br /&gt;&lt;br /&gt;Someone suggested to alter the auto-increment value to a higher value and that would reset the next value. So I did a alter statement which took a while as the table was huge. The query to check the next ID value came out correctly (see below for query)&lt;br /&gt;&lt;br /&gt;However this still did not resolve the issue. Finally looked in the direction of index and turns out that index might have been corrupted. Ran a repair table to check index and that fixed the value. (see below for query)&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*********** checks ********************&lt;br /&gt;&lt;br /&gt;--  &lt;sql&gt; select max(id) from tableA;&lt;br /&gt;returned: 70809185&lt;br /&gt;&lt;br /&gt;-- &lt;sql&gt; insert into tableA values (xxxxxx);&lt;br /&gt;Error:  Duplicate entry '70809186' for key 1&lt;br /&gt;&lt;br /&gt;-- &lt;sql&gt; select * from tableA where id=70809186;&lt;br /&gt;Returned 0 rows&lt;br /&gt;&lt;br /&gt;************** alter index **************&lt;br /&gt;&lt;br /&gt;-- query to change the next increment value&lt;br /&gt;&lt;sql&gt; ALTER TABLE tbl AUTO_INCREMENT = 70809190;&lt;br /&gt;&lt;br /&gt;-- find out whats the next increment value&lt;br /&gt;&lt;sql&gt; SELECT Auto_increment FROM information_schema.tables WHERE table_name='tableA';&lt;br /&gt;&lt;br /&gt;************* repair index *****************&lt;br /&gt;&lt;br /&gt;-- &lt;sql&gt; repair table tableA quick;&lt;br /&gt;quick option repairs the indexes&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;/&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-5484078181756208085?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/5484078181756208085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-entry-error-with-auto.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5484078181756208085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/5484078181756208085'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-entry-error-with-auto.html' title='Mysql duplicate entry error with auto-increment column'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-4894903539163930949</id><published>2008-09-03T11:19:00.003-07:00</published><updated>2008-09-03T11:36:16.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql duplicate key sequence issue'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql duplicate key value exists'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql duplicate key error due to sequence issue'/><title type='text'>mysql duplicate key error due to sequence issue</title><content type='html'>I recently had to deal with this error so I am blogging it here so the rest can use. &lt;br /&gt;&lt;br /&gt;Error: On one of our tables we kept getting a duplicate key exception on insets. The puzzling thing was that the value actually did not exist in the table. Here's a low down:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;--- Table definition&lt;br /&gt;CREATE TABLE "job_message" (&lt;br /&gt;  "message_id" bigint(20) NOT NULL auto_increment,&lt;br /&gt;  "run_id" int(11) NOT NULL,&lt;br /&gt;  "object_id" bigint(20) default NULL,&lt;br /&gt;  "date" datetime NOT NULL,&lt;br /&gt;  "priority" tinyint(2) NOT NULL,&lt;br /&gt;  "type" varchar(32) default NULL,&lt;br /&gt;  "msg" varchar(255) NOT NULL,&lt;br /&gt;  "stack_trace" varchar(255) default NULL,&lt;br /&gt;  PRIMARY KEY  ("message_id"),&lt;br /&gt;  KEY "ix_job_message" ("run_id","object_id","date"),&lt;br /&gt;  KEY "ix_job_message_object_id" ("object_id"),&lt;br /&gt;  KEY "ix_job_message_dt" ("date")&lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- proof that row did not exist&lt;br /&gt;mysql&gt; select max(message_id) from job_message_200836;&lt;br /&gt;+-----------------+&lt;br /&gt;| max(message_id) |&lt;br /&gt;+-----------------+&lt;br /&gt;|       753222920 |&lt;br /&gt;+-----------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- error with insert statement&lt;br /&gt;mysql&gt; insert into job_message (run_id, object_id, date, priority, msg) values (1279408,&lt;br /&gt; 22231896, '2008-09-02 15:53:40', 4, 'test');&lt;br /&gt;&lt;br /&gt;ERROR 1062 (23000): Duplicate entry '753222922' for key 1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Thats what was puzzling.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;Did  a lot of googling around but got nothing. I did get some hint that the issue might be with the sequences and that the sequence is not updated but got no clue on how to resolve the issue. Out of desperation I tried to see if the table was healthy and voila there it was. The table was corrupted. The solution was to either repair the table or get a copy from the slave. I tried the repair and it worked fine. I used local in the repair command as I did not want the repair to propagate to slave as the slave copy was fine. See commands below to check and repair a table.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#f7f7f7;border: 1px solid #d7d7d7;margin: 1em 1.75em;padding: .25em;width: 780px;"&gt;&lt;pre style="margin: 0;"&gt;&lt;br /&gt;&lt;br /&gt;-- check table&lt;br /&gt;mysql&gt; check table job_message_200836;&lt;br /&gt;+-------------------------+-------+----------+-----------------------------------------------------------+&lt;br /&gt;| Table                   | Op    | Msg_type | Msg_text                                                  |&lt;br /&gt;+-------------------------+-------+----------+-----------------------------------------------------------+&lt;br /&gt;| main.job_message_200836 | check | warning  | Size of datafile is: 352975060       Should be: 352974784 |&lt;br /&gt;| main.job_message_200836 | check | error    | Found 3189125 keys of 3189124                             |&lt;br /&gt;| main.job_message_200836 | check | error    | Corrupt                                                   |&lt;br /&gt;+-------------------------+-------+----------+-----------------------------------------------------------+&lt;br /&gt;3 rows in set (0.69 sec)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- repair table command&lt;br /&gt;mysql&gt; repair local table job_message_200836;&lt;br /&gt;+-------------------------+--------+----------+------------------------------------------------+&lt;br /&gt;| Table                   | Op     | Msg_type | Msg_text                                       |&lt;br /&gt;+-------------------------+--------+----------+------------------------------------------------+&lt;br /&gt;| main.job_message_200836 | repair | warning  | Number of rows changed from 3189124 to 3189125 |&lt;br /&gt;| main.job_message_200836 | repair | status   | OK                                             |&lt;br /&gt;+-------------------------+--------+----------+------------------------------------------------+&lt;br /&gt;2 rows in set (29.93 sec)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-4894903539163930949?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/4894903539163930949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-key-error-due-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/4894903539163930949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/4894903539163930949'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/09/mysql-duplicate-key-error-due-to.html' title='mysql duplicate key error due to sequence issue'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-8920125656294224967</id><published>2008-07-27T18:26:00.002-07:00</published><updated>2008-07-27T18:39:48.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TwinView option disabled in Nvidia-Settings'/><title type='text'>TwinView option disabled in Nvidia-Settings</title><content type='html'>I am trying to configure dual monitors on my Ubuntu hardy however the 'Twinview' option is disabled in my settings. To enable this option you would have to tweak the 'xorg.conf' file. First of make a backup of the current '/etc/X11/xorg.conf' so you can always revert to this copy. Here are the instructions to modify the file to enable 'Twinview'&lt;br /&gt;&lt;br /&gt;- sudo gedit /etc/X11/xorg.conf&lt;br /&gt;- Search for line which says "Twinview" "0". Change the "0" to "1"&lt;br /&gt;- sudo nvidia-settings (now the nvidia driver should automatically detect the second connected screen)&lt;br /&gt;&lt;br /&gt;In looking online I also see this option however it did not work for me:&lt;br /&gt;&lt;br /&gt;- nvidia-xconfig --twinview&lt;br /&gt;and restarting your X server.&lt;br /&gt;&lt;br /&gt;There is a nice article on configuring twinview on the NVidia site: http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/README/appendix-g.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-8920125656294224967?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/8920125656294224967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/07/twinview-option-disabled-in-nvidia.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8920125656294224967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/8920125656294224967'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/07/twinview-option-disabled-in-nvidia.html' title='TwinView option disabled in Nvidia-Settings'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33560925.post-6450962099112347779</id><published>2008-07-27T18:20:00.002-07:00</published><updated>2008-07-27T18:25:38.134-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wicd won&apos;t automatically connect to wireless network'/><title type='text'>Wicd won't automatically connect to wireless network</title><content type='html'>I have been using Wicd on my Ubuntu for quite a while and never really bothered as to why it would not automatically connect to a specified network. Wicd provides an option to specify whether to automatically connect to a network. I finally figured out. You need to add Wicd to your system startup services for it to automatically connect. Here are the steps to do that:&lt;br /&gt;&lt;br /&gt;To get the tray icon to automatically appear at boot, go to System &gt; Preferences &gt; Sessions. In the "Startup Programs" tab, click the "New" button. Give it a name ("Wicd" works fine). For the command, enter "/opt/wicd/tray.py"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33560925-6450962099112347779?l=sudhirvn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudhirvn.blogspot.com/feeds/6450962099112347779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudhirvn.blogspot.com/2008/07/wicd-wont-automatically-connect-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/6450962099112347779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33560925/posts/default/6450962099112347779'/><link rel='alternate' type='text/html' href='http://sudhirvn.blogspot.com/2008/07/wicd-wont-automatically-connect-to.html' title='Wicd won&apos;t automatically connect to wireless network'/><author><name>Sudhir</name><uri>http://www.blogger.com/profile/09080281818875815184</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15268981428097519361'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>