132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for sahasrara

Dear programmer This program get 2 (simply) numbers in 10 radix , then changes them to 16 radix and add together and finally shows result. I wrote it by Borland 5.2 C++ . Good Luck!

Software Development c++
0
141
Member Avatar for KevinADC

This code snippet will produce strings of numbers (1 thru 49) with no repeated numbers in the same string and no duplicated string of numbers in the list of strings. To change the range of numbers the script generates change 49 in the code to your requirements. Please feel free …

Software Development perl
Member Avatar for KevinADC
0
652
Member Avatar for ddanbe

While strolling around in the methods of the Graphics class, I bounced on the CopyFromScreen method. He, so why not make a screen capture utility! I know there is lots of this stuff out there. But it just seems like fun to try to make one myself. I made a …

Software Development
Member Avatar for ddanbe
0
3K
Member Avatar for ddanbe

Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. …

Software Development algorithm mathematics pascal
Member Avatar for ddanbe
0
97
Member Avatar for VernonDozier

I received some feedback on my [URL="http://www.daniweb.com/code/snippet1019.html"]earlier code snippet[/URL] regarding how to generate unique random numbers and someone suggested I make a shorter, easier example, so here it is. This example simply generates the integers from 0 to 9 in random order without any repeats. It is basically the function …

Software Development c++ daniweb-feedback
0
749
Member Avatar for Gribouillis

Many threads in daniweb's python forum deal with menu based programs which run in a terminal. This snippet defines a handy class, MenuCrawler, to help writing such programs. Subclassing from this base classes and adding methods corresponding to a given set of menus allows one to build the menu-based application. …

Software Development python
0
3K
Member Avatar for vckicks

A slightly modified version of Bucket Sort that uses LinkedLists and initializes buckets only when required. Results in massive speed improvements.

Software Development
0
265
Member Avatar for ddanbe

Although there is little need for any sort algorithm in C#. Every collection class has a sort method, so why would you wanna write one for yourself? My guess to learn and see how it is done. Well her are implementations of two popular sorts. The arrays are integer but …

Software Development c#
Member Avatar for subtercosm
0
837
Member Avatar for MosaicFuneral

After flipping through some organic chemistry books I had, I found a interesting little table of basic hydrocarbons. I decided it would be nice to play around with it, by putting together something that could to some accuracy generate them. I am by no means a chemist. You don't even …

Software Development c++
0
142
Member Avatar for MosaicFuneral

I decided to find a use for the STL map, and this is what I decided would be cool to practice with. Just have three placed in the code. Could use a function to load the requested elements from a file.

Software Development c++
Member Avatar for ddanbe
0
253
Member Avatar for ddanbe

You can make any color you like by setting the r, g and b values of a Color structure. But .NET has a set of predefined colors that you can use by name, so that you can simply set the backgroundcolor of a form with Color.LawnGreen for instance. Ever wondered …

Software Development
0
776
Member Avatar for VernonDozier

Very often you find that you need to generate an array of integers where each integer is unique. The program below contains two functions that do that in different ways. One uses a boolean array to keep track of the numbers that have been generated. If a number has already …

Software Development c++
Member Avatar for VernonDozier
0
508
Member Avatar for vckicks

Convert a color to a uint representation and back with simple byte shifting.

Software Development
Member Avatar for subtercosm
0
2K
Member Avatar for vckicks

Bucket sort is a very simple, fast sorting algorithm specialized in integers.

Software Development algorithm
Member Avatar for MosaicFuneral
0
2K
Member Avatar for ddanbe

Visual Studio is a great tool to use. But for beginners like me a few years back, it was a bit overwhelming and confusing. You got the feeling you lost all the control. VS has it’s special ways of doing things with partial classes and so on. So lets get …

Software Development c# visual-basic visual-studio
0
150
Member Avatar for MosaicFuneral

From part of a cryptanalysis tool I was writing, the other day. A way of obtaining possible XOR'ed string values. If you ever get to the point in the analysis that you can simply XOR the string to get closer towards your goal, of finding a weakness, this might be …

Software Development algorithm c++ encryption
Member Avatar for MosaicFuneral
0
379
Member Avatar for ddanbe

