132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for Dave Sinkula

How might I write an implementation in C of the standard library function [inlinecode]strcat[/inlinecode]? Here's how I might.

Software Development c
0
296
Member Avatar for vegaseat

The wxPython widget wx.Gauge is commonly called a progress bar. In this code snippet I have bound the wx.Gauge to a wx.Slider, as you move the slider so do the indicating bars of the gauge. A second method is explored too, here the gauge indicates the progress of a timed …

Software Development python
0
416
Member Avatar for vegaseat

Create a dictionary with char:count pairs, change the dictionary to a list of (char, count) tuples, sort the list by character and display the result. That's all there is to counting and displaying the characters in a given string. Just a few lines of Python code.

Software Development python
0
886
Member Avatar for vegaseat

Here is a generator function using find() to do a search for all the occurances of a substring in a text. It will give you all the positions/indexes within the text where the substring is located. The sample text here can be replaced by text read in from a file.

Software Development python
0
169
Member Avatar for vegaseat

This snippet takes a look at Python file handling. Different ways to write and read text files, zipped files and memory streams. Investigates how to access only part of a file. Also explores the "read" of a binary image file and performs a hex-dump of the data.

Software Development file-system python
0
573
Member Avatar for vegaseat

For loops in Python are quite versatile. The little keyword "in" allows you to loop through the elements of all kinds of sequences, may the elements be numbers, characters, strings, objects like tuples and more. Here is an example comparing range(), xrange() and a generator similar to xrange().

Software Development python
Member Avatar for vegaseat
0
2K
Member Avatar for vegaseat

Years ago I wrote a little screen-saver in Delphi that randomly put colorful circles all over the screen. A hit with the secretaries in the office. I modified a simple Tkinter based snippet to put the same colorful circles all over a window form at random locations, random radii and …

Software Development delphi python tkinter
0
1K
Member Avatar for aj.wh.ca

Find the maximum element in an unsorted array using recursion

Software Development c
Member Avatar for sweetleaf
0
153
Member Avatar for bumsfeld

Here is a list of macros I have been using.

Software Development c
Member Avatar for vegaseat
0
283
Member Avatar for lazylibran82

This code enables one to find the height of a binary tree using a queue and a marker.

Software Development c queue
0
170
Member Avatar for G-Do

