132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for gabriel_wadley

this's daoremon's song code i hope you ever see doraemon's movie...

Software Development c++
Member Avatar for vegaseat
0
6K
Member Avatar for iamthwee

Evaluates an expression as a string using reverse polish notation.

Software Development c++
Member Avatar for William Hemsworth
0
954
Member Avatar for Dave Sinkula

This snippet uses [INLINECODE]strtod[/INLINECODE] to be a little more stringent.

Software Development c
Member Avatar for bemboysms
0
249
Member Avatar for nanodano

This code snippet actually contains a few nifty things. There are two functions, hasVisited() and main(). hasVisited() makes use of a very handy function for CGI programmers: getenv. You can see I use it to retrieve REMOTE_ADDR which is the person's IP address. In main() it gets the count from …

Software Development c c# c++
Member Avatar for manutd
0
262
Member Avatar for vegaseat

This little snippet combines a Tkinter GUI application with sound from the pygame mixer. The snippet should do fairly well across platforms. I tested it on a Windows XP machine, but let me know your experience with other platforms.

Software Development gui python tkinter
0
453
Member Avatar for nihilks

The program uses doubly linked lists to store the numbers where each node contains a single digit . Hence numbers of any length can be used as operands . Program works only with +ve integers

Software Development c
0
142
Member Avatar for MattEvans

Ever wanted to evaluate a user-provided expression, maybe from a form input or otherwise, and return the result? eval($expr) is dangerous because eval(open $out, "> file.what"); will open the file, infact, eval(everything) will pretty much do everything. checking though everything is tedious, and manually parsing everything seems like a waste …

Software Development perl
Member Avatar for KevinADC
0
392
Member Avatar for teddy13
Member Avatar for ~s.o.s~
0
383
Member Avatar for kalyanraj
Member Avatar for progurammaar
0
507
Member Avatar for venomlash

This can be used for plotting radioactive decay of an unlimited* number of elements, decaying into each other. *Limited only by memory and user attention span.

Software Development c++
0
179
Member Avatar for Mouche

This game takes a random word from a list, gives you five prompts to guess letters in the word, and then it shows you a "masked word," filling in the letters you've guessed. Say the word is "hockey" and the user guesses: 'h,' 'e,' 't,' 'r,' and 's.'The masked word …

Software Development python
0
280
Member Avatar for roverphoenix

the code now contains snippet to create the linked list too! any questions can be directed to [U]raghu_tillu@hotmail.com[/U]

Software Development c linked-list
Member Avatar for virusfree
0
152
Member Avatar for Ene Uran

The snippet shows the use of a list of class instances to form a sortable and searchable database for solvents, or for that matter other chemicals. The list can be expanded and all the needed data added at the same time.

Software Development python
0
269
Member Avatar for vegaseat

You can use the Tkinter canvas and the canvas.create_line() function to draw a line plot of a mathematical function. The canvas.create_line() function accepts a list of x, y points that you can create within a for loop. The resulting plot is centered and can be stretched along the x and …

Software Development python tkinter
0
2K
Member Avatar for bumsfeld

The wxPython GUI tool makes it very simple to create nice looking analog clock. The analog clock component was put into simple dialog frame and can be moved about the screen.

Software Development gui python
0
729
Member Avatar for venomlash

For those of you who live at home, run this on your parents' computer fullscreen, blue background, white font. Then put the mouse over the block in the upper lefthand corner, and enjoy the show.:twisted:

Software Development c++
Member Avatar for lol_hacker101
0
134
Member Avatar for venomlash

This code will let you play Battleship against the computer (bad graphics, I know) for a while, upon which it quits without so much as an error message. Could an experienced coder look this over and tell me why? Thanks. Venomlash :?:

Software Development c++
0
125
Member Avatar for ~s.o.s~