Way back years ago I tried to understand [B]delegates[/B]. See the snippet how I did it.

Software Development
Member Avatar for ddanbe
0
393
Member Avatar for gbertoli3

Set the Image's Gamma, Brightness, Contrast, Color; Enhance an Image's Edge; Turn it to a Grayscale Image; and Invert the Image.

Software Development image
0
173
Member Avatar for ddanbe

Encryption has many issues. It can be very simple or very complex. I personally don’t have that many secrets, but when the company I worked for wanted to encrypt something I used the following : XOR ! What is nice about xor is that you can use the same method …

Software Development c# encryption
Member Avatar for Ramy Mahrous
0
596
Member Avatar for MosaicFuneral

Occasionally there's times when you want to shift a bit over, but you would like to preserve the end of it, for one reason or another. Such as with say you have: [icode]10000001[/icode] but you would like: [icode]00000011[/icode] then latter on back to: [icode]10000001[/icode] Or in Dec 129-into-3, and 3-into-129. …

Software Development c++
0
1K
Member Avatar for ddanbe

Class to convert between Celcius, Fahrenheit and Kelvin temperatures. Set one temperature and automatically get the other two. This class makes use of properties. See the code snippet for details. A short main program is added to exercise the Temperature class by printing a conversion table between celsius and fahrenheit.

Software Development c#
Member Avatar for ddanbe
0
2K
Member Avatar for ddanbe

This is the last part. This is the code that sets it al together and lets the parser and scanner do some work. Happy calculating!

Software Development
0
1K
Member Avatar for ddanbe

Here is the second piece of code. The parser tries to interpret the tokens it gets from the scanner.

Software Development
0
1K
Member Avatar for reena12

''' <summary> ''' FUNCTION TO CALCULATE SUM OF TWO TIME VALUES ''' PASS TWO DATE VALUES AS STRING ''' </summary> Function GetTimeSum(ByVal dt1 As String, ByVal dt2 As String) As String Dim ReturnStr As String = "" If dt1 = "" And dt2 <> "" Then Return dt2 ElseIf dt1 …

Software Development vb.net
Member Avatar for roby22
0
266
Member Avatar for banders7

This a routine that executes a _popen() pipe on your behalf and retrieves the spawned program's/comand's console output for you. Useful if your program needs data from another program and can't communicate directly with it.

Software Development c
0
222
Member Avatar for ajay.krish123

Program is of the calculator which the usual thing for the operation. It has been totally implemented in the C language with the graphics and mouse functions included in it. Its not scientific but just a usual one..

Software Development c
Member Avatar for banders7
0
217
Member Avatar for banders7

A program that demonstrates opening Windows registry keys, reading data fields and closing the keys.

Software Development c
0
494
Member Avatar for banders7

Two very short routines. CLIPPUT transfers data to the clipboard and CLIPGET retrieves data from the clipboard. Developed and tested in Windows XP using a Borland C++ compiler.

Software Development c
Member Avatar for banders7
0
442
Member Avatar for Alex Edwards

