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 […]
Category: Programming
This battery save my apple magic mouse
When you change your mouse from logitech mouse to magic mouse, the first feeling is that magic mouse is much much heavier. This battery save my apple magic mouse, although it has lesser mah, but it is 5 times lighter than normal battery, so i much my magic mouse much lighter weight. And it is only […]
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 […]
Peter-swing java look & feel
https://github.com/mcheung63/peter-swing
grub is slow on bochs
if grub is running slowly on bochs, try to add “–no-rs-codes” to your grub-bios-setup command. It will be 0.5 sec versus 5 seconds different.
binutils compile error
If you compiling binutils and have these error, just remove d-exp.c and try again. d-exp.c should be generated by d-exp.y but binutils makefile won’t delete it during “make distclean”
compile dwarfdump in mac
CFLAGS=’-I /opt/local/include -L /opt/local/lib’ CXXFLAGS=’-I /opt/local/include -L /opt/local/lib’ ./configure –prefix=/peter-dwarfdump make make install Because mac gcc doesn’t search for the /opt/local, so need to specific the path manually.
Thinkaholic open source event 2015/2/10
Thinkaholic open source event 2015/2/10
Empty bochs instrument crash in linux, but not in mac
Empty bochs instrument crash in linux, but not in mac. My instrument code is nearly empty. core dump: configure: run by: bochsrcSDL.bxrc: instrument.h: instrument.cc:
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.
volatile keyword is not everything to prevent compiler optimization
When you add the keyword “volatile” in front of variable declaration, it prevents compiler to optimize the line that are using that variable. But if the line is completely useless, compiler will still optimized it out, prevent to generate any byte code for it.
${new} will cause error in old tomcat 7
Below code has error, because the ${new} will crash old tomcat 7. JSTL has bug.
Sharepoint online bug
Sharepoint online bug – If you place an html-email-address to it and click “check” button, it crash. Even you delete all text and the check button can’t resume normal.
sharepoint 2013 deploy app hang up
In visual studio, when you deploy your sharepoint app, if t hang up in “Installation is in progress”. Make sure your “SharePoint Timer Service” is running, this problem will be solved
command to connect sharepoint 2013 to office web apps server
First, do these in office web apps server Second, do these in sharepoint server
Kendo with asp.net MVC ScriptBundle issue
Kendo with asp.net MVC, need to be careful this link in your web.config You have to turn off debug=”true”, otherwise the ScriptBundle includes will not working.
libelf.h has bug, it includes a missing header file
I cross compile the libel 0.8.13 on my ubuntu 12.04lts. I used the below command to configure it. The compile process is success and installed it correct. But inside the include/libelf/sys_elf.h, it includes a missing header file (elf.h). Just comment it out, and it will works.
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 […]
A little bit better – Showing the MBR
A little bit better – Showing the MBR Here is the java code to read MBR out:
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
Optimize java startup speed
I spent lot of time to optimize the startup speed of my Java app from 10 seconds down to 6 seconds in my 2012 Mac air. I changed to MacBook 13″, the startup time become <=3. That proves the hard disk speed is the key to optimize the startup time. I am facing a new […]
Connect Peter-file-system to linux or mac
After spent 3 days to play the FUSE and macFUSE, i finally connected Peter-file-system (https://code.google.com/p/pfsbuilder) to my mac/linux machine. It is quite simple and straightforward, I write a FUSE program that create a JVM and load my PFS stub (writhed in Java), every FUSE function calls will route to the stub and manipulates the PFS […]
code crash in multithread mode of FUSE
How to trace IIS error 500
The best way to trace IIS error 500 is to enable all log detail on screen, edit your web.config to
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 […]
Miglayout has bug? JPanel doens’t grow
Miglayout has bug? JPanel doens’t grow, but for JButton or JTextField, they can.
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/
dot in mac and linux produce different kind of ortho edge
dot in mac and linux produce different kind of ortho edge. I think the dot version affected it. Here is dot version in linux: Here is dot version in mac:
a java example to record from microphone and save it to wav file and playback
This is a very simple java program to record from microphone and save it to wav file and playback
a good html 5 video streaming tutorial http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets
rename computer name for sharepoint 2010
after rename computer name for sharepoint 2010, need this command:
Jetty require servlet-api 2.5 to fix “java.lang.NoSuchMethodError
Jetty require servlet-api 2.5 to fix “java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String”, don’t add “org.mortbay.jetty servlet-api”, you need :
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 […]
Netfilter
If I can understand this graph, i will say i am a firewall beginner, otherwise i am still outside the door. http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg
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
web socket example to stream screen to html 5 player
Here is a working example using web socket to stream screen to html 5 player. The server is in java, I use websockify.py to route the websocket to java socket. html 5 player
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 […]
Enable core dump in mac
enable core dump in mac, you need these commands The core dump files are in /cores by default
a bug in tightvnc java library
I found a bug for the tightvnc java library, if my setup like this tightvnc (java) -> java proxy server -> java proxy server -> vnc server IT doesn’t work, after I trace the code, this could caused by this line: this.is = new DataInputStream(new BufferedInputStream(is)); In Reader.java constructor, it is called twice. You can see that if you […]