FOLLOW ME Twitter Facebook Вконтакте LinkedIn RSS Feed

Font rendering: Apple JDK 6 vs Oracle JDK 1.7.0_40

Sep 12, 2013
Category: Java

The Oracle JDK version 1.7.0_40 contains significant changes in font rendering comparing to latest builds of Apple JDK 1.6

Apple JDK with Quartz
apple-jdk-font-rendering

Oracle JDK 1.7.0_40
oracle-jdk-font-rendering

First screenshot was made with Apple JDK. Quartz Graphics Framework enabled by passing apple.awt.graphics.UseQuartz=true as a system property to render text and graphics. Anyway, fonts and colours under Apple JDK with Quartz look so different in java applications comparing to native ones. The good news is that fonts look natively with new Oracle JDK. It uses new approaches to render texts. Unfortunately, OpenGL doesn’t support SubPixel anti-aliasing, so you can have some problems with non-Retina displays.

Also Apple JDK with Quartz modifies colours while rendering and makes them more soft and warm. Look at the difference in backgrounds on the pictures. They have the same background colour… sort of…


How to restore unreadable USB flash drive under Mac OS X

Sep 1, 2013
Category: Tips and Tricks

USB Flash Drive recovery Today I found that I can’t access to my 8Gb USB flash drive. I can find it in Finder, but the System gets stuck while accessing to it. What to do? If you want to recover data from a USB flash it’s better to stop reading this post now and continue googling “USB flash data recovery” or something. Here’s a step-by-step instruction how to make your USB flash drive work again under Mac OS X.

1. Open Terminal and go to /dev

$ cd /dev

2. Now it’s time to find your flash drive in /dev. Typically it’s /dev/diskN where N could be 0, 1, 2, 3, etc

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *8.1 GB     disk3
   1:                        EFI                         209.7 MB   disk3s1
   2:       Microsoft Basic Data KB                      7.9 GB     disk3s2

OK! It’s disk number 3, i.e. /dev/disk3 Remember the name of partition (it’s KB in my case). Your flash drive is mounted as /Volumes/NAME Continue reading »


Idea 11 Icon pack updates

Jul 12, 2013
Category: IntelliJ IDEA

I moved my IntelliJ IDEA plugin “Idea 11 Icon pack” to the official plugin repository. Now, permanent link is http://plugins.jetbrains.com/plugin/7285 The plugin is now available through Preferences -> Plugins -> Browse Repositories

idea11icons_plugin


Retina support in Oracle JDK 1.7.0_40 and above

Jun 23, 2013
Category: Java

Hi everyone!

A few days ago I installed Oracle JDK (version 1.7.0_40) built especially for early access purposes. So, it’s not the final release. The build contains tons of bug fixes and backports from JDK 8 for AWT/Swing and that was the main point why I started to play with it. As you might have heard, Retina support was one of the major issues in all 1.7.* releases. I’d say there was no Retina support before the build 1.7.0_40. I’m going to show you some differences of Retina support in Apple and Oracle JDKs.
 

1. isRetina() method

That’s funny, but there is no public API for it in Oracle JDK 7. Here is how we (IntelliJ IDEA team) do it under Apple JDK:

class IsRetina {
  public static final boolean isRetina = isRetina();

  private static boolean isRetina() {
    try {
      final boolean[] isRetina = new boolean[1];
      new apple.awt.CImage.HiDPIScaledImage(1,1,BufferedImage.TYPE_INT_ARGB) {
        @Override
        public void drawIntoImage(BufferedImage image, float v) {
          isRetina[0] = v > 1;
        }
      };
      return isRetina[0];
    } catch (Throwable e) { 
      e.printStackTrace();
      return false;
    }
  }
}

Continue reading »


Windows 8: beatiful and fast

May 12, 2013
Category: Fun
Tags: ,


Keep Calm and Develop with Pleasure

May 2, 2013

Yet another idea for an IntelliJ T-Shirt. Would you wear it?

Keep Calm and Develop with Pleasure

Smalltalk Support in IntelliJ IDEA

Great news! I recently uploaded initial version of Redline Smalltalk plugin for IntelliJ IDEA. What is Redline Smalltalk? Redline Smalltalk is a Smalltalk for JVM. This literally means you write Smalltalk code and run it using JRE and Redline library. I’ve made it available from your favorite Java IDE IntelliJ IDEA.

What’s in version 1.0?

  • Create a Redline Smalltalk project using IntelliJ wizard
  • Import a Redline Smalltalk project from an existing project
  • Adding Redline Smalltalk support to an existing module
  • Adding Redline Smalltalk module to an existing project
  • Creating a new Smalltalk file based on two templates: class and message
  • Create a Redline Smalltalk run configuration
  • Ability to compile and run Redline Smalltalk from IntelliJ
  • Run output console
  • Ability to download and install Redline Smalltalk from the Module Wizard
  • Simple code highlighting

Download and have fun!


Top 10 most weirdest/bizarre/coolest video clips ever

Mar 17, 2013
Category: Music
Tags: , ,

I’ve collected a list of the most bizarre music videos that I have seen in recent years. The main criterion here is a combination of really good music and weird visual associations. So, fill free to kill some time here. I’d be happy to get some videos from you too. Let’s go!

10. Out Of Space by The Prodigy

Continue reading »


How to make favicon.ico for Retina

Jan 23, 2013
Category: Design

If you read this, you probably have a web-site or a personal blog. Anyway, you know what is a favicon. A favicon is an icon representing your web-site in bookmarks, address bar, etc. In 99% it’s 16×16 px ico file and in 99% it looks ugly on a Retina device. This is how my Bookmarks bar looks in Chrome.

Bookmarks bar in Chrome

Icons on the left are made with retina quality, and icons on the right are not. To fix it, we need 32×32 px version of the icon. Once you’ve made it, you need an ico file containing both 16x16px and 32x32px icons. I’d recommend to use X-Icon Editor – a web-based tool doing all dirty job for you. All you need is:

  1. Upload 32x32px PNG icon
  2. Leave 16×16 and 32×32 options checked and uncheck others
  3. Click OK and download ICO file
  4. Rename it to favicon.ico and upload it to yours web-site document root. So it’s available at http://mydomain.com/favicon.ico

Enjoy

P.S. to make your icon looks perfect on mobile devices such as iPads, iPhones, etc I’d recommend to read Mathias Bynens’ awesome post about it


Running java on Debian via SSH

Jan 13, 2013

A few days ago I had a problem: run YouTrack on my VDS. YouTrack is a bug tracker written in Java. First time I run it as

java -jar youtrack.jar 8080 &

And this worked fine, until I closed my ssh session with the server. When you close a ssh session your terminal send the HUP (hangup) signal to warn all depending processes of logout. To avoid the HUP signal to be sent, run your java programs using hohup:

nohup java -jar youtrack.jar 8080 &

Pages:«12345»