Search Posts

Category: Programming

Netbeans – Maven Runner

Eclipse has a great plugin call “Eclipse runner” https://marketplace.eclipse.org/content/eclipse-runner , i found out netbeans doesn’t have any similar one. So i develop one for netbeans. You can add maven goals under the tree node of any project. Double click the goal name will run maven in netbeans. You can download it from http://plugins.netbeans.org/plugin/60381/?show=true, or search “Maven […]

hard to theme netbeans perfectly

It is hard to theme netbeans using traditional swing look & feel. The reason is netbean’s tab container is not traditional swing JTabbedPane. See the post https://netbeans.org/bugzilla/show_bug.cgi?id=150393 Netbeans use a AbstractViewTabDisplayerUI to support only few “default look & feel”, such as Metal, Nimbus, Aqua. see below: The problem is : This default look & feel tab container […]

Java has bug again

Java has bug again. After you installed idk 1.8u25 in your mac, open Eclipse.app/Contents/MacOS/eclipse.ini, you will see: -vm /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home But actually this line has no effect, when you run eclipse with -console -debug, you still see it is running use idk 1.6 “-vm /System/Library/Frameworks/JavaVM.framework”. To fix it, change that line to -vm /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java Peter.

Mac has no mkfs.vfat

I have to package my kernel into a fat partition and load it up using grub, but mac doesn’t has a mkfs.vfat and “mount loopback” command. So I am creating a small programing using https://github.com/waldheinz/fat32-lib/ to manipulate the fat image by myself. So far these two small program can read & write a fat image: Read […]

tightvnc java is very slow on Retina

Take a look line 170 from https://code.google.com/p/tightvncpanel/source/browse/trunk/src/main/java/com/glavsoft/viewer/swing/Surface.java This ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); make g.drawImage(offscreenImage,0,0,null); runs very slow on Mac Retina. Solve: set the value to “VALUE_RENDER_SPEED” instead of  VALUE_RENDER_QUALITY  

newlib’s reentrant system calls will map to non-reentrant by default

newlib’s reentrant system calls will map to non-reentrant by default. The reentrant version of open() can be found in newlib-2.1.0/newlib/libc/reent/openr.c As you can see, it will call _open which is defined in newlib-2.1.0/newlib/libgloss/libnosys/open.c . So if you don’t write your reentrant functions, it will jump to non-reentrant by default. For OS developer want to implement […]

gcc, binutils and newlib can all be compiled at once.

gcc, binutils and newlib can all be compiled at once. This article http://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.pdf said gcc, binutils and newlib are from the same source tree. Using the following script can linkup all files into a single directory and compile all of them at once. Just put the directories (binutils-2.24 , gcc-4.9.0 , newlib-2.1.0) and the above script in the […]

Found a bug in ndisasm

Type this command, ndisasm will hang (I guess it eat up all 4GB address space, disassemble offset starts at 0xfffffff0, which is very high address). My version is “NDISASM version 2.11.02 compiled on Apr 9 2014”, running on mac mavericks. temp file : temp.bin The bug is filed here https://sourceforge.net/p/nasm/bugs/557/

The Costs of Versioning an API

http://www.infoq.com/news/2013/12/api-versioning Contract versioning and API/Service versioning has always been a consideration for SOA based systems. Whether because of the impact it has on composability, or client-service governance, it is still something of an art rather than a science. There are many examples of groups giving the benefit of their experiences (e.g., around REST is extremely popular). However, recently Jean-Jacques Dubray […]

Eclipse always hang in Mac

I am using eclipse kelper in mac osx mavericks, it always hang. I finally got a work around solution from http://www.lazylab.org/197/eclipse/eclipse-hanging-on-startup-repair-corrupt-workspace/ Removing .snap File Open \.metadata\.plugins\org.eclipse.core.resources directory Remove .snap file in the directory Restart Eclipse Remove .indexes Folder Remove the \.metadata\.plugins\org.eclipse.core.resources\.root\.indexes directory Restart Eclipse Move .project mv workspace/.metadata/.plugins/org.eclipse.core.resources/.projects workspace/.metadata/.plugins/org.eclipse.core.resources/old.projects My script

SwingUtilities.updateComponentTreeUI(this); will reset all custom UI

SwingUtilities.updateComponentTreeUI(this); will reset your own UI, if you call setUI() in constructor. Example: PeterCustomeTabbedPane —– extend ——> MaryCustomTabbedPane —-  extend ->   JTabbedPane (swing component) Suppose PeterCustomeTabbedPane and MaryCustomTabbedPane have their own TabbedPaneUI, once you called SwingUtilities.updateComponentTreeUI(this); , PeterCustomeTabbedPane’s UI class will be reset to MaryCustomTabbedPane’s UI class. Workaround: !!! dont call setUI in PeterCustomeTabbedPane, override the setUI() method and set whatever […]

Next Page » « Previous Page