Over the last 13 years (yes, 13 years!) I've been doing work on and off for a Japanese company. We've been developing home automation controllers for the Japanese market. With the latest incarnation of the product line you can keep tabs on all your home energy usage, as well as control and monitor many devices from a browser or your cell phone.
See Ecofront for a look at the product. Pretty cool!
Intro
![]() | I am a computer programmer with a lot of experience. I am currently upgrading my skill set. Follow my journey learning Ruby-on-Rails, HTM5, iPhone and Android programming. |
Wednesday, December 29, 2010
Monday, December 27, 2010
Java - Append text to a file
This is pretty simple, but I always forget and have to look it up.
To append to a file from a java program:
try {
BufferedWriter out = new BufferedWriter(new FileWriter("filename", true));
out.write("aString");
out.close();
} catch (IOException e) {
}
Found this on: http://www.exampledepot.com/egs/java.io/AppendToFile.html
To append to a file from a java program:
try {
BufferedWriter out = new BufferedWriter(new FileWriter("filename", true));
out.write("aString");
out.close();
} catch (IOException e) {
}
Found this on: http://www.exampledepot.com/egs/java.io/AppendToFile.html
Saturday, December 18, 2010
X Server running but can not find display
I was trying to run an X windows program on a Linux computer remotely. The program did not actually display anything over X, but required to attach to the X Server to do some processing. Anyway I was getting the error:
Can't open display: 0.0
I was logged in remotely. If I logged in remotely forwarding the X port, the error did not happen. The server was running an X Server. So why this error? What was the correct DISPLAY to define to make this program work without having to forward the X port to my local computer?
The answer is that even though the Linux computer was running an X Server, it did not actually have a display card, so there was no actual display to assign the DISPLAY variable to. The fix was to create a virtual frame buffer, faking the X Server into thinking there is a frame buffer, thus a DISPLAY variable can be properly set.
To create the frame buffer:
/usr/bin/Xvfb :1 -screen 0 1024x768x16 &
Set the DISPLAY variable in the environment to 0.1
setenv DISPLAY 0.1
That fixed it. Now X windows thinks there is a frame buffer and can run X Window programs even though they are not displayed anywhere.
FYI: I had to install the Xvfb program in the server, it was not previously installed.
Can't open display: 0.0
I was logged in remotely. If I logged in remotely forwarding the X port, the error did not happen. The server was running an X Server. So why this error? What was the correct DISPLAY to define to make this program work without having to forward the X port to my local computer?
The answer is that even though the Linux computer was running an X Server, it did not actually have a display card, so there was no actual display to assign the DISPLAY variable to. The fix was to create a virtual frame buffer, faking the X Server into thinking there is a frame buffer, thus a DISPLAY variable can be properly set.
To create the frame buffer:
/usr/bin/Xvfb :1 -screen 0 1024x768x16 &
Set the DISPLAY variable in the environment to 0.1
setenv DISPLAY 0.1
That fixed it. Now X windows thinks there is a frame buffer and can run X Window programs even though they are not displayed anywhere.
FYI: I had to install the Xvfb program in the server, it was not previously installed.
Thursday, December 16, 2010
PXE-E61 and PXE-M0F disk errors
Today I encountered a computer that was showing the following errors when it was trying to boot:
PXE-E61 Media Test failure, check cable
PXE-M0F Exiting Intel Boot Agent
I remember last year I got this same error message on my laptop.
These error mean that the computer can not access the local boot disk and it has looked on the network for a boot drive. Both tries failed.
In the case of my laptop, reseating the hard drive worked. In the case of the server I encountered today, no OS was installed yet on the local disks.
PXE-E61 Media Test failure, check cable
PXE-M0F Exiting Intel Boot Agent
I remember last year I got this same error message on my laptop.
These error mean that the computer can not access the local boot disk and it has looked on the network for a boot drive. Both tries failed.
In the case of my laptop, reseating the hard drive worked. In the case of the server I encountered today, no OS was installed yet on the local disks.
What is RAID?
Today I had to set up a computer that had 12 1GB disks as a RAID 10. I have to admit I did not know what RAID 10 was, until I read this: http://support.dell.com/support/edocs/storage/storlink/H200/en/UG/PDF/H200.pdf
Subscribe to:
Posts (Atom)