Hello to everyone out there. Recently many people on different forums have been asking how to make a recursive function which reverses the string passed to it. But unlike the normal recrusive funtion which only prints out the reversed string, this implementation returns a pointer to reversed string.

Software Development c
Member Avatar for roverphoenix
0
172
Member Avatar for Lord Soth

Based on [url]http://astronomy.swin.edu.au/~pbourke/geometry/insidepoly/[/url] Converted to Delphi by Lord Soth

Software Development delphi pascal
Member Avatar for Zajoma
0
768
Member Avatar for ~s.o.s~

The program parses the digits in the number supplied to it and converts it to aplhabetical equivalent. Fore eg. input: 1234 output: one two three four This is a simple exercise for newbies, must try out. Tested and works under ideal input conditions.

Software Development c
Member Avatar for ~s.o.s~
0
185
Member Avatar for Ene Uran

A list of tuples is easy to sort for items in the tuples. This snippet shows you how to sort a (character, frequency) tuple either by character or by frequency. One useful example would be the sorting and display of a list of (player, score) tuples, you might find in …

Software Development python
0
253
Member Avatar for Mushy-pea

This is my first working perl script that does anything useful; that being to count the hits made on a web page and display the count graphically. To make the counter work on your web page (should you wish to), you will need to create images for the number tiles …

Software Development perl
Member Avatar for Mushy-pea
0
197
Member Avatar for vegaseat

This is a short code example using the function os.stat() to get some of the basic file information. Things like file size, times the file was created (Windows), last modified, and last accessed. The program uses a dictionary in an interesting way to store and display the information. The times …

Software Development file-system python
0
2K
Member Avatar for vegaseat

This Python code shows a way to retrieve a picture from a web page and save it to a file.

Software Development python
Member Avatar for RonaldDuncan
0
2K
Member Avatar for amatallah
Member Avatar for manutd
0
142
Member Avatar for andor

This algorithm proved to be effective when two images are combined. The picture beneath (background) is seen if alpha component of fronth picture is less then 0xFF. If alpha of front picture (src in snippet) is zero then all we see is background picture. The format of colour is ARGB …

Software Development algorithm c
Member Avatar for Jason Zhang
0
1K
Member Avatar for kylethedarkn

Java Code that creates a random number between 1 and 100 and then asks the user to guess the number and tells if the guess was too high, too low or, the right number. Loops until right number is guessed.

Software Development java
Member Avatar for StonedNpwnd
0
342
Member Avatar for roverphoenix

A simple program to calculate combinations of a string using recursion, I have used a malloc string of size 100 , you can change it to whatever value you want. The author is currently working at Microsoft. for eg if input string is abcd and you want all 3 letter …

Software Development c
Member Avatar for roverphoenix
0
378
Member Avatar for KevinADC

Convert 1000000 into 1,000,000 using a perl regexp.

Software Development perl
Member Avatar for KevinADC
0
259
Member Avatar for Dani

[LEFT]This is a program I wrote for my x86 assembly class which revolves a "roulette wheel" around. Wait about a minute and it will eventually slow down to a stop. It uses Irvine32.inc which came with the textbook.[/LEFT]

Software Development assembly
Member Avatar for holmes008
0
357
Member Avatar for Dani

This is a program I wrote for my x86 assembly class which bounces an ASCII ball across the screen. It uses Irvine32.inc which came with the textbook.

Software Development assembly
0
2K
Member Avatar for KevinADC

Use the List::Util module. I believe List::Util is a core module starting with perl 5.8. For older versions of perl you may need to install the module. See the module documentation for more details: [URL="http://perldoc.perl.org/List/Util.html"]List::Util[/URL]

Software Development perl
0
167
Member Avatar for KevinADC

I've seen this question (or similar) asked many times on forums: I have a variable in a file (text) and want to expand it. For example, I have this line in a text file: Mary had a little $lamb and I want to be able to expand $lamb but text …

Software Development perl
0
278
Member Avatar for KevinADC

