132,726 Archived Topics
Remove Filter ![]() | |
This snippet shows how to use command line arguments as variables in your program. A command line argument is extra information you give a program at runtime, by typing the information after the program name like so: Linux might look like this: user$: ./myprogram argument1 argument2 A windows command prompt … Software Development c | |
Used recursion to reverse the string. Another method for string reversal. Software Development c | |
In this snippet we are playing around with wxPython's buttons, showing you how to bind the mouse click event, enable and disable, show and hide the buttons. Each button also has a tool-tip (hint) associated with itself. Software Development python | |
If you want a variable in a C function to retain its last assigned value, you simply declare it as static. Python does not have static variables, but you can impersonate one in different ways. The default list argument is my preferred option. Here are some examples. Software Development python | |
Returns the duplicate value in array t[n], which contains numbers 1 to n-1. Given two approaches with O(n) and O(n-square) complexities. Software Development c | |
Return Nth the node from the end of the linked list. Time Complexity is O(n). Software Development c linked-list | |
One line stament which acts as a conditional operator ?: If x=true, returns y else returns z. Software Development c | |
Do you think that people act demented during full moon nights? This small python program will tell you moon phase of a date you give it, so you can take precautions! Software Development python | |
[B][COLOR="Red"]Introduction[/COLOR][/B] There are many times when we try to create a binary search tree of many different data types. This article explains creation of a template library CTree. template <class T>class CTree can be used to create a binary search tree (BST) of any data type. [B][COLOR="red"]Features[/COLOR][/B] This class support … Software Development c | |
This small snippet shows how to load and display HTML (Hyper Text Markup Language) with wxPython's HtmlWindow(). This could be particularly useful with instruction and help text. HTML allows you to include pictures, fancy fonts and links. | |
When I first met folks in Las Vegas that used biorhythm values of the top players in a team to place their bet, I thought they were a little odd. Some of them were successful, but I am sure biorhythms were not the only thing they considered. You can read … Software Development python | |
FASM can output an executable PE directly, but sometimes you want to output an object file for linking with modules in other languages. The following program can be used to link with the C library of the GCC compiler with the following commands: C:\>fasm hello.asm hello.obj C:\>gcc hello.obj -o hello.exe … Software Development assembly | |
Some languages are hard to get started in. FASM appears to be one of these languages because the documentation is not detailed enough for a beginner. That's a shame because FASM is (in my opinion) one of the better assemblers. The following snippet is a simple Hello, world! program which … Software Development assembly | |
Just in time, a short Python code snippet to calculate the date of Easter Sunday of a given year. This can be expanded to calculate the important date of Mardi Gras too. Software Development python | |
I took the data of an old State Trivia game and applied it to Python. The data forms a series of lists with matching indexes. One example of how to ask a trivia question, present four possible answers, and how to evaluate the correct answer is given. You can expand … Software Development python | |
--- Basic Datatypes --- --- Form Management --- --- Data Access --- --- Component model --- | |
You can use any of the commented constants to perform the explained function. You might need to adjust the process privilege on NT based OSes. Software Development pascal | |
| |
This code disables font smoothing for a TLabel component. Can easily be converted for other VCL controls. Loren Soth Software Development pascal | |
Beginner C++ - A simple calculator writen in C++, compiled on Tubo C++ v4.5 & Borland C++ 5.5. The user inputs numbers & chooses '+','-','*'/' The operator is tested. If correct the appropriate sum is preformed. Software Development c | |
Uses the API to get the regional short date format from the PC Software Development api visual-basic | |
The Relative of push is pop. Pop removes the last item in an Array, and returns the value into a single (scalar) variable. Again, due To VB Limitations, this one works on strings. Software Development visual-basic | |
Simple Function To Simulate The Push Command, due to VB's limitations, This one is Specific To Strings. (Simple enough to modify for integers or variants, etc) Software Development visual-basic | |
This is a little code for a shell that allows for simple redirection and multiple yes! MULTIPLE piping abilities. It is slightly glitched for background processes, and this is only my second program written with C/C++ so it looks to be quite inefficient, but the piping works pretty nicely. The … | |
The little program allows eye patients to test their color skills. They are given a random color rectangle by the computer and are then asked to match the color as closely as they can using sliders of the three basic colors. An evaluation button examines the closeness of the results. Software Development python | |
This prog uses SQL Server's Master Databases xp_cmdshell stored procedure (Shell Commands) to send messages in a LAN.Make Sure the driver name is 'netsend' and it points to Master Database. Check and change the username and passwords in the Java Program also.Make sure you have sufficient priviledges to execute stored … Software Development java java-swing sql | |
This program calculates the determinant of a square matrix of any order using a recursive function. Uses a square matrix struct and related functions. Software Development c | |
count the number of occurrences of a sub-string in another string. a good example for learning how to make your own functions like strcpy, strlen and strcmp Software Development c | |
Playing a wave file just got a whole lot easier. Software Development | |
Yet another angle at this same topic. [i]See also [url=http://www.daniweb.com/code/snippet318.html]Parsing a String into Tokens Using strcspn, Part 1[/url] and [url=http://www.daniweb.com/code/snippet443.html]Parsing a String into Tokens Using strcspn, Part 2[/url].[/i] Software Development c | |
This snippet is a variation of the code in [url=http://69.93.117.133/code/snippet318.html][i] Parsing a String into Tokens Using strcspn, Part 1[/i][/url]. It uses canned strings rather than reading from a file. [i]See also [url=http://www.daniweb.com/code/snippet444.html]Parsing a String into Tokens Using strcspn, Part 3[/url].[/i] Software Development c | |
Regular expression pattern match in a string, I only checked with * as wild card, other wild card characters are easy implement but I havent done that. any problems you can email me @ [email]rramaswa@usc.edu[/email] platform - Unix/Linux, havent tested in windows, should'nt be a problem unless some standard header … | |
How might I write an implementation in C of a case-insensitive version of the standard library function [inlinecode]strcmp[/inlinecode]? Here's how I might. This this is often available as a nonstandard function that may be called [inlinecode]stricmp[/inlinecode], [inlinecode]_stricmp[/inlinecode], [inlinecode]strcmpi[/inlinecode], or [inlinecode]strcasecmp[/inlinecode]. [i]See also [url=http://69.93.117.133/code/misc.php?action=edit&codeid=316]Strings: Comparing[/url].[/i] Software Development c | |
I created a bowling game, Which for the most part works correctly. I toiled for hours trying to figure out how to do the scoring so i gave up. Its fairly simple code so not much of a description needed. Software Development c++ | |
Shows how to create a simple 'Process Manager'. and control processes Software Development | |
So you want random numbers with negative values... How do you get them? This is a simple method to do so. Software Development c++ | |
This class implements a mechanism to encapsulate a selector. A selector is method signature descriptor. It is an easy way to create what may be called function pointers like in C language. I took my inspiration from Objective-C. Software Development java objective-c | |
A very versatile, fully customizable graph drawing program using the TurboC++ graphics library. The DrawGraph() functions does the actual graph drawing. It can be used to draw graphs of BOTH CARTESIAN AS WELL AS POLAR functions. You'll need to pass the math. function to the program. The main() demonstrates the … | |
This is an Ada package that simply waits for the user to press the enter key. (If they enter anything else it's simply ignored.) Software Development | |
Program to demonstrate pattern-searching of strings. This program interactively builds a list of words and searches for words in the list that match a specified pattern. The pattern can include wildcard chars * and ?. Eg : The query s* gives the words in the list which start with s. … Software Development c user-interface | |
Well its fairly self explanatory, its a program that shows that calculates the hypotenuse using the pythagorean theorum, It displays the values of the sides and shows a crappy ascii art right triangle with the values input and the later found values Software Development c++ | |
Ok I greatly modified a tutorial to have a completely different interface, a highscore list and a little tiny really rare easter egg. to get the highscore list. I want to figure out how to sort the highscore list if it is possible. And dont worry about it freaking out, … Software Development c++ | |
Not much excitement in that standard wxPython empty window icon. It's time you put a more picturesque icon up there. This snippet shows you how to use an embedded icon or your own icon you have as an icon file in your working folder. Actually, the embedded icon is written … Software Development python | |
In this experiment we call the paint event and establish a device context to draw a rectangle and fill it with the color set by the brush. Actually, we will draw 99 random sized and random colored rectangles with a small time delay. Don't worry, it will be faster than … Software Development python |
The End.