Category Archives: Programming
Hibernate is trying to fetch table meta from different database
Hibernate is trying to fetch table meta from different database, why? It is very trouble because the tables in my databases have the same name, but why can’t? 2016/04/24
My netbeans plugin finally appears on official plugin portal
My netbeans plugin finally appears on official plugin portal , thanks to Mr Markiewb for helping out https://github.com/markiewb . This plugins show a tree view of all maven goals of all projects, you can double click the goal name on tree to execute it, helping people to save time. 2016/04/02
Nodejs is very fast, at least faster than java and c#
Nodejs is very fast, at least faster than java and c#, here is my test case: JMeter send rest api request from Tai Wai to Mong Kok, below is the trace route /Users/peter>traceroute 210.5.164.14 traceroute to 210.5.164.14 (210.5.164.14), 64 hops max, 52 byte packets 1 192.168.10.1 (192.168.10.1) 2.463 ms 3.169 ms 0.995 ms 2 058176102001.ctinets.com […] 2016/03/28
Maven Runner update – now it reads nbactions.xml
now it reads nbactions.xml added a button (with star icon) to hide default maven goals. 2016/02/12
Flashing bin file to nucleo-L476RG
This command works!!! 2016/01/17
Nucleo STM32F103 dev board with built in STlinkV2-1 programmer
http://openenergymonitor.org/emon/node/6189 1. GNU ARM Tool Chain 2. IDE Eclipse 3. STmicro libraries 4. GDB Server 1. GNU ARM Tool Chain https://launchpad.net/gcc-arm-embedded $ sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded (if using 14.04 follow extras steps when adding PPA) $ sudo apt-get update $ sudo apt-get install gcc-arm-none-eabi if 64bit, we need 32-bit libs $ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 2. Eclipse […] 2016/01/17
I use this script to check all projects for outdated maven dependency
I use this script to check all projects for outdated maven dependency 2016/01/12
Tutorial : import svn with all history into github
Tutorial : import svn with all history into github Step 1) Create a project on github Step 2) Init the github project by : Step 3) git clone https://github.com/mcheung63/GKD.git <— replace your project url Step 4) cd to that directory Step 5) user https://github.com/nirvdrum/svn2git and run: Step 6) svn2git –rebase Step 7) git pull Step […] 2015/09/22
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 […] 2015/09/16
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 […] 2015/09/08
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 […] 2015/08/06
Peter-swing java look & feel
https://github.com/mcheung63/peter-swing 2015/08/03
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. 2015/08/02
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” 2015/05/03
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. 2015/03/07
Thinkaholic open source event 2015/2/10
Thinkaholic open source event 2015/2/10 2015/02/15
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: 2014/12/25
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. 2014/12/22
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. 2014/12/10
${new} will cause error in old tomcat 7
Below code has error, because the ${new} will crash old tomcat 7. JSTL has bug. 2014/11/14
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. 2014/11/11
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 2014/10/09
command to connect sharepoint 2013 to office web apps server
First, do these in office web apps server Second, do these in sharepoint server 2014/10/09
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. 2014/08/28
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. 2014/08/23
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 […] 2014/08/17
A little bit better – Showing the MBR
A little bit better – Showing the MBR Here is the java code to read MBR out: 2014/07/28
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 2014/07/01
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 […] 2014/06/29
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 […] 2014/06/23
code crash in multithread mode of FUSE
2014/06/21
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 2014/06/19
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 […] 2014/05/04
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 […] 2014/05/03
Miglayout has bug? JPanel doens’t grow
Miglayout has bug? JPanel doens’t grow, but for JButton or JTextField, they can. 2014/04/26
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/ 2014/04/21
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: 2014/04/06
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 2014/03/23
a good html 5 video streaming tutorial http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets 2014/02/24
rename computer name for sharepoint 2010
after rename computer name for sharepoint 2010, need this command: 2014/02/08