February 4, 2009

Developing Orientation-Aware Android Applications

ost modern, self-respecting mobile operating systems in today’s market support different screen orientations based on the position of the device. Android is no exception. While this feature is often taken for granted, it’s something on which developers spend extra time, ensuring that their applications work flawlessly regardless of screen orientation.

Handle Null in JavaScript with the “||” Operator

The “||” Operator can be used to handle nulls in variables or to handle an undefined variable itself. This operator, along with coalescing, can also be used to set default values to variables. Instead of using the ternary operator to handle a null value and set the default values, you

Developing a NIO Server

As you probably know, NIO offers many advantages?like speed and a large number of concurrent connections: import java.io.*;import java.net.*;import java.nio.*;import java.util.*;import java.nio.channels.*;import java.nio.charset.*;public class ServerNIO{ public static void main(String[] args){ ServerSocketChannel serverNIO=null; InetSocketAddress ISA=null; Selector selector=null; ByteBuffer clientBuf=null; int port=5000;try{ serverNIO=ServerSocketChannel.open(); serverNIO.configureBlocking(false); }catch(IOException e) {System.out.println(e.getMessage());} try{ InetAddress addr=InetAddress.getByName(“localhost”); ISA=new InetSocketAddress(addr,port);

Simplify Classic ASP Debugging in VS 2005

Like its predessor, VS 2005 does not allow you to debug classic ASP pages by default. Instead, you have to manually attach the ASP worker process (w3wp.exe). Follow these simple steps: Enable ASP debugging on the server. Open the classic ASP Page in VS 2005. Set breakpoint. View page in