Category: Programming

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…
Read more


2014/05/03 1

Miglayout has bug? JPanel doens’t grow

Miglayout has bug? JPanel doens’t grow, but for JButton or JTextField, they can.


2014/04/26 1

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 1

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 1

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 0

a good html 5 video streaming tutorial http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets


2014/02/24 0

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 :


2013/12/26 0

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…
Read more


2013/12/23 0

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


2013/12/16 0

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


2013/11/28 0

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


2013/10/22 0

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…
Read more


2013/10/13 0

Enable core dump in mac

enable core dump in mac, you need these commands The core dump files are in /cores by default


2013/10/06 0

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…
Read more


2013/05/28 3

put python+django to apache through virtualhost

to put python+django to apache through virtualhost 1) edit /etc/httpd/conf/httpd.conf 2) edit /root/workspace/MyDjangoProject/P1/wsgi.py, change it to


2013/03/26 0

error in manage.py createsuperuser

error in manage.py createsuperuser To solve the above issues, type in


2013/03/26 0

compile grub2 : error: ‘gets’ undeclared here

if you compile grub2 , you may get “error: ‘gets’ undeclared here yum”, to fix it, run the following command: sed -i -e ‘/gets is a security/d’ grub-core/gnulib/stdio.in.h  


2013/02/09 0

compile 64 bits newlib on 64 bits linux host

If you compile newlib in x86-64 host and want to have 64-bits newlib, you have to add “–disable-multilib“, otherwise you will get the following error:


2013/02/03 0

newlib compile error in Fedora 18 64 bits

when you meet the following error, add “.code32” can fix it. ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S: Assembler messages: ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:18: Error: invalid instruction suffix for `push’ ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:21: Error: invalid instruction suffix for `push’ ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:22: Error: invalid instruction suffix for `push’ ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:23: Error: invalid instruction suffix for `push’ ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:72: Error: invalid instruction suffix for `pop’ ../../../../../../newlib-1.19.0/newlib/libc/machine/i386/memcmp.S:73: Error: invalid instruction suffix for…
Read more


2013/01/30 0

10 places where anyone can learn to code

Teens, tweens and kids are often referred to as “digital natives.” Having grown up with the Internet, smartphones and tablets, they’re often extraordinarily adept at interacting with digital technology. But Mitch Resnick, who spoke at TEDxBeaconStreet in November, is skeptical of this descriptor. Sure, young people can text and chat and play games, he says, “but that…
Read more


2013/01/30 1