<?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' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6714790391472726461</id><updated>2011-11-27T17:02:03.990-08:00</updated><category term='log4j'/><category term='products'/><category term='E-mails'/><category term='me'/><category term='mysql'/><category term='newbie blues'/><category term='derby'/><category term='logging utilities'/><category term='programming'/><category term='HTML'/><category term='AJAX'/><category term='web development'/><category term='pramati'/><category term='projects'/><category term='S3'/><category term='JavaScript'/><category term='Java'/><category term='tell-a-friend'/><category term='database'/><category term='web browsers'/><title type='text'>The F - Technology</title><subtitle type='html'>Why do most people suck?? Because thats what they are good at...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-2426712943241506905</id><published>2010-05-04T04:05:00.001-07:00</published><updated>2010-05-04T04:39:25.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Deleting MySQL Database log files</title><content type='html'>We have a master database and its slave database running on different nodes. The master DB is subjected to HUGE no. of inserts/updates because of which the log files written by it grew by enormous proportions (log files at one time occupied more than 80% of the disk space).&lt;br /&gt;&lt;br /&gt;Log files are important because using them we can track the changes made to the DB and in case of any DB crash, we can rebuild it again from the scratch. But in our case, we didn't require the log files and had the luxury to get rid of them instead of finding a reliable storage to keep them safe.&lt;br /&gt;&lt;br /&gt;We decided to go ahead with deleting the log files. We automated this process by setting a flag in configuration file so that MySQL automatically deleted the log files which are older than 90 days.&lt;br /&gt;&lt;br /&gt;This can be done as follows:&lt;br /&gt;&lt;br /&gt;1) Stop the Master MySQL server.&lt;br /&gt;&lt;br /&gt;2) Add the follwing parameter to the my.cnf file (here the figure on the right hand side is the no. of days after which the log file must be cleared)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;expire_logs_days = 90&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3) Start the server.&lt;br /&gt;&lt;br /&gt;Simple !!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Incase, you just need to delete the log files without automating the process then it can be done using the following command (use desired date value):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PURGE BINARY LOGS BEFORE '&lt;/span&gt;2010-05-03 14:56:23&lt;span style="font-weight: bold;"&gt;';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since the replication node uses the log files, we need to make sure we only delete files that were created before the logfile that the slave node is currently reading. We can get this data by using the following command on the slave database:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;show slave status;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command gives the details about the slave. The value of the column &lt;span style="font-style: italic;"&gt;'Master_Log_file'&lt;/span&gt; is the name of the log file currently being read by the slave. Once we have the name of this file, we can get its creation date. Lets assume the creation date was '2010-05-03 14:56:23'.  All log files created before this time can be deleted with the following command&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PURGE BINARY LOGS BEFORE '&lt;/span&gt;2010-05-03 14:56:23&lt;span style="font-weight: bold;"&gt;';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html"&gt;MySQL v5 documentation for purging log files&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-2426712943241506905?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/2426712943241506905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=2426712943241506905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/2426712943241506905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/2426712943241506905'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2010/05/deleting-mysql-database-log-files.html' title='Deleting MySQL Database log files'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-1739123653031873599</id><published>2009-07-02T00:18:00.000-07:00</published><updated>2009-07-08T22:15:29.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Move MySQL database location</title><content type='html'>MySQL DB might using some location as data repository where hard-disk space is limited. This will warrant moving the data from that location to some other location which can provide more room to accomodate the increasing data. Following steps can move this data to the new location:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;du -h : will show the memory parition of the current folder&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--&gt;&gt; Set the password for mysqlmanager (required if password is not set already).&lt;br /&gt;mysqlmanager --passwd &gt;&gt; /etc/mysqlmanager.passwd&lt;br /&gt;&lt;br /&gt;--&gt; log into mysql manager&lt;br /&gt;mysql -uroot -psh*pp@r --socket=/tmp/mysqlmanager.sock&lt;br /&gt;&lt;br /&gt;--&gt;&gt; kill all instances of mysql&lt;br /&gt;ps afx | grep mysql  //get process ids&lt;br /&gt;kill -9 4465  4473  4474 // kill those processes&lt;br /&gt;&lt;br /&gt;--&gt;&gt; create the directory where you want to transfer the files&lt;br /&gt;mkdir /mnt/mysql/marketingportal&lt;br /&gt;&lt;br /&gt;--&gt;&gt; Give mysql the ownership of the directory and its contents (presently they are owned ny root)&lt;br /&gt;chown -R mysql.mysql /mnt/mysql/            //mysql.mysql : group:user&lt;br /&gt;&lt;br /&gt;--&gt; Open the folder where the current data is&lt;br /&gt;cd mysql-marketingportal/&lt;br /&gt;&lt;br /&gt;--&gt; Copy this data to the new folder&lt;br /&gt;cp -R * /mnt/mysql/marketingportal/&lt;br /&gt;&lt;br /&gt;--&gt;&gt; Give mysql the ownership of the new directory and its contents (presently they are owned ny root)&lt;br /&gt;chown -R mysql.mysql /mnt/mysql/            //mysql.mysql : group:user&lt;br /&gt;&lt;br /&gt;--&gt;&gt; Change the name of the old directory (optional - this is done to make sure that it isn't beign used any longer)&lt;br /&gt;mv mysql-marketingportal/ mysql-marketingportal-old/&lt;br /&gt;&lt;br /&gt;--&gt;&gt; edit the my.cnf file&lt;br /&gt;change the value of datadir&lt;br /&gt;&lt;br /&gt;--&gt;&gt; Start the mysqlmanager&lt;br /&gt;nohup mysqlmanager --user=mysql &gt; mysqlmanager.out &amp;amp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-1739123653031873599?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/1739123653031873599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=1739123653031873599' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/1739123653031873599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/1739123653031873599'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2009/07/move-mysql-database-location.html' title='Move MySQL database location'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-4895834148384599312</id><published>2009-02-22T09:32:00.000-08:00</published><updated>2009-02-22T10:14:58.629-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>High Performance Database Tips</title><content type='html'>Some Database mantras discovered on the basis of practical experience.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Use the smallest datatype possible.&lt;/span&gt; eg. where a integer can take care of all possible states, don't use bigint. Every bit of extra space alloted will make the DB to grow in size without any actual utility, and there by taking toll on the performance&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Choose what to index and how much to index.&lt;/span&gt; Indexing is creating a meta data of data. If data is being fetched on the basis of a particular attribute, make that attribute an index. It would will definitely boost-up the reads and updates. Also, keep in mind that indexing increases the insert time and these meta-data information do  occupy disk space. Partial Indexing is a good way to create indexes not the on the complete field, but the deciding part of it. eg. Index can be created for the first few character's URLs if data to be fetched is on the basis of host name.   &lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Choose storage engine wisely&lt;/span&gt;. eg. If the DB is not relational, go for MyISAM. Read the pros-cons of each engine before choosing one.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Controlled Data Redundancy.&lt;/span&gt; Higher the normalisation of a DB, lesser is the redundancy. But, one think to keep in mind is that retrieving data from such a DB might require joining of tables, which is a very expensive operation. If the size of DB is huge or if the data to be fetched is distributed across a significant no. of tables, then performance will take the hit. One has to make a educated choice between space and performance. My experience tells me that a bit of redudancy isn't that bad !&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Fetch only relevant data.&lt;/span&gt; If you require some fields of a table(s), retrieve only those fields. Don't do a 'select *'.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Better programming logic&lt;/span&gt;: When programitically accessing DB use reuse connections. eg. If on the same DB schema, we need to fire 2 quries to retrive logical/related set of data, try using the same connection. Creating connection is costly. Also, Make sure to close all connections when use is over.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Don't run all servers on the same node.&lt;/span&gt; If application receives a huge no. of hits, and also tremendous DB operations are taking place in the DB (like huge no. of inserts/read/writes), its better to host the application on a node diffrerent from the DB. There is only so much a single node can handle.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-4895834148384599312?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/4895834148384599312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=4895834148384599312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/4895834148384599312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/4895834148384599312'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2009/02/high-performance-database-tips.html' title='High Performance Database Tips'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-393663777367107159</id><published>2009-01-22T22:25:00.001-08:00</published><updated>2009-01-22T22:28:59.273-08:00</updated><title type='text'>Write SQL query output on file</title><content type='html'>&lt;span style="font-style: italic;"&gt;Query&lt;/span&gt; into outfile '&lt;span style="font-style: italic;"&gt;filename&lt;/span&gt;';&lt;br /&gt;&lt;br /&gt;Query - query to be fired&lt;br /&gt;filename - name of the file on which the data is to be written.  Full path can also be given. Make sure that the folder is already in existence.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;eg. select * from HOTEL_DETAILS into outfile 'C:/datafolder/sqldata.txt';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Further Reading:&lt;br /&gt;&lt;a href="http://gilfster.blogspot.com/2005/11/writing-sql-results-to-file.html"&gt;http://gilfster.blogspot.com/2005/11/writing-sql-results-to-file.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-393663777367107159?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/393663777367107159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=393663777367107159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/393663777367107159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/393663777367107159'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2009/01/write-sql-query-output-on-file.html' title='Write SQL query output on file'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-5174199917528321262</id><published>2008-12-03T22:18:00.000-08:00</published><updated>2009-02-04T02:47:17.242-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>MySQL Table and Schema Size</title><content type='html'>I found these 2 commands for finding the size of a table or whole schema on MySQL mailing list (unable to recollect the URL)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Query To Find the size of a schema&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#Query to find the size of a database schema (replace YOUR_SCHEMA_NAME with appropriate name)&lt;br /&gt;&lt;br /&gt;#Run this query without selecting any schema&lt;br /&gt;&lt;br /&gt;SELECT s.schema_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+SUM(t.index_length)) /1024/1024,2),0.00),"Mb") total_size, CONCAT(IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free))/1024/1024,2),0.00),"Mb") data_used, CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),"Mb") data_free, IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free))  /((SUM(t.data_length)+SUM(t.index_length)))*100),2),0) pct_used, COUNT(table_name) total_tables FROM INFORMATION_SCHEMA.SCHEMATA s LEFT JOIN INFORMATION_SCHEMA.TABLES t ON s.schema_name = t.table_schema WHERE s.schema_name = "YOUR_SCHEMA_NAME" GROUP BY s.schema_name ORDER BY pct_used DESC\G;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Query To Find the size of a table&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# Query to find size of a particular table (replace YOUR_TABLE_NAME with appropriate name)&lt;br /&gt;&lt;br /&gt;# Run this after choosing the schema&lt;br /&gt;&lt;br /&gt;show table status like 'YOUR_TABLE_NAME'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-5174199917528321262?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/5174199917528321262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=5174199917528321262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/5174199917528321262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/5174199917528321262'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/12/table-and-schema-size.html' title='MySQL Table and Schema Size'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-7860303832034786436</id><published>2008-09-18T21:54:00.000-07:00</published><updated>2008-09-18T22:10:20.901-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S3'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='logging utilities'/><title type='text'>Get log files from S3 that were generated within a given timeframe</title><content type='html'>Amazon S3 log files are named as:&lt;br /&gt;&lt;br /&gt;TargetPrefix-YYYY-MM-DD-HH-MM-SS-UniqueNumber&lt;br /&gt;&lt;br /&gt;TargetPrefix is what we chose&lt;br /&gt;YYYY-MM-DD-HH-MM-SS is the timestamp&lt;br /&gt;UniqueNumber is something we should not care about&lt;br /&gt;&lt;br /&gt;S3 returns a list of Objects (files) in S3 bucket if give give them the desired prefix.&lt;br /&gt;&lt;br /&gt;Now, to get a list of log files that were created within a specific timeframe, we can use the following Algo:&lt;br /&gt;&lt;br /&gt;beginTime :  YYYY-MM-DD-10:25:15&lt;br /&gt;endTime 13:00:00&lt;br /&gt;&lt;br /&gt;1) get all files with prefix YYYY-MM-DD-10-25-16 to YYYY-MM-DD-10:25:59&lt;br /&gt;2) get all files with prefix YYYY-MM-DD-10-26 to YYYY-MM-DD-10:59&lt;br /&gt;3) get all files with prefix YYYY-MM-DD-12&lt;br /&gt;3) get all files with prefix YYYY-MM-DD-13&lt;br /&gt;&lt;br /&gt;One can further optimise the algorith to get files on 'day of the month' basis. But, that would not be a good idea because the list of files received from S# will be very long.&lt;br /&gt;&lt;br /&gt;Following is a Java method for the implementation of the above logic&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/**&lt;br /&gt; * Retuns a List of targetprefix. List is from (beginTime + 1 second) to the&lt;br /&gt; * hour value of endtime. Minute and second value of endTime is ignored.&lt;br /&gt; * &lt;br /&gt; * @param dbLogTime&lt;br /&gt; * @param beginTime&lt;br /&gt; * @return&lt;br /&gt; */&lt;br /&gt;public List&lt;String&gt; getPrefixList(Timestamp beginTime, Timestamp endTime, String targetPrefix) {&lt;br /&gt; List&lt;String&gt; prefixList = new ArrayList&lt;String&gt;();&lt;br /&gt;&lt;br /&gt; SimpleDateFormat sdfhr = new SimpleDateFormat("yyyy-MM-dd-HH");&lt;br /&gt; SimpleDateFormat sdfmin = new SimpleDateFormat("yyyy-MM-dd-HH-mm");&lt;br /&gt; SimpleDateFormat sdfsec = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");&lt;br /&gt;&lt;br /&gt; Calendar beginCal = Calendar.getInstance();&lt;br /&gt; beginCal.setTimeInMillis(beginTime.getTime());&lt;br /&gt; beginCal.set(Calendar.MILLISECOND, 0);&lt;br /&gt;&lt;br /&gt; Calendar endCal = Calendar.getInstance();&lt;br /&gt; endCal.setTimeInMillis(endTime.getTime());&lt;br /&gt; endCal.set(Calendar.MINUTE, 0);&lt;br /&gt; endCal.set(Calendar.SECOND, 0);&lt;br /&gt; endCal.set(Calendar.MILLISECOND, 0);&lt;br /&gt;&lt;br /&gt; if (endCal.compareTo(beginCal) &lt; 0) {&lt;br /&gt;  logger.error("Error: Current Time cannot be less than the time in LAST_PROCESS_TIME. currentCal: "&lt;br /&gt;    + sdfsec.format(endCal.getTime()) + ". lastProcessTime: " + sdfsec.format(beginCal.getTime()));&lt;br /&gt;  return prefixList;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; beginCal.add(Calendar.SECOND, 1);&lt;br /&gt; while (!(beginCal.get(Calendar.SECOND) == 0)) {&lt;br /&gt;  prefixList.add(targetPrefix + "-" + sdfsec.format(beginCal.getTime()));&lt;br /&gt;  beginCal.add(Calendar.SECOND, 1);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; if (endCal.compareTo(beginCal) &gt; 0) {&lt;br /&gt;  while (!(beginCal.get(Calendar.MINUTE) == 0)) {&lt;br /&gt;   prefixList.add(targetPrefix + "-" + sdfmin.format(beginCal.getTime()));&lt;br /&gt;   beginCal.add(Calendar.MINUTE, 1);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; while (endCal.compareTo(beginCal) &gt;= 0) {&lt;br /&gt;  prefixList.add(targetPrefix + "-" + sdfhr.format(beginCal.getTime()));&lt;br /&gt;  beginCal.add(Calendar.HOUR_OF_DAY, 1);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return prefixList;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-7860303832034786436?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/7860303832034786436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=7860303832034786436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/7860303832034786436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/7860303832034786436'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/09/get-log-files-from-s3-that-were.html' title='Get log files from S3 that were generated within a given timeframe'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-60458496364762011</id><published>2008-09-11T02:38:00.000-07:00</published><updated>2008-11-23T22:24:35.997-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='log4j'/><category scheme='http://www.blogger.com/atom/ns#' term='logging utilities'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Ignore log4j logger statements for specific classes</title><content type='html'>We use certain 3rd party libraries and while development, we might want to log statements that has been generated from our application and not the third party library.&lt;br /&gt;&lt;br /&gt;To set the log level of log requests from  such libraries, put the following snippet in log4j.xml file.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;logger name="org.thirdpartlib"&amp;gt;&lt;br /&gt;    &amp;lt;!-- Print only messages of  level warn or above in the package &amp;lt;span style="font-style: italic;"&amp;gt;thirdpartlib&amp;lt;/span&amp;gt;--&amp;gt;&lt;br /&gt;      &amp;lt;level value="WARN"/&amp;gt;&lt;br /&gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Replace &lt;span style="font-style: italic;"&gt;org.thirdpartylib&lt;/span&gt; with appropriate value. That should be do the magic.&lt;br /&gt;&lt;br /&gt;PS: &lt;span style="font-style: italic;"&gt;org.thirdpartlib.*&lt;/span&gt; won't work.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-60458496364762011?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/60458496364762011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=60458496364762011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/60458496364762011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/60458496364762011'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/09/ignore-log4j-logger-statements-for.html' title='Ignore log4j logger statements for specific classes'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-575762025882733516</id><published>2008-08-31T22:38:00.000-07:00</published><updated>2010-05-06T06:31:23.845-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>MySQL database dump</title><content type='html'>&lt;span style="font-weight: bold;"&gt;How to take MySQL database dump:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mysqldump -h&lt;span style="font-style: italic;"&gt;hostname&lt;/span&gt;-u&lt;span style="font-style: italic;"&gt;username&lt;/span&gt; -p&lt;span style="font-style: italic;"&gt;password&lt;/span&gt; &lt;span style="font-style: italic;"&gt;schemaname&lt;/span&gt; &lt;span style="font-style: italic;"&gt;tablename&lt;/span&gt; (contents will be printed on the console)&lt;br /&gt;&lt;br /&gt;mysqldump -h&lt;span style="font-style: italic;"&gt;hostname&lt;/span&gt; -u&lt;span style="font-style: italic;"&gt;username&lt;/span&gt; -p&lt;span style="font-style: italic;"&gt;password&lt;/span&gt; &lt;span style="font-style: italic;"&gt;schemaname&lt;/span&gt; &lt;span style="font-style: italic;"&gt;tablename&lt;/span&gt;&gt; &lt;span style="font-style: italic;"&gt;filename &lt;/span&gt;(contents will be written on file)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;hostname&lt;/span&gt;: name of the host. If the db is on your local system, then this might not be needed&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;schemaname&lt;/span&gt;: name of the schema which you want to back up&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;tablename&lt;/span&gt;: name of the table  which you want to back up&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;filename&lt;/span&gt;: name of the file which will hold the dump. You can specify the location of the file too. Eg. C:\sql\testsqldump.sql. If 'sql' directory doesn't exist and error will be generated.&lt;br /&gt;&lt;br /&gt;eg. mysqldump -uroot -padmin userinfo_schema USER_TABLE &gt; D:\sql\userinfo.sql&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;If you don't provide the tablename, then the dump of whole schema will be taken.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To take dump of all the schema&lt;br /&gt;mysqldump -uroot -padmin --all-databases &gt; filename&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To populate the MySQL database:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mysql  -u&lt;span style="font-style: italic;"&gt;username&lt;/span&gt; -p&lt;span style="font-style: italic;"&gt;password&lt;/span&gt; &lt;span style="font-style: italic;"&gt;schemaname&lt;/span&gt; &lt;  &lt;span style="font-style: italic;"&gt;filename&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;filename&lt;/span&gt;: name of the file that contains the mysqldump&lt;br /&gt;&lt;br /&gt;eg. mysql -uroot -padmin userinfo_schema &lt; D:\sql\userinfo.sql&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-575762025882733516?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/575762025882733516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=575762025882733516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/575762025882733516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/575762025882733516'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/08/mysqldump.html' title='MySQL database dump'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-8715635979725148906</id><published>2008-07-31T22:57:00.000-07:00</published><updated>2008-07-31T23:26:38.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><category scheme='http://www.blogger.com/atom/ns#' term='projects'/><category scheme='http://www.blogger.com/atom/ns#' term='tell-a-friend'/><category scheme='http://www.blogger.com/atom/ns#' term='me'/><category scheme='http://www.blogger.com/atom/ns#' term='products'/><category scheme='http://www.blogger.com/atom/ns#' term='pramati'/><title type='text'>TaF Public release</title><content type='html'>We are now releasing Tell-A-Friend widget for public use.&lt;br /&gt;&lt;br /&gt;One of the features that makes this widget stand apart from rest of the widgets is that, if you wish to change the  design of the buttons (be it the color, size or appearance), you don't have to embed a new or modified code in your webpage/blog. This helps save a lot of copy-paste exercise, which is kinda a welcome feature for lazy bums like me. All one has to do it to go to the accounts page, choose the kinda button they like, save the changes and then its all Eureka. All the changes are instantly reflected in the blogsite/webpage where TaF is embedded. Now, isn't this something cool ??&lt;br /&gt;&lt;br /&gt;Apart from wiring a few connectors in the TaF widget, I worked on the analytics collection module. This was a pretty good learning exercise. I got to know more about the Apache log4j utility. These Apache guys are real bonds. They write some pretty good stuff.&lt;br /&gt;&lt;br /&gt;For analytics collections, I wrote a custom JDBC appender to log all data. This has many advantages.&lt;br /&gt;&lt;br /&gt;1)  It consumes only a limited database connections.&lt;br /&gt;2) Requests are served on first-come-first-serve basis. So, everything is sequential in nature in accordance to time. (log4j uses a queue)&lt;br /&gt;&lt;br /&gt;But then, there are possible pitfalls too !!&lt;br /&gt;Imagine that there are many requests,  this will increase the queue size, thus increasing the response time. As of now, we have tested our infrastructure for traffics much more than we are expecting. If anyhow, response time does gets a beating, switching to a distributed system would be a possible solution which I suppose would require a bit of tweaking.&lt;br /&gt;&lt;br /&gt;May be I will soon write another post on how to write custom JDBC appender and on analytics collection framework of works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-8715635979725148906?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/8715635979725148906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=8715635979725148906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8715635979725148906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8715635979725148906'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/07/taf-public-release.html' title='TaF Public release'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-4270052072945986492</id><published>2008-05-30T07:16:00.000-07:00</published><updated>2008-08-12T03:15:46.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='projects'/><category scheme='http://www.blogger.com/atom/ns#' term='tell-a-friend'/><category scheme='http://www.blogger.com/atom/ns#' term='me'/><category scheme='http://www.blogger.com/atom/ns#' term='products'/><category scheme='http://www.blogger.com/atom/ns#' term='pramati'/><title type='text'>Tell-a-Friend</title><content type='html'>&lt;div id="codeSnippet" class="code" style="padding: 3px; width: 90%; background-color: rgb(255, 255, 255);"&gt;Tell-a-Friend or TaF (as we developers call it) is a new product from Pramati Technology, Hyderabad&lt;br /&gt;&lt;br /&gt;Its something to aid 'spread the word around the world'. Just click on it and instantly  announce things to your near &amp;amp; dear ones. So, you can announce your blog posts, articles, products on sale etc. through IM, Email, Blogs and Social Networks(like Facebook and Twitter) through a single integrated interface. So, its kinda like a single window to  multiple channels to make a million announcements. So, it will bring more clicks to your weblog / website and help market your articles/products.&lt;br /&gt;&lt;br /&gt;When Sunny showed me the TaF button embedded in Nina's blog (ya...thats our test blog), I could see foretell that this product could actually become a rage. Intel Mashmaker, CatchFlix and BigScreen are already using it/used it. But, now any one  can integrate TaF in their website/blog for the following 2 divine reasons:&lt;br /&gt;1) The free version is absolutely free :P (and one day beer shall also be free)&lt;br /&gt;2) All it takes is embedding a code snippet in the page where the TaF icon is to be displayed.&lt;br /&gt;&lt;br /&gt;Hope I see the TaF icons weblogs alongside dig.com, stumble upon etc. icons. After all, it always feels nice to see people use and talk about something that has your code :P.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://75.101.222.129/ops/js/shoppr.core.js"&gt;&lt;/script&gt;TaF extensively employs JAVA, JAVASCRIPT, DOJO and AJAX.  The widget opens up in an iframe and seemlessly gives a web2.0 feel to the page. We are working to further boost its performance by using CSS sprites, decreasing the number of http request/response and fine-tuning the backend. A rework on its look-and-feel is also being undertaken. So, with time, its gonna become all the more difficult to ignore it and impossible to resist not having it on your page :)  &lt;div id="shopprstream-taf-0000000000"&gt;&lt;/div&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/6714790391472726461-4270052072945986492?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/4270052072945986492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=4270052072945986492' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/4270052072945986492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/4270052072945986492'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/05/tell-friend.html' title='Tell-a-Friend'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-8071740078766108662</id><published>2008-01-21T09:53:00.000-08:00</published><updated>2008-06-02T02:44:30.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='newbie blues'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>JSON and HashMap</title><content type='html'>&lt;a href="http://www.directwebremoting.com/"&gt;DWR &lt;/a&gt;is used for easy 'AJAX for JAVA'  and is employed to call Java methods from Javascript  (version 2.0 + supports reverse-AJAX too).&lt;br /&gt;&lt;br /&gt;Working on the &lt;a href="http://www.shopprstream.com/"&gt;ShopprStream&lt;/a&gt;(earlier known as WEB122)  has helped me get acquainted with many facets of web-development.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now I have a Java method that returns a generic HashMap object ;&lt;br /&gt;For this example lets consider that the key is of type &lt;span style="color: rgb(51, 102, 255); font-style: italic;"&gt;String&lt;/span&gt;&lt;br /&gt;&lt;string, arraylist=""&gt;&lt;contactdetail&gt;And the elements are instances of the class CustomClass with name (of type &lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;String&lt;/span&gt;) as instance variable&lt;br /&gt;&lt;br /&gt;The DWR call will return a JSON object. This is how we can access the dat&lt;/contactdetail&gt;&lt;/string,&gt;&lt;span&gt;&lt;hashmap[key].length;&gt;a&lt;br /&gt;&lt;br /&gt;&lt;/hashmap[key].length;&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;for (var key in hashMap)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    &lt;span style="color: rgb(51, 204, 0);"&gt; //if not using Firebug, comment out console.log statements&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 0);"&gt;     //'key' is the key in the HashMap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;     console.log("key : "+ key);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;          &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    &lt;span style="color: rgb(51, 204, 0);"&gt;//this will give the no. of elements stored corresponding to the 'key'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    console.log("hashMap[key].length: "+ hashMap[key].length);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    &lt;span style="color: rgb(51, 204, 0);"&gt;//Access individual elements corresponding to the 'key'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    for(var i=0; i&amp;lt;hashMap[key].length; i++)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    console.log("hashMap[key][i].name: " + hashMap[key][i].name);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If the HashMap contains custom objects, make sure it has a corresponding converter entry in the dwr.xml file&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;hashmap[key].length;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/hashmap[key].length;&gt;&lt;/span&gt;&lt;span&gt;&lt;hashmap[key].length;&gt;for example, if my class is called CustomClass, then write as&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;convert converter="bean" match=""&gt;&lt;/convert&gt;&lt;/span&gt;&lt;/hashmap[key].length;&gt;&lt;span&gt;&lt;convert converter="bean" match=""&gt;&lt;/convert&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&amp;lt;convert converter="bean" match="com.pramati.web122.imsupport.ContactDetail"/&amp;gt;&lt;/span&gt;&lt;string, arraylist=""&gt;&lt;contactdetail&gt;&lt;span&gt;&lt;string, arraylist=""&gt;&lt;contactdetail&gt;&lt;br /&gt;&lt;br /&gt;Here,  abc.xyz is the package structure&lt;br /&gt;&lt;br /&gt;If object returned is hashmap&lt;string,string&gt;, then values can be accessed as:&lt;br /&gt;hasMap[key]&lt;br /&gt;&lt;br /&gt;&lt;/string,string&gt;&lt;/contactdetail&gt;&lt;/string,&gt;&lt;/span&gt;&lt;/contactdetail&gt;&lt;/string,&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;If object returned is hashmap&lt;string,string[]&gt;, then values can be accessed as:&lt;br /&gt;hasMap[key][0], &lt;/string,string[]&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; hasMap[key][1], &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; hasMap[key][2] . . . . . &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;string, arraylist=""&gt;&lt;contactdetail&gt;&lt;span&gt;&lt;string, arraylist=""&gt;&lt;contactdetail&gt;&lt;br /&gt;&lt;/contactdetail&gt;&lt;/string,&gt;&lt;/span&gt;&lt;/contactdetail&gt;&lt;/string,&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-8071740078766108662?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/8071740078766108662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=8071740078766108662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8071740078766108662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8071740078766108662'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/01/json-and-hashmap.html' title='JSON and HashMap'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-3403546678293421761</id><published>2008-01-17T02:43:00.000-08:00</published><updated>2008-01-17T02:59:46.283-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Helpful JavaScripts</title><content type='html'>&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;To bring focus to a text box / button or any other element&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;just add this javascript in the HTML code:&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;   document.getElementById("elementId").focus();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;where &lt;/span&gt;&lt;span style="font-style: italic;font-family:Verdana,Arial;font-size:85%;"  &gt;elementId&lt;/span&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt; the id of the element on which the focus is to be set&lt;br /&gt;&lt;br /&gt;for example, the following code will bring focus to the textbox that has the id &lt;span style="font-style: italic;"&gt;email&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt;&lt;pre&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt;&amp;lt;input type="text" id="email" /&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;   document.getElementById("email").focus();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana,Arial;font-size:85%;"  &gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-3403546678293421761?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/3403546678293421761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=3403546678293421761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/3403546678293421761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/3403546678293421761'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2008/01/helpful-javascripts.html' title='Helpful JavaScripts'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-302774610142110095</id><published>2007-12-05T21:11:00.000-08:00</published><updated>2007-12-05T22:06:08.858-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='E-mails'/><title type='text'>Fake Mail</title><content type='html'>One can send mails using JAVA Mail API. It is fairly simple to use this library to send mails.&lt;br /&gt;&lt;br /&gt;First download the &lt;a href="http://java.sun.com/products/javamail/downloads/index.html"&gt;JAVA Mail API&lt;/a&gt;, and add &lt;span style="color: rgb(51, 51, 255); font-weight: bold; font-style: italic;"&gt;mail.jar&lt;/span&gt; to your classpath&lt;br /&gt;Then download, &lt;a href="http://java.sun.com/products/javabeans/jaf/downloads/index.html"&gt;JAF API&lt;/a&gt;, and add &lt;span style="color: rgb(51, 51, 255); font-weight: bold; font-style: italic;"&gt;activation.jar&lt;/span&gt; to your classpath&lt;br /&gt;&lt;br /&gt;Following is the simple code:&lt;br /&gt;&lt;br /&gt;Java Class: TestMail.java&lt;br /&gt;&lt;pre&gt;&lt;pre&gt;&lt;span style="font-family:mon;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;import java.io.*;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;import java.util.Date;&lt;br /&gt;import javax.mail.*;&lt;br /&gt;import javax.mail.internet.*;&lt;br /&gt;import java.net.InetAddress;&lt;br /&gt;&lt;br /&gt;class TestMail&lt;br /&gt;{&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt; try&lt;br /&gt; {&lt;br /&gt;  //from address&lt;br /&gt;  String from = "fromaddress@somecompany.com";&lt;br /&gt; &lt;br /&gt;  //receipents of the mail&lt;br /&gt;  String to = "toaddress@someothercompany.com";&lt;br /&gt; &lt;br /&gt;  /*&lt;br /&gt;  *If there are multiple&lt;br /&gt;  *recepients, then email ids&lt;br /&gt;  *should be stored in a String&lt;br /&gt;  *with a space in between them.&lt;br /&gt;  *eg: String to = "id1@comp1.com id2@comp2.com id3@comp3.com"&lt;br /&gt;  */&lt;br /&gt;    &lt;br /&gt;  //subject of the mail&lt;br /&gt;  String subject = "Test Mail Subject";&lt;br /&gt; &lt;br /&gt;  //e-mail content&lt;br /&gt;  String text = "This is a test email";&lt;br /&gt; &lt;br /&gt;  /*SMTP host&lt;br /&gt;  *SMTP host should be correct&lt;br /&gt;  *for this program to work.&lt;br /&gt;  *Also, some SMTP servers&lt;br /&gt;  *are configured to allow&lt;br /&gt;  *messages to be sent from&lt;br /&gt;  *one or a few doamins&lt;br /&gt;  */&lt;br /&gt;  String mailhost = "mail.somecompany.com";&lt;br /&gt; &lt;br /&gt;  //mailer&lt;br /&gt;  String mailer = "testmailer";&lt;br /&gt; &lt;br /&gt;  Properties props = System.getProperties();&lt;br /&gt; &lt;br /&gt;  props.put("mail.smtp.host", mailhost);&lt;br /&gt; &lt;br /&gt;  Session session = Session.getInstance(props, null);&lt;br /&gt; &lt;br /&gt;     //construct the message&lt;br /&gt;  Message msg = new MimeMessage(session);&lt;br /&gt;  msg.setFrom(new InternetAddress(from));&lt;br /&gt;  msg.setRecipients(Message.RecipientType.TO,&lt;br /&gt;   InternetAddress.parse(to, false));&lt;br /&gt;  msg.setSubject(subject);&lt;br /&gt;  msg.setText(text);&lt;br /&gt;  msg.setHeader("X-Mailer", mailer);&lt;br /&gt;     msg.setSentDate(new Date());&lt;br /&gt;&lt;br /&gt;  //send the mail&lt;br /&gt;  Transport.send(msg);    &lt;br /&gt; &lt;br /&gt;  System.out.println("\nMail was sent successfully.");&lt;br /&gt; }&lt;br /&gt; catch(Exception e)&lt;br /&gt; {&lt;br /&gt;  e.printStackTrace();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;WARNING:&lt;/span&gt;&lt;br /&gt;When full headers are viewed by the recepeint for a mail sent by this program, it mite have an indication that there is something fishy about how the mail was sent !!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Spamming !!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-302774610142110095?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/302774610142110095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=302774610142110095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/302774610142110095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/302774610142110095'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/12/fake-mail.html' title='Fake Mail'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-8314569759257742237</id><published>2007-12-04T03:53:00.000-08:00</published><updated>2007-12-04T03:58:13.846-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>JavaScript NULL</title><content type='html'>For JavaScript:&lt;br /&gt;&lt;br /&gt;If you want to test whether a String object is NULL , then the following may FAIL&lt;br /&gt;&lt;br /&gt;if(someString == "")&lt;br /&gt;&lt;br /&gt;if(someString == "null")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The CORRECT way to test would be:&lt;br /&gt;&lt;br /&gt;if(someString == null)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;Resources:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lists.evolt.org/archive/Week-of-Mon-20050214/169524.html"&gt;http://lists.evolt.org/archive/Week-of-Mon-20050214/169524.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-8314569759257742237?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/8314569759257742237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=8314569759257742237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8314569759257742237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8314569759257742237'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/12/javascript-null.html' title='JavaScript NULL'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-3368567354838921584</id><published>2007-12-03T02:53:00.000-08:00</published><updated>2007-12-03T03:11:04.794-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Post HTML codes in blogs</title><content type='html'>If you post articles with html tags on blogspot, it will most probably give an error message as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;ERROR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Your HTML cannot be accepted: Tag is not allowed: "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The way to get around this is to convert all the mark-ups (eg: '&lt;' , '&gt;') into character-entities (eg: '&amp;amp;lt;' for '&lt;'  ;  '&amp;amp;gt;' for '&gt;')&lt;br /&gt;&lt;br /&gt;One can use online applications that perform this conversion stuff:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.stanford.edu/%7Ebsuter/js/convert.html"&gt;http://www.stanford.edu/~bsuter/js/convert.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If formatting has to be retained, then just enclose the code inside '&amp;lt;pre&gt;' and '&amp;lt;/pre&gt;' tags.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-3368567354838921584?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/3368567354838921584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=3368567354838921584' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/3368567354838921584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/3368567354838921584'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/12/post-html-codes-in-blogs.html' title='Post HTML codes in blogs'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-2411997572739193185</id><published>2007-12-03T01:29:00.000-08:00</published><updated>2008-01-17T03:08:36.809-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Web Browser Compatibility !!!!</title><content type='html'>Developing on a web application is not easy if you intend to have the product compatible with all the available browsers in the universe for some new browser or its clone comes to life everyday.&lt;br /&gt;&lt;br /&gt;This article is about how can one know which browser is being used by the end-user and how one can customize the code in accordance the same, be it  IE or Mozilla Firefox or Safari or blah blah blaaaaaaaaaaaah !!!&lt;br /&gt;&lt;br /&gt;The end-user browser can be determined by using &lt;span style="color: rgb(153, 51, 0); font-weight: bold;"&gt;navigator.appname&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following code illustrates the same:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;    &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;        &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;            function navigatorName()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;                alert(navigator.appName);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;        &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;    &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;    &amp;lt;body onload="navigatorName()"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;        &amp;lt;div id="browserContents"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;        &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;    &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When the page gets loaded, the &lt;span style="color: rgb(102, 102, 102); font-weight: bold;"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 51);"&gt;onload&lt;/span&gt; &lt;/span&gt;feature will call the javascript function &lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;navigatorName() &lt;/span&gt;which will display the alert box with the name of the browser as the message.&lt;br /&gt;&lt;br /&gt;Now, inside the function navigatorName, we can write the logic that would make our code browser specific&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt; &amp;lt;head&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;  &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;   function navigatorName()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;   {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    if(navigator.appName == "Netscape")&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;     document.getElementById("browserContents").innerHTML = "Netscape";&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    }&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    else if(navigator.appName == "Microsoft Internet Explorer")&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;     document.getElementById("browserContents").innerHTML = "MS IE";&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    }&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;     document.getElementById("browserContents").innerHTML = "Some Browser";&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;    }&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;   }&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;   &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;  &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt; &amp;lt;body onload="navigatorName()"&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;  &amp;lt;div id="browserContents"&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;   loading . . .&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;  &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt; &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;font-size:85%;" &gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Here, when the body part of the page has been loaded, the browser calls the function &lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;navigatorName().&lt;/span&gt; This function checks the browser being used, and in accordance to that, replaces the contents of the &lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;div &lt;/span&gt;with id &lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;browserContents&lt;/span&gt; appropriate contents by making use of the function &lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-style: italic;"&gt;document.getElementById("browserContents").innerHTML. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-2411997572739193185?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/2411997572739193185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=2411997572739193185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/2411997572739193185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/2411997572739193185'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/12/web-browsers.html' title='Web Browser Compatibility !!!!'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-929882880394723635</id><published>2007-12-02T22:55:00.000-08:00</published><updated>2007-12-03T03:50:36.077-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='newbie blues'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='derby'/><title type='text'>Derby</title><content type='html'>I had a project work in which I needed to port an existing web-application running on MySQL toDerby. The SQL and datatypes of both are fairly same with minor variations (like syntax for triggers), though Derby does NOT support a few features like 'limit'.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TIPS:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are using embedded derby, remember, only ONE connection can be made to the database at a time. If applications running on different JVM's try to access the same database resource at the same time, then except the first one, none will be able to get access. So, go for Network server, if you have any such requirements.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 255, 255); font-weight: bold;"&gt;----------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;Username &amp;amp; Password&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While creating the derby database, if username and password were not specified, and the application you are using requires one, then use the following if it doesn't accept blank/null fields&lt;br /&gt;&lt;br /&gt;username: app&lt;br /&gt;password: app&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 255, 255); font-weight: bold;"&gt;----------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;Derby Network Server (for Windows)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Goto&lt;br /&gt;%DERBY_INSTALL%\frameworks\NetworkServer\bin&lt;br /&gt;and type "startNetworkServer.bat"&lt;br /&gt;&lt;br /&gt;This will start the server and by default it will listen on port 1527&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;In my machine Derby is installed in&lt;br /&gt;C:\Program Files\Apache Software Foundation&lt;br /&gt;&lt;br /&gt;So, value of the  DERBY_INSTALL variable is "C:\Program Files\Apache Software Foundation\db-derby-10.2.1.6-bin"&lt;br /&gt;&lt;br /&gt;So, the command "cd %DERBY_INSTALL%\frameworks\NetworkServer\bin"&lt;br /&gt;opens up the following:&lt;br /&gt;C:\Program Files\Apache Software Foundation\db-derby-10.2.1.6-bin\frameworks\Net&lt;br /&gt;workServer\bin&gt;&lt;br /&gt;&lt;br /&gt;Now entering "startNetworkServer.bat" starts the server on port 1527&lt;br /&gt;&lt;br /&gt;Remember, your derby database files must be located in the&lt;br /&gt;"C:\&gt; cd %DERBY_INSTALL%\frameworks\NetworkServer\bin" directory,&lt;br /&gt;if you are run the server following the aforesaid.&lt;br /&gt;&lt;br /&gt;From the program through which you wish access the database, give the following path of the database as:&lt;br /&gt;&lt;br /&gt;"jdbc:derby://localhost:1527/dbname"&lt;br /&gt;&lt;br /&gt;where 'dbname' is the name of the database.&lt;br /&gt;&lt;br /&gt;If the database is located in some other folder, say D:/dbfolder, then modify the above as follows:&lt;br /&gt;&lt;br /&gt;"jdbc:derby://localhost:1527/D:/dbfolder/dbname"&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 255, 255); font-weight: bold;"&gt;----------------------------------------------&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;Resources:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://db.apache.org/derby/papers/DerbyTut/index.html"&gt;Tutorial on Apache Website&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-929882880394723635?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/929882880394723635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=929882880394723635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/929882880394723635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/929882880394723635'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/12/derby-newbie-blues.html' title='Derby'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714790391472726461.post-8455861050998609195</id><published>2007-11-29T22:51:00.000-08:00</published><updated>2010-05-04T04:44:27.572-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='me'/><title type='text'>Ramblings</title><content type='html'>I will attempt to jot down here codes/techniques on topics which I found were complex, or for which any help online or otherwise were not available. But, the things presented in this blog are not the geeky types. They are just a collection of simple things to make programming and software development easier.&lt;br /&gt;&lt;br /&gt;Writing good algorithms and neat code is a demanding art that has to be learnt and mastered . On the contrary, developing applications requires not much intelligence, but knowledge of the available libraries and the know-how to use them.&lt;br /&gt;&lt;br /&gt;So, posting articles will help me remember things that I learnt or did or both, and will come in handy  for I am blessed with amnesia.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6714790391472726461-8455861050998609195?l=f-technology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://f-technology.blogspot.com/feeds/8455861050998609195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6714790391472726461&amp;postID=8455861050998609195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8455861050998609195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714790391472726461/posts/default/8455861050998609195'/><link rel='alternate' type='text/html' href='http://f-technology.blogspot.com/2007/11/disclaimer.html' title='Ramblings'/><author><name>aneez backer</name><uri>http://www.blogger.com/profile/16666874095531846511</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1378/1406127251_23f19717b4_s.jpg'/></author><thr:total>0</thr:total></entry></feed>