Here's a cute little encipher/decipher program with a Tkinter GUI I wrote a while back. It's an implementation of a derivative of the Vigenere algorithm; the algorithm is taken from Laurence Smith's Cryptography: The Science of Secret Writing, Amazon link here. It's a dated book (and the technique itself is …

Software Development algorithm gui python tkinter
0
258
Member Avatar for Dave Sinkula

If the user tries to put 80 characters in a 20-character buffer, you may have issues. This snippet shows one way to cap the input and discard excess input. [i]See also [url=http://www.daniweb.com/code/snippet280.html]Safe Version of gets()[/url] and [url=http://www.daniweb.com/code/snippet278.html]Read a Line of Text from the User[/url].[/i]

Software Development c
0
327
Member Avatar for vegaseat

This question came up on the forum. How do you swap two numbers without using a temporary variable? I used all the power of my brain to solve this at four o'clock in the morning. In all fairness, swapping two numbers using a temporay variable is about five times faster. …

Software Development c++
Member Avatar for Duoas
0
224
Member Avatar for vegaseat

The psyco module has been around for a while and has been used to speed up the Python interpreter. For those of you who think speed is all important, take a look at a typical example. Psyco is similar to Java's just in time compiler. How does psyco do it? …

Software Development python
0
227
Member Avatar for Dave Sinkula

This snippet shows one way to calculate the number of days since a given date until present time. Note that this code will not work for dates outside of the current epoch, which typically begins on January 1, 1970.

Software Development c
0
765
Member Avatar for bumsfeld

This program use a while loop to delete trailing spaces and tabs from a string. It is meant to be more of an example of the application of the while loop.

Software Development c
0
1K
Member Avatar for bumsfeld

Just a colorful ten second countdown to New Year. Hope you can learn some code from it.

Software Development python tkinter
0
3K
Member Avatar for vegaseat

The Python module zlib allows you to compress a typical text string to about one half its original size. A handy feature when you have to transmit or save a large amount of text or data. It saves you time both writing and later reading back the compressed file. The …

Software Development python
0
1K
Member Avatar for Dave Sinkula

Some issues, such as leading whitespace and trailing characters that cannot be part of a number, were not handled in [url=http://www.daniweb.com/code/snippet357.html]Read a Floating-Point Value from the User, Part 1[/url]. Here such issues receive lip service. [I]See also [url=http://www.daniweb.com/code/snippet597.html]Read a Floating-Point Value from the User, Part 3[/url][/I].

Software Development c
0
440
Member Avatar for Dave Sinkula

Obtaining user input can be done in many surprisingly different ways. This code is somewhere in the middle: safer than [inlinecode]scanf("%lf", &n)[/inlinecode], but not bulletproof. It is meant to be a simple but relatively safe demonstration. Note also that there would be slight differences for using [inlinecode]float[/inlinecode] instead of [inlinecode]double[/inlinecode]. …

Software Development c
0
211
Member Avatar for Paul.Esson

I know what your thinking, You and everyone else has always wanted a clock that sits at the top of your command prompt and tells you the time. Why ? I made this in first year when i spent countless hours programming and little in bed. I decided i needed …

Software Development shell-scripting
Member Avatar for Mpiangu
0
162
Member Avatar for Paul.Esson

My second C++ lab, bit of fun if i do say so my self. Its a stack that uses a linked list in C++ alot of debugging stuff still in here, but I like the debugging output anyway. Sorry about the lack of comments and

Software Development c++ linked-list
0
151
Member Avatar for tayspen
0
146
Member Avatar for yuppie

RSS Feedfinder - Webfrontend

Software Development python
0
176
Member Avatar for vegaseat

Jumping through a few extra hoops allows you to display the common image format jpeg on a panel of the wxPython GUI window. All you need to do is to read in the image file as a binary, convert to a byte stream image and then to a bitmap. Now …

Software Development display file-stream gui image python
Member Avatar for Erik Vandamme
0
3K
Member Avatar for vegaseat

The other day I was looking at my family tree. There are my parents Antonio and Lucy Vegaseat, then my grandparents Alfonso and Ludmilla Vegaseat on my father's side and Roland and Helga Gruenspan on my mother's side. Then come my great grandparents, by now there are eight of those. …

Software Development python
Member Avatar for vegaseat
0
198
Member Avatar for vegaseat

The wxNotebook method from the wxPython module allows you to show a lot of data in a limited window space. It brings up tabbed pages you can click on to open each page. Enough said, run the code and experience the possibilities this humble method gives you.

Software Development python
Member Avatar for vegaseat
0
301
Member Avatar for Dave Sinkula

This snippet shows one way to count the number of lines in a file. It will count the last line of a file even if the last line does not end in a newline. Usage: [code]C:\>linecnt linecnt.c lines = 32[/code]

Software Development c
0
171
Member Avatar for gavindu123

This program was created by Gavindu Nuwan Dileepa and using this program you can add data to the stack , delete data and also you can view data from it... for more information contact [email]gavindu123@gmail.com[/email].. thanks

Software Development c
Member Avatar for Shark7
0
186
Member Avatar for Kerbrose

This is the coding needed to password any button on any switchboard from used in Access Database

Software Development visual-basic
Member Avatar for rose_an
0
751
Member Avatar for Dave Sinkula

How might I write an implementation in C of the standard library function [inlinecode]strcmp[/inlinecode]? Here's how I might. [i]See also [url=http://69.93.117.133/code/snippet440.html] Strings: Comparing, Case-Insensitive[/url].[/i]

Software Development c
0
1K
Member Avatar for Dave Sinkula

How might I write an implementation in C of the standard library function [inlinecode]strcpy[/inlinecode]? Here's how I might.

Software Development c
0
193
Member Avatar for Dave Sinkula

How might I write an implementation in C of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might. [url=http://www.daniweb.com/code/snippet313.html]What if I need it to be case-[b]in[/b]sensitive[/url]?

Software Development c
0
164
Member Avatar for Dave Sinkula

How might I write an implementation in C a case-insensitive version of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might. [url=http://www.daniweb.com/code/showsnippet.php?codeid=314]But I need it to be case-sensitive[/url]?

Software Development c
Member Avatar for c_coder
0
2K
Member Avatar for Dave Sinkula

How might I write an implementation in C of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might.

Software Development c
0
134
Member Avatar for yuppie

A small script which converts Microsoft Office Documents (Word, Excel, Powerpoint) to Posscript. You can build your own PDF Converter with this script. More Python/Pywin32 examples can be found at [url]http://www.win32com.de[/url] and Python based PDF Converter (for server and client usage) can be found at [url]http://www.goermezer.de[/url] .

0
383
Member Avatar for vegaseat

This is another GUI program using the Tkinter module. It shows you how to change the background and foreground color of a component/widget. In this case it is a button. The button itself is used to toggle the color selection via a color dialog box. Enough comments have been added …

Software Development gui python tkinter
0
906
Member Avatar for cheenu78

A program that can send mails. This requires that you have activation.jar and mail.jar in you classpath.

Software Development java
Member Avatar for balagangadharm
0
174
Member Avatar for kerribyrd

This is a program I created a couple of weeks ago for class using DevC++ compiler. THis program allows the user 20 tries to guess a number between 1 and 100. It keeps track of wins and losses and offfers the option to continue or quit, displaying game stats.

Software Development c++
Member Avatar for manutd
0
552
Member Avatar for kerribyrd

This is a program I created a couple of weeks ago for class using DevC++ compiler. THis program allows the user 20 tries to guess a number between 1 and 100. It keeps track of wins and losses and offfers the option to continue or quit, displaying game stats.

Software Development c
0
108
Member Avatar for anurag_pareek

This Program gives the details (name, kernel, machine type, domain, groups, sizeof data types, etc) of the host it is running on.

Software Development c display
Member Avatar for maxthrill
0
120
Member Avatar for anurag_pareek

This Program gives the UserDetails of the logged in User. a) The RealName b) Login Name ( Why do we need this?) c) Home Directory d) Default Login Shell Additional Purpose of this code would be to invoke/ learn at man getpwuid and about struct passswd

Software Development c unix
Member Avatar for bumsfeld
0
1K
Member Avatar for Mahen

This program allows u to search the Search Engine of GOOGLE from the command line. Just type MUPROG "searchtext" GIMME LOTZ OF STARZ

Software Development c++ google
0
201
Member Avatar for iacobus

Here are five simple snippets, to be used as an introduction to the use of unicode. This is, of course, an on-going thing, and hopefully additional snippets and comments will be forthcoming from the members.

Software Development python
Member Avatar for vegaseat
0
159
Member Avatar for harshchandra

It's a simple program .Just enter any date in dd/mm/yyyy format.If you enter wrong you will get the message .

Software Development c
0
192
Member Avatar for Sparkplug188

This is a very basic way to make a delay that someone new to VB might be able to use.

Software Development visual-basic
0
133
Member Avatar for vegaseat

Python's Tkinter module can be used to create a Graphics User Interface (GUI). This sample code creates a windows type form and positions a label and a canvas on the form. A simple shape is drawn on the canvas.

Software Development gui python tkinter user-interface
0
243
Member Avatar for Dave Sinkula

Obtaining user input can be done in many surprisingly different ways. This code is somewhere in the middle: safer than [inlinecode]gets(text)[/inlinecode] or [inlinecode]scanf("%s", text)[/inlinecode], but not bulletproof. It is meant to be a simple but relatively safe demonstration. The function [inlinecode]mygetline[/inlinecode] reads user input from the [inlinecode]stdin[/inlinecode] into a string …

Software Development c
Member Avatar for kedhar
0
328
Member Avatar for soumyajit_c`

Connection To Access Database and Save,Retrieve,Update D:\access\try.mdb=The Address of the Access database table 'Try'. Take a module as ModMain(Copy the code) table fields: idno,name,designation.(idno=auto number) textBoxes=TxtName,TxtDesignation And Combobox=CboRetrieve buttons=new,save,retrieve,exit

Software Development vb.net
Member Avatar for bruce2424
0
1K
Member Avatar for vicky_dev

Hey People! This program gives you all Pythagorean triplets in a given range.( Eg. ( 3,4,5) - 3^2+4^2 = 5^2 ). I've used a pointer to allocate memory to hold the squares of all numbers in the range. The program uses a function to search for element in the array.

Software Development c
0
219

The End.