Provides a means of performing operations on Rational numbers that can be treated as fractions to make non-whole numbers easier to calculate and read than typical floating point storage types. This was a project for a class. This is by no means an attempt to "reinvent the wheel" (The reason …

Software Development c++ storage
Member Avatar for MosaicFuneral
0
898
Member Avatar for banders7

Programming Environment: Windows XP Compilers: Borland C++ Builder 6 (Personal)/Borland C++ 5.5 (freebie) This is a routine that queries the logical drives in the system, along with their device types, local/network status and whether or not the devices are removable. Once the data are gathered, the caller's selection parameters are …

Software Development c++
Member Avatar for banders7
0
183
Member Avatar for ddanbe

If you ever want to get information about files stored in a particular map or directory, you can find out how it is done here. With a little modification you could turn this snippet into a DOS DIR-command or a UNIX(LINUX?) ls-command.

Software Development c# unix
0
220
Member Avatar for ddanbe

[TEX]Solve an equation of the form Ax^2 + Bx + C = 0.[/TEX] The class is commented, but if you have any questions don't be affraid to ask. You may exercise this class in a console application with the following snippet : [CODE]QuadraticEquation z = new QuadraticEquation(1, 3, 3); z.Solve(); …

Software Development c# mathematics
0
781
Member Avatar for ddanbe

Most of the time there are many ways to implement an algorithm. Here are two ways to implement the greatest common divisor algoritm, one of the oldest algorithms ever.

Software Development mathematics
0
410
Member Avatar for ddanbe

If you have to convert an angle from degrees to radians and way back, here are some utility functions in C#, along with a program to test them. I made use of the "out" keyword here, which allows a function to return more than one value. An alternative would be …

Software Development mathematics
0
344
Member Avatar for Gribouillis

This snippet defines a class which can group a collection of strings according to a given set of prefixes. Each string goes in the group of the longest prefix it contains.

Software Development python
0
749
Member Avatar for ShawnCplus

I ran across the need to view a specific line of a file so I wrote this up. You can view a line or a range of lines for a file or compare two files. Check the command for the syntax. Drop it in /usr/bin/sln and enjoy.

Software Development shell-scripting
Member Avatar for ShawnCplus
0
228
Member Avatar for Alex Edwards

Hmm this implementation is a bit bulky and unnecessary, but it was required as a project for one of my classes. Programming perspective: You'll notice in the code that I'm still fairly new to manipulating streams directly in C++, but I am trying my best =P. The StandardIncremental overhead could …

Software Development c++
Member Avatar for Alex Edwards
0
197
Member Avatar for gbertoli3

Change a Color Image into a Grayscale(Black & White) Image.

Software Development image
0
996
Member Avatar for gbertoli3
0
128
Member Avatar for gbertoli3
0
100
Member Avatar for vckicks

Calculate the slope between two points.

Software Development
0
153
Member Avatar for vckicks

Calculate the distance between two points.

Software Development
0
327
Member Avatar for William Hemsworth

Heres a snippet that allows you to make your own images by using a mathematical formula. It gives you fast access to each pixel in the bitmap, and then saves the image as a [B].bmp[/B] once its made. You can be creative like this and make images which would be …

Software Development c++
Member Avatar for Prabakar
0
1K
Member Avatar for toraj58

[B]Sometimes it is good to sit back and reflect on life[/B]. More specifically, you can sit back and reflect on yourself. Often you will discover information that you didn’t realize about yourself. [B]it is possible to have a C# program reflect upon itself.[/B] You can use such reflection to learn …

Software Development c#
0
149
Member Avatar for Alex Edwards

Simple program that returns a vector of string elements based on the string argument and the token specified.

Software Development c++
Member Avatar for Alex Edwards
0
183
Member Avatar for William Hemsworth

Heres a snippet that compares the speed of volatile (nonregister) variables, and register variables and display's the average cycle count for each. This shows you exactly how much using registers speeds up loops and calculations. I get the following output, but it may vary: [QUOTE]Cycle count for nonregister integer: 8 …

Software Development c++
0
148
Member Avatar for Kelicula

Ever had to fix auto-generated dates retrieved from MySql databases? I made a really quick fix that displays the date in "human readable" format. Just replace "CST" with GMT, or EST etc... Whatever time zone your mysql server is located. it takes one argument, the date from the database. [B]Usage:[/B] …

Software Development mysql perl
Member Avatar for Kelicula
0
219
Member Avatar for Kelicula

[B]Situation:[/B] Ever wanted to get the size of an image? Possibly to determine new height and width dimensions that DO NOT distort the proportion. Well I have, and I overcame the math like so. [B]Solution:[/B] First you must decide on an image width. The subroutine returns the proportional height equivalent. …

Software Development html-css image perl
Member Avatar for Kelicula
0
167
Member Avatar for Alex Edwards

I'm not sure if it has been done yet or not, but I thought this program might be helpful to those that want to practice SQL in Java, because it sure is helpful for me! =) The assumption is that you're running Java 5+ and that you have a Database …

Software Development java
Member Avatar for newtonorina
0
248
Member Avatar for llemes4011

A program that finds the day of the week you were born on. Once again, this was adapted from a homework assignment, but I rewrote the entire thing from scratch >.< but it was a lot of fun.

Software Development java
Member Avatar for toyi
0
2K

The End.