devxlogo

Tip Bank

Write to Multiple Targets Simultaneously

This is helpful, for instance, if you’re error logging to the file and body of an e-mail. Create a new subclass of OutputStream called TeeOutputStream like this: package be.marble.io;import java.io.*;public

Negative Numbers Represented in C++

You probably know that integers are represented in binary–in base 2. This is pretty straightforward for positive numbers, but it means you must choose an encoding for representing negatives. The

DisplayExceptionInfo – Displaying error information

‘ A reusable routine that displays error information’ Note: requires Imports System.ReflectionSub DisplayExceptionInfo(ByVal e As Exception) ‘ Display the error message. Console.WriteLine(e.Message) Dim st As New StackTrace(e, True) Dim i