Posted: March 5th, 2012 | Author: Alex Korn | Filed under: Uncategorized | Tags: fonts, Mac OS X, netbeans | 1 Comment »
Update 2016/09/19: For NetBeans 8.1 or 8.2, just add ” -J-Dorg.netbeans.editor.aa.text=false” to the line described below.
Update 2013/02/10: This also works with NetBeans 7.3.
Update 2012/07/24: This post was originally written about 7.1. Everything here also applies to Netbeans 7.2, so I’ve update this to refer to 7.2.
Another version of NetBeans, another hack to get it to turn off text anti-aliasing. Previously, I showed how with NetBeans 7.0. NetBeans 7.3.x is nearly the same, but a bit simpler.
Just make the following changes to the definition of netbeans_default_options
in /Applications/NetBeans/NetBeans\ 7.3.app/Contents/Resources/NetBeans/etc/netbeans.conf
(or something similar if you didn’t install it in the default location):
Add:
-J-Dswing.aatext=false
Change:
-J-Dapple.awt.graphics.UseQuartz=false
Restart NetBeans and you should have non-anti-aliased fonts.
Notes
Note that, unlike NetBeans 7.0, you no longer need to add -J-Dawt.useSystemAAFontSettings=off
.
See some notes about text anti-aliasing on the NetBeans wiki.
Posted: January 1st, 2012 | Author: Alex Korn | Filed under: Uncategorized | Tags: PHP | No Comments »
On Facebook today, I noticed one of my friends posted a picture with the label “1/365”. Like other people, she’s attempting to post one picture every day of the year. An admirable goal!
This got me thinking: I wonder how long it takes most people to give up on resolutions? Well, the best (read: easiest and cheapest) way to figure this out is to see how many Google results there are for “1/365”, “2/365”, etc.
This is how quickly we give up on our resolutions*:
It appears most people give up after the first week, and the vast majority give up after the first month or two. But if they stick with it for the first 10 months or so, they’re talking about it a lot until the end of the year.
The technical details
First off, Google’s estimates of how many results a query has are grossly exaggerated (thanks, James). The chart above uses Andrew Zich’s Google Search Matrix.
I had to remove some outliers, which I set to be the average of up to 3 days on either side of them.
- “7/365”: 719k (mostly in the form of “24/7/365”)
- “364/365”: 1.8m (apparently a lot of sites just have numbers in sequence)
Below is the PHP script I used to generate the numbers initially. Note that the Google homepage (and thus the text around the number of results) looks different when you aren’t logged in.
echo '<html><table>';
$matches;
for ($i = 1; $i <= 365; ++$i)
{
$url = 'http://www.google.com/search?q=' . urlencode('"' . $i . '/365"');
$result = file_get_contents($url);
preg_match('/of about <b>(.*)<\/b> for/', $result, $matches);
echo '<tr><td>' . $i . '</td><td>' . str_replace(',', '', $matches[1]) . '</td></tr>';
}
echo '</table></html>'; |
echo '<html><table>';
$matches;
for ($i = 1; $i <= 365; ++$i)
{
$url = 'http://www.google.com/search?q=' . urlencode('"' . $i . '/365"');
$result = file_get_contents($url);
preg_match('/of about <b>(.*)<\/b> for/', $result, $matches);
echo '<tr><td>' . $i . '</td><td>' . str_replace(',', '', $matches[1]) . '</td></tr>';
}
echo '</table></html>';
Here is the chart created with the numbers that Google estimates on the first page of results:
The general shape of the data is the same, but the actual numbers of results are very different between the two.
The disclaimer
Oh man, this is so unscientific it almost hurts. Just because someone stops posting about their resolutions doesn’t mean they’ve given up. Not everyone who’s come up with a resolution posts about it online. Etc etc etc. I sacrificed a lot of scientific rigor to come up with a catchy title.
Posted: July 22nd, 2011 | Author: Alex Korn | Filed under: Uncategorized | Tags: key repeat, lion, os x | No Comments »
To enable key repeat in Mac OS 10.7 Lion, open up your Console, enter the following line, then restart your computer.
defaults write -g ApplePressAndHoldEnabled -bool false
The default behavior in 10.7 is to have a special keys selector pop up when holding down a key, similar to the behavior in iOS. This can be handy for typing accented letters, but makes things like navigating in Vi much more difficult. As of now, there is no way to change this setting in the user interface.
Posted: May 2nd, 2011 | Author: Alex Korn | Filed under: Uncategorized | Tags: fonts, Mac OS X, netbeans | 3 Comments »
See the updated post for NetBeans 7.1 and 7.2.
The quick version
For those who want to turn off text anti-aliasing in NetBeans 7.0.x on Mac OS X without reading my tirades, just make the following changes to the definition of netbeans_default_options
in /Applications/NetBeans/NetBeans\ 7.0.app/Contents/Resources/NetBeans/etc/netbeans.conf
(or something similar if you didn’t install it in the default location):
Add:
-J-Dswing.aatext=false -J-Dawt.useSystemAAFontSettings=off
Change:
-J-Dapple.awt.graphics.UseQuartz=false
Restart NetBeans and you should have non-anti-aliased fonts.
The full story
The perfect programming font: many have searched; few have found.
It’s Monaco, 10pt, no anti-aliasing.
But I digress. My goal here is not to discuss fonts (but seriously, I love discussing fonts), but to write the most keyword-heavy post for those trying to figure out how to turn off text anti-aliasing in NetBeans 7 on Mac OS X. By default, NetBeans uses anti-aliasing for its editor, which, for most fonts, is great, but not for Monaco 10pt.
When I used NetBeans 6.x, I found this page to be quite useful. However, when I tried turning off anti-aliasing with NetBeans 7.0, it did not work.
After a bit of exploring, I found the key to be setting -J-Dapple.awt.graphics.UseQuartz=false
. I believe Quartz refers to the 2D graphics rendering API for OS X, but for the sake of your non-anti-aliased font, you certainly don’t need it.
In-Application Setting
NetBeans has been well aware of the issue for quite some time, so don’t expect the anti-aliasing setting to be modifiable inside the application any time soon.