Recent Notes

Displaying notes 61 - 70
Created by voodoo on June 17, 2010 21:16:59
I had this configure error while building PostgreSQL on Solaris 10: checking size of off_t... configure: error: cannot compute sizeof (off_t) Looking at config.log it was apparent that when configure tried to run conftest it failed to load libreadline.so.5 . I had libreadline.so.5 under /usr/local/lib , so I made a symlink to it under /usr/lib and that solved the problem. Maybe there's another way to tell conftest to look for libreadline.so.5 under /usr/local/lib ?
Created by voodoo on June 17, 2010 19:39:14
There are two ways to run a SQL script with PostgreSQL: From shell: $ psql theScript.sql Interactively: postgres=# \i theScript.sql
Created by voodoo on June 17, 2010 16:47:29
While the rest of UNIX flavors use sudo , the preferred way for Solaris seems to be RBAC: Solaris 10 Role Based Access Control (RBAC)
Created by voodoo on June 17, 2010 16:02:07    Last update: June 17, 2010 16:03:05
Use the uname command to display the SunOS version: $ uname -a SunOS STAWOW1 5.10 Generic_142900-01 sun4v sparc SUNW,SPARC-Enterprise-T5120 $ uname -sr SunOS 5.10 I can't find a command to display Solaris version. But the /etc/release file gives version information: $ cat /etc/release Solaris 10 11/06 s10s_u3wos_10 SPARC Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 14 November 2006 This is a mapping of SunOS versions to Solaris versions: SunOS Version Solaris Version SunOS 5.4 Solaris 2.4 SunOS 5.5 Solaris 2.5 SunOS 5.5.1 Solaris 2.5.1 SunOS 5.6 Solaris 2.6 SunOS 5.7 Solaris 7 SunOS 5.8 Solaris 8 SunOS 5.9 Solaris 9 SunOS 5.10 Solaris 10 Reference: SUN Solaris Unix Commands and Scripts
Created by voodoo on June 17, 2010 15:32:12
Use the passwd command to set the password for a user: passwd demo
Created by voodoo on June 17, 2010 15:23:02    Last update: June 17, 2010 15:35:40
Use useradd to add a user (the switches are not required, but it's a good idea to give them. For example, without -m you'd create a user without a home directory): # -d switch specifies user home directory # -m creates the home directory # -s gives path to the default shell # -c a comment useradd -d /export/home/demo -m -s /bin/ksh -c "Demo User" demo You also need to use the passwd command to set a new password before the user can log in. To delete a user, use the userdel command: userdel demo
Created by Dr. Xi on June 16, 2010 21:24:38
More arguments than format specifiers (place holders) are allowed but not vise versa. public class TestStringFormat { public static void main(String[] args) { System.out.println(String.format("%s", "a", "b", "c")); System.out.println(String.format("%s%s", "a", "b", "c")); System.out.println(String.format("%s%s%s", "a", "b", "c")); System.out.println(String.format("%s%s%s%s", "a", "b", "c")); } }
Created by woolf on June 16, 2010 16:55:37    Last update: June 21, 2010 02:46:05
Windows XP has built-in capability for burning folders/files onto a CD ROM. Use the Recording tab in the CD-ROM drive properties dialog to configure the options: However, it doesn't have the capability to burn ISO images. On the MS site it was suggested that ISO Recorder would do the job. I tried it on two different machines and both failed with " generic error ". I'm running Windows XP professional SP2 on both. Update: Actually the above error for ISO Recorder was caused by a monitoring program the company installed to block CD-ROM write access. Although unsuccessful, ISO Recorder actually went further than other programs. cdburn.exe from the Windows 2003 Resource Kit died at 0% without emitting any error message.
Created by Dr. Xi on June 16, 2010 16:06:51
The + operator which is used in Java to concatenate strings does not work in JSP. In JSP, you simply string them together without the + operator. <!DOCTYPE html> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <html> <head> <title>Test Page</title> </head> <body> <c:set var="majorVersion" value="1"/> <c:set var="minorVersion" value="03"/> Full version: <c:out value="${majorVersion}.${minorVersion}"/> <br> <c:set var="fullVersion" value="${majorVersion}.${minorVersion}"/> <c:if test="${'1.03' == fullVersion}"> Can't use concatenation directly in test condition, set variable fullVersion first! </c:if> </body> </html>
Created by Dr. Xi on June 11, 2010 23:11:59    Last update: June 11, 2010 23:14:02
Given a simple XML file like this: <?xml version="1.0"?> <root id="1"> <node id="12"> <text id="123">Some garbage.</text> </node> </root> Calling Document.getElementById returns null (surprisingly!): import java.io.*; import org.w3c.dom.*; import javax.xml.parsers.*; public class TestGetElementById { public static void main(String[] args) throws Exception { String id = "123"; if (args.length > 0) { id = args[0]; } DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); System.out.println("Is Validating: " + domFactory.isValidating()); domFactory.setNamespaceAware(true); DocumentBuilder docBuilder = domFactory.newDocumentBuilder(); Document doc = docBuilder.parse("simple.xml"); Node n = doc.getElementById(id); if (n == null) { System.out.println("Failed to find node for id: " + id); } else { System.out.println("Found node: " + n); } } } In fact the JavaDoc says something along the lines that getElementById returns the Element that has an ID attribute with the given value. An ...
Previous  2 3 4 5 6 7 8 9 10 11 Next