Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
VB VB (1648)
VB.net VB.net (736)
C# C# (15)
ASP.net ASP.net (779)
ASP ASP (41)
VC++ VC++ (25)
PHP PHP (0)
JAVA JAVA (4)
JScript JScript (5)
  Database
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
Automation
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
OS/Networking
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
Graphics
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
Links
» ASP.net (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» VB.net (4)
» VC (3)
» HTML/CSS/JavaScript (10)
Tools
» Regular Expr Tester
» Free Tools

Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )

RotateLeftI - Rotate an Integer to the left
Total Hit (1774) «Code LangId=1»' Rotate an Integer to the left the specified number of times ' ' NOTE: requires Power2() Function RotateLeftI(ByVal value As Integer, ByVal times As Long) As Integer Dim i As Long, signBits As Integer ' no need to rotate more times than required times = time ....Read More
Rating
RotateRight - Rotate a Long to the right
Total Hit (1793) «Code LangId=1»' Rotate a Long to the right the specified number of times ' ' NOTE: requires Power2() Function RotateRight(ByVal value As Long, ByVal times As Long) As Long Dim i As Long, signBits As Long ' no need to rotate more times than required times = times Mod 32 ....Read More
Rating
RotateRightI - Rotate an Integer to the right
Total Hit (1566) «Code LangId=1»' Rotate an Integer to the right the specified number of times ' ' NOTE: requires Power2() Function RotateRightI(ByVal value As Integer, ByVal times As Long) As Integer Dim i As Long, signBits As Integer ' no need to rotate more times than required times = ti ....Read More
Rating
ShiftLeft - Shift a Long to the left
Total Hit (1548) «Code LangId=1»' Shift to the left of the specified number of times ' ' NOTE: requires Power2() Function ShiftLeft(ByVal value As Long, ByVal times As Long) As Long ' we need to create a mask of 1's corresponding to the ' times in VALUE that will be retained in the result Dim mas ....Read More
Rating
ShiftRight - Shift a Long to the right
Total Hit (2438) «Code LangId=1»' Shift to the right of the specified number of times ' ' NOTE: requires Power2() Function ShiftRight(ByVal value As Long, ByVal times As Long) As Long ' we need to create a mask of 1's corresponding to the ' digits in VALUE that will be retained in the result Dim ....Read More
Rating
SinH, CosH, TanH, CotH, SecH, CscH - Hyperbolic trig functions
Total Hit (2329) «Code LangId=1» ' hyperbolic sine Function SinH(value As Double) As Double Dim temp As Double temp = Exp(value) SinH = (temp - 1 / temp) / 2 End Function ' hyperbolic cosine Function CosH(value As Double) As Double Dim temp As Double temp = Exp(value) CosH = ....Read More
Rating
TriangleArea - Evaluate the area of any triangle given its sides
Total Hit (1483) «Code LangId=1»' evaluate the area of a triangle ' given its three sides Function TriangleArea(side1 As Double, side2 As Double, _ side3 As Double) As Double ' this function uses the Heron formula Dim halfP As Double ' evaluate half of the perimeter halfP = (side1 + side ....Read More
Rating
Any2Dec - Convert from any numeric base to decimal
Total Hit (2894) «Code LangId=2»' convert from any base to decimal ' BASE can be in the range 2-36 Function Any2Dec(ByVal otherBaseNumber As String, ByVal base As Integer) As Long Dim digits As String Dim digitValue As Long ' check base If base < 2 Or base > 36 Then Throw New Argum ....Read More
Rating
CelsiusToFahrenheit, FahrenheitToCelsius - Convert temperature values
Total Hit (2687) «Code LangId=1»' Returns the integer equal or higher than its argument Function Ceiling(Number As Double) As Long Ceiling = -Int(-Number) End Function «/Code»
Rating
Combinations - The number of combinations of N objects in groups of N
Total Hit (2504) «Code LangId=1»' number of Combinations of N objects in groups of M ' ' Note: requires the FACTORIAL routine Function Combinations(ByVal Objects As Long, ByVal GroupSize As Long) As Double Combinations = (Factorial(Objects) / Factorial(Objects - GroupSize)) / _ Factorial(GroupSize ....Read More
Rating
Cot, Sec, Csc - Missing trig functions
Total Hit (3467) «Code LangId=1»' Cotangent of an angle Function Cot(radians As Double) As Double Cot = 1 / Tan(radians) End Function ' Secant of an angle Function Sec(radians As Double) As Double Sec = 1 / Cos(radians) End Function ' cosecant of an angle Function Csc(radians As Double) As ....Read More
Rating
Crc16 - Evaluate the 16-bit CRC of an array of bytes
Total Hit (4469) «Code LangId=1»Option Explicit ' Evalutate the 16-bit CRC (Cyclic Redundancy Checksum) of an array of bytes ' ' If you omit the second argument, the entire array is considered Function Crc16(cp() As Byte, Optional ByVal Size As Long = -1) As Long Dim i As Long Dim fcs As Long Static ....Read More
Rating
Dec2Any - Convert a decimal number to any other base
Total Hit (3164) «Code LangId=1»' convert a number to any base ' BASE can be in the range 2-36 Function Dec2Any(ByVal number As Long, ByVal base As Integer) As String Dim index As Long Dim digits As String Dim digitValue As Long ' check base If base < 2 Or base > 36 Then Err.Raise ....Read More
Rating
DecToFrac - Converts a decimal number into a fraction
Total Hit (1735) «Code LangId=1»' Converts a decimal value into fractional parts as integers ' (based on the concept of Continued Fractions) ' Examples of usage: ' Call DeclToFrac(0.125, a, b) ' 1 and 8 are returned in a & b ' Call DecToFrac(5/40, a, b) ' 1 and 8 are also returned ' Call DecToFrac(2/3 ....Read More
Rating
DegreesToRadians, RadiansToDegrees - Convert from radians to degrees and back
Total Hit (1683) «Code LangId=1»' convert from degrees to radians Function DegreesToRadians(ByVal degrees As Single) As Single DegreesToRadians = degrees / 57.29578 End Function ' convert from radians to degrees Function RadiansToDegrees(ByVal radians As Single) As Single RadiansToDegrees = radia ....Read More
Rating
Factorial - The factorial of a number
Total Hit (1669) «Code LangId=1»' The factorial of a number ' ' if NUMBER is negative or >170 it raises an ' "subscript out of range" error Function Factorial(ByVal number As Long) As Double Static result(170) As Double ' this routine is very fast because it ' caches all the possible resul ....Read More
Rating
Fract - The fractional portion of a number
Total Hit (1533) «Code LangId=1»' The fractional part of a floating-point number ' note that negative numbers return negative values Function Fract(number As Variant) As Variant Fract = number - Fix(number) End Function «/Code»
Rating
GCD - The Greatest Common Divisor of two integers
Total Hit (1636) «Code LangId=1»' the Greatest Common Divisor of two integers ' (it uses the Euclide's algorithm) ' if either argument is zero you get a "Division by Zero" error Function GCD(ByVal n1 As Long, ByVal n2 As Long) As Long Dim tmp As Long Do ' swap the items so that n1 >= n2 ....Read More
Rating
GetPrimeNumbers - Evaluate the first N prime numbers
Total Hit (1579) «Code LangId=1»' Returns an array with the first N prime numbers ' ' Note: you can easily convert this routine to VB4 and VB5 by ' returning the result array through an argument instead of ' the return value Function GetPrimeNumbers(numberOfPrimes As Long) As Long() Dim found As Long ....Read More
Rating
HiWord - The most significant word in a Long value
Total Hit (2150) «Code LangId=1» Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _ Any, source As Any, ByVal bytes As Long) ' Return the high word of a Long value. Function HiWord(ByVal value As Long) As Integer CopyMemory HiWord, ByVal VarPtr(value) + 2, 2 End Function ....Read More
Rating
IsPrime - Determine whether a number is prime
Total Hit (1583) «Code LangId=1» ' Return True if the number is prime Function IsPrime(ByVal number As Long) As Boolean ' manually test 2 and 3 If number > 3 Then If number Mod 2 = 0 Then Exit Function If number Mod 3 = 0 Then Exit Function End If ' we can now avoid to consi ....Read More
Rating
LCM - The Least Common Multiple of two integers
Total Hit (3293) «Code LangId=1»' the Least Common Multiple of two integers ' (it uses the Euclide's algorithm) ' if either argument is zero you get a "Division by Zero" error ' ' Note: if your app also includes the CGD() function, ' you can simplify the following code as follows: ' LCM = (n1 * n2) ....Read More
Rating
Log10 - Base-10 logarithm
Total Hit (1649) «Code LangId=1» ' Base 10 logarithm Function Log10(number As Double) As Double Log10 = Log(number) / 2.30258509299405 End Function «/Code»
Rating
LowWord - The least significant word of a Long value.
Total Hit (2098) «Code LangId=1»Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _ Any, source As Any, ByVal bytes As Long) ' Return the low word of a Long value Function LowWord(ByVal value As Long) As Integer CopyMemory LowWord, value, 2 End Function «/Code» ....Read More
Rating
MK? And CV? - Convert numbers to strings and back
Total Hit (3062) «Code LangId=1» ' This group of routines convert a numeric value into a string ' that contain the internal representation of the number. ' They can be useful when converting outdated QuickBasic programs, ' because that language supported these functions that were ' never ported to Visual Basic ....Read More
Rating
NormRand - Produce random numbers with normal distribution
Total Hit (2312) «Code LangId=1»' VBA's intrinsic Rnd function returns numbers evenly ' distributed between 0 and 1. Each number in that ' interval has equal probability of being returned ' for any given function call. ' This function NormRand returns a random number between ' -infinity and +infinity distib ....Read More
Rating
Permutations - Number of permutations of N objects in groups of M
Total Hit (1646) «Code LangId=1»' number of permutations of N objects in groups of M ' ' Note: requires the FACTORIAL routine Function Permutations(ByVal Objects As Long, ByVal GroupSize As Long) As Double Permutations = Factorial(Objects) / Factorial(Objects - GroupSize) End Function «/Code» ....Read More
Rating
Power2 - A power of 2
Total Hit (1739) «Code LangId=1» ' Raise 2 to a power ' the exponent must be in the range [0,31] Function Power2(ByVal exponent As Long) As Long Static res(0 To 31) As Long Dim i As Long ' rule out errors If exponent < 0 Or exponent > 31 Then Err.Raise 5 ' initialize the arr ....Read More
Rating
Rnd2 - A random value in a range
Total Hit (1519) «Code LangId=1» ' A random number in the range (low, high) Function Rnd2(low As Single, high As Single) As Single Rnd2 = Rnd * (high - low) + low End Function «/Code»
Rating
RotateLeft - Rotate a Long to the left
Total Hit (1743) «Code LangId=1»' Rotate a Long to the left the specified number of times ' ' NOTE: requires Power2() Function RotateLeft(ByVal value As Long, ByVal times As Long) As Long Dim i As Long, signBits As Long ' no need to rotate more times than required times = times Mod 32 ....Read More
Rating


(Page 109 of 133) 3968 Result(s) found  ... 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 ...

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.