"How can I find all the permutations of a list (or a word)"? I have seen this question asked a number of times on forums. There is a module that makes this task very easy: List::Permutor. It is not a core module so you may need to install it. See …

Software Development perl
0
174
Member Avatar for KevinADC

You will need to install the Email::Valid module if it's not already installed. See the module documentation for further details. [URL="http://search.cpan.org/~rjbs/Email-Valid-0.176/lib/Email/Valid.pm"]Email::Valid[/URL]

Software Development email perl
0
294
Member Avatar for KevinADC

The [URL="http://perldoc.perl.org/File/Basename.html"]File::Basename[/URL] module is used to parse file paths into directory, filename and suffix (or file extension). My simple example shows how to get just the file extensions.

Software Development file-system perl
0
884
Member Avatar for Maggot

a simple program to test the JDBC drivers.

Software Development java
0
243
Member Avatar for Dave Sinkula

This snippet is an example of using XOR encryption to encrypt/decrypt a file. It uses command-line input parameters as follows:[indent]argv[1] - name of input file to encrypt/decrypt argv[2] - name of output file argv[3] - crypt key[/indent]For example, an input file called "main.c" is used to create an output file …

Software Development c encryption
Member Avatar for vonqi
0
338
Member Avatar for bumsfeld

Here we search a Python script file (or other text file) for one certain string, and copy any files containing this string to another folder.

Software Development python
0
213
Member Avatar for bumsfeld

Search for a file given its name and the starting search directory. The search is limited to a set depth of subdirectories. Python makes this easy to do.

Software Development python
0
224
Member Avatar for bumsfeld

This Python code will search for given filename starting with given directory. It will also search all the subdirectories in the given directory. The search will end at the first hit.

Software Development python
0
153
Member Avatar for bumsfeld

Code snippet to show you how to verify exit events from wxPython using dialog window. One event is from menu exit and the other from frame exit (x symbol in corner).

Software Development python
0
715
Member Avatar for bumsfeld

This short code shows how to indicate the mouse-over event on wxPython button, similar to the mouse-over in web pages. Button changes colour when mouse pointer is over its area.

Software Development python
0
2K
Member Avatar for Dave Sinkula

In [url=http://www.daniweb.com/code/snippet259.html]Part 1[/url], the code reversed the string in place. This version uses a source and a destination string.

Software Development c
0
138
Member Avatar for bumsfeld

The myth is around that while loop is faster than the corresponding for loop. I checked it out with Python module timeit, and came to surprising conclusion. This snippet can easily be modified to time any of your functions you write.

Software Development python
Member Avatar for Begjinner
0
2K
Member Avatar for hemanthjava

JAVA Date Utility ( This program Demonstrates the proper use of Date functionality in common java programming scenarios ) Date and Time

Software Development java
Member Avatar for msg2ajay
0
206
Member Avatar for Rajnesh

/*This program works just like MS-DOS. It takes in the input, uses the C Library, uses the system files and function, executing and displaying the code on the same command prompt. */

Software Development c
Member Avatar for Ancient Dragon
0
1K
Member Avatar for vegaseat

Let mathematics do your art work! It is amazing how a simple mathematical formula can draw very intricate shapes. Here we draw a fractal tree on a Python Image Library (PIL) blank image, and save the finished drawing as an image file in one of the popular formats. Look at …

Software Development mathematics python
0
694
Member Avatar for vegaseat

The wx.BitmapButton shows an image, great for those folks who think that a picture is worth a thousand words. The snippet gives an example how to load the image, size the button, and put the image on the the button.

Software Development python
Member Avatar for InfoClock
0
827
Member Avatar for bumsfeld

The program takes text and establishes dictionary of character:frequency. This dictionary is then presented sorted by character. Since it is important to show the most frequent characters, two methods are given to present dictionary sorted by frequency. Should all be very good for learning Python.

Software Development python
0
627

The End.