Skip to main content

Posts

Showing posts from November, 2014

Java : Read from Excel (xls) file

Reading from a text file is common. But, reading from an excel(.xls) file is not. Recently, I got to do so. Little bit Google search and experimentation resulted in the following. I used HSSF from Apache-POI. import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; public void readFromXlsFile (String pathToFile, String sheetName){     try {         FileInputStream file = new FileInputStream(pathToFile);         HSSFWorkbook workbook = new HSSFWorkbook(file);         HSSFSheet sheet = workbook.getSheet(sheetName);         Iterator<Row> rowIterator = sheet.rowIterator();                     while (rowIterator.hasNext()) {             Row row = rowIterator.next();             if (row.getRowNum() == 0) {                 continue;// skip first row, as it contains column names             }             Iterator<Cell> cellIterator

Mac Yosemite : Ugly turned out to be Uglier and Ugliest

You might have read my review on Mac OSX Yosemite , The Good, bad and ugly. Now it turned out to be UGLIEST. No more words. Here's the image. If you are on Yosemite, you might be familiar with it. Most of the times, you get stuck on boot logo. I've seen complaints regarding it saying that fellow members are ignorant of it and they deny such possibility, even though many are still facing it. Workarounds suggested by our online friends: Just reboot your mac as many times it takes to your desktop. Boot into safe mode, by holding SHIFT and then reboot. Comment your workaround below, mine is the first one. If you are still on Mavericks, be there till Apple provides a fix for this.