Recent

Find the Sign of a Number in C#

System.Math?class?has?a?Sign?method?that?will?help?you?determine?if?a?number?has?a?negative?sign?or?positive?sign.? //returns?-1? int?negativeNumber??=?System.Math.Sign(-2);? //?returns?1 int?postiveNumber?=?System.Math.Sign(1);? //returns?0 ?int?neutralNumber?=?Math.Sign(0);?

Format the Console.Write Responses

We use string.format to format the data written to the console using the console.write or console.writeline commands. However, it isn’t indented well to make it readable. C# allows you to

How to Check Whether a Number Is Prime

Java has an API called BigInteger and it is easily able to identify if the number under consideration is a prime number or not. Code snippet: import java.math.BigInteger;public class ProbablePrime{

Does Your Timezone Support Daylight Saving Time?

You may want to know if your timezone supports Daylight Saving Time programmatically. This can be easily determined with the code below: Listing 1. Sample Code import java.util.TimeZone;public class DaylightSavingsTime{

Determine if the Current Request Is from a Crawler in ASP.NET

The System.Web.HttpBroswerCapabilities?has an important property called “Crawler” that enables us to handle requests from crawlers. Please check out the example below: Var isCrawler = ((System.Web.Configuration.HttpCapabilitiesBase)Request.Browser).Crawler;

Using the iFrame HTML Tag

The HTML tag creates an inline frame, used to embed another document into your current HTML page. This element is great because you can include content such as advertising banners,

Clip an Image Using CSS with the CLIP Property

Images with absolute positioning can be clipped very easily with the CSS Clip property. The syntax is as below. .clippedImageStyle { position: absolute; clip: rect(100px, 150px, 175px, 30px);}