Original content

Protected by Copyscape Plagiarism Checker

Sunday, July 26, 2015

Windows 10 - DVD drive not displayed in File Explorer

Hi, I am using windows 10 preview edition. No doubt, there are many other people out there too trying this new version and may be facing my same problem.

My DVD drive was not displayed under file explorer and this was after I upgraded from windows 7 to windows 10. I tried around three solutions when I google. Below solution from the microsoft support webpage solved my problem. Hope this will solve yours too.

https://support.microsoft.com/en-us/kb/314060


Copy of the steps I followed from the above link is below,

Note To use this method, you must be logged on to Windows as an administrator. Or right click and select run as administrator when opening the regedit.exe

Microsoft has a warning for the users, so please be correct when updating the registry. Before you modify it, back up the registry for restoration.

To create the registry subkey,
 
  1. Type regedit in the Run box, then press Enter. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi
  3. Right-click atapi, create new Key with the name Controller0.
  4. Right-click Controller0, create new DWORD(32-bit) Value with the name EnumDevice1.
  5. Right-click EnumDevice1 and Modify, Type 1 in the Value data box.
  6. Exit Registry Editor and restart.
 My problem got solved, hope yours will too ;-)

Sunday, February 15, 2015

Image resize in java - pass image as byte code and write the output byte code as image file

In this code, variable “byteImageValue” is the actual image byte code.

        byte[] byteResizedImageValue;
        try {
              ByteArrayInputStream inputStream = new ByteArrayInputStream(byteImageValue);
                     ByteArrayOutputStream baos = new ByteArrayOutputStream();
                     byte[] imageInByte = null
                     BufferedImage bufferedImage = ImageIO.read(inputStream);
                     int intResizeWidth = bufferedImage.getWidth()+25;
                     int intResizedHeight = bufferedImage.getHeight()+10;
                     BufferedImage resizedImage = new BufferedImage(intResizeWidth, intResizedHeight, BufferedImage.TYPE_INT_ARGB);
                     Graphics g = resizedImage.getGraphics();
                    
                     g.drawImage(bufferedImage, 0, 0, intResizeWidth, intResizedHeight, null);
               g.dispose();
                     ImageIO.write(resizedImage, "PNG", baos );
               baos.flush();
               imageInByte = baos.toByteArray();
               baos.close();
               byteResizedImageValue = imageInByte; 
              } catch (IOException objImageIOException) {
                     // TODO Auto-generated catch block
                     throw new ScriptException(generalErrorCode,
                    "Invalid image." + objImageIOException.getMessage());
